trim

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByAge

func ByAge(ctx context.Context, l klevdb.Log, before time.Time) (map[int64]struct{}, int64, error)

ByAge tries to remove the messages at the start of the log before given time.

returns the offsets it deleted and the amount of storage freed

func ByAgeMulti added in v0.9.0

func ByAgeMulti(ctx context.Context, l klevdb.Log, before time.Time, backoff klevdb.DeleteMultiBackoff) (map[int64]struct{}, int64, error)

ByAgeMulti is similar to ByAge, but will try to remove messages from multiple segments

func ByCount added in v0.2.3

func ByCount(ctx context.Context, l klevdb.Log, max int) (map[int64]struct{}, int64, error)

ByCount tries to remove messages to keep the number of messages in the log under max count.

returns the offsets it deleted and the amount of storage freed

func ByCountMulti added in v0.9.0

func ByCountMulti(ctx context.Context, l klevdb.Log, max int, backoff klevdb.DeleteMultiBackoff) (map[int64]struct{}, int64, error)

ByCountMulti is similar to ByCount, but will try to remove messages from multiple segments

func ByOffset added in v0.2.5

func ByOffset(ctx context.Context, l klevdb.Log, before int64) (map[int64]struct{}, int64, error)

ByOffset tries to remove the messages at the start of the log before offset

returns the offsets it deleted and the amount of storage freed

func ByOffsetMulti added in v0.9.0

func ByOffsetMulti(ctx context.Context, l klevdb.Log, before int64, backoff klevdb.DeleteMultiBackoff) (map[int64]struct{}, int64, error)

ByOffsetMulti is similar to ByOffset, but will try to remove messages from multiple segments

func BySize

func BySize(ctx context.Context, l klevdb.Log, sz int64) (map[int64]struct{}, int64, error)

BySize tries to remove messages until log size is less then sz

returns the offsets it deleted and the amount of storage freed

func BySizeMulti added in v0.9.0

func BySizeMulti(ctx context.Context, l klevdb.Log, sz int64, backoff klevdb.DeleteMultiBackoff) (map[int64]struct{}, int64, error)

BySizeMulti is similar to BySize, but will try to remove messages from multiple segments

func FindByAge added in v0.3.0

func FindByAge(ctx context.Context, l klevdb.Log, before time.Time) (map[int64]struct{}, error)

FindByAge returns a set of offsets for messages that are at the start of the log and before given time.

func FindByCount added in v0.3.0

func FindByCount(ctx context.Context, l klevdb.Log, max int) (map[int64]struct{}, error)

FindByCount returns a set of offsets for messages that when removed will keep number of the messages in the log less then max

func FindByOffset added in v0.3.0

func FindByOffset(ctx context.Context, l klevdb.Log, before int64) (map[int64]struct{}, error)

FindByOffset returns a set of offsets for messages that offset is before a given offset

func FindBySize added in v0.3.0

func FindBySize(ctx context.Context, l klevdb.Log, sz int64) (map[int64]struct{}, error)

FindBySize returns a set of offsets for messages that if deleted will decrease the log size to sz

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL