logfs

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChunkMinID defines the lower boundary for chunk ID (exclusive)
	ChunkMinID = ""
	// ChunkMaxID defines the upper boundary for chunk ID (exclusive)
	ChunkMaxID = "~"
)

Variables

This section is empty.

Functions

func NewLocalLog added in v0.6.0

func NewLocalLog(cfg Config) *localLog

NewLocalLog creates the new localLog object for the cfg provided

Types

type ChunkInfo

type ChunkInfo struct {
	// ID is the chunk ID
	ID string `json:"id"`
	// Min is the minimum (first) record ID stored in the chunk
	Min ulid.ULID `json:"min"`
	// Max is the maximum (last) record ID stored in the chunk
	Max ulid.ULID `json:"max"`
	// RecordsCount is the number of records stored in the chunk
	RecordsCount int `json:"recordsCount"`
}

ChunkInfo is the descriptor which describes a chunk information in the log meta-storage

type Config added in v0.6.0

type Config struct {
	MaxRecordsLimit int
	MaxBunchSize    int
	// MaxLocks defines how many different logs may be managed at a time
	MaxLocks int
}

func GetDefaultConfig added in v0.6.0

func GetDefaultConfig() Config

type LogsMetaStorage

type LogsMetaStorage interface {
	// GetLastChunk returns the chunk with the biggest chunkID
	GetLastChunk(ctx context.Context, logID string) (ChunkInfo, error)
	// GetChunks returns the list of chunks associated with the logID
	GetChunks(ctx context.Context, logID string) ([]ChunkInfo, error)
	// UpsertChunkInfos update or insert new records associated with logID into the meta-storage
	UpsertChunkInfos(ctx context.Context, logID string, cis []ChunkInfo) error
}

LogsMetaStorage interface describes a log meata storage for the log chunks info

Jump to

Keyboard shortcuts

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