Documentation ¶
Index ¶
- func ParseFilename(filename string) (uuid.UUID, string, string, backend.Encoding, string, error)
- func ReplayWALAndGetRecords(file *os.File, v encoding.VersionedEncoding, enc backend.Encoding, ...) ([]common.Record, error, error)
- type AppendBlock
- func (a *AppendBlock) Append(id common.ID, b []byte) error
- func (a *AppendBlock) BlockID() uuid.UUID
- func (a *AppendBlock) Clear() error
- func (a *AppendBlock) DataLength() uint64
- func (a *AppendBlock) Find(id common.ID, combiner common.ObjectCombiner) ([]byte, error)
- func (a *AppendBlock) Iterator(combiner common.ObjectCombiner) (encoding.Iterator, error)
- func (a *AppendBlock) Meta() *backend.BlockMeta
- type Config
- type LocalBlock
- type WAL
- func (w *WAL) ClearFolder(dir string) error
- func (w *WAL) GetFilepath() string
- func (w *WAL) LocalBackend() *local.Backend
- func (w *WAL) NewBlock(id uuid.UUID, tenantID string, dataEncoding string) (*AppendBlock, error)
- func (w *WAL) NewFile(blockid uuid.UUID, tenantid string, dir string) (*os.File, string, backend.Encoding, error)
- func (w *WAL) RescanBlocks(log log.Logger) ([]*AppendBlock, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFilename ¶ added in v1.2.0
ParseFilename returns (blockID, tenant, version, encoding, dataEncoding, error). Example: "00000000-0000-0000-0000-000000000000:1:v2:snappy:v1"
Types ¶
type AppendBlock ¶
type AppendBlock struct {
// contains filtered or unexported fields
}
AppendBlock is a block that is actively used to append new objects to. It stores all data in the appendFile in the order it was received and an in memory sorted index.
func (*AppendBlock) Append ¶ added in v1.2.0
func (a *AppendBlock) Append(id common.ID, b []byte) error
func (*AppendBlock) BlockID ¶ added in v0.7.0
func (a *AppendBlock) BlockID() uuid.UUID
func (*AppendBlock) Clear ¶
func (a *AppendBlock) Clear() error
func (*AppendBlock) DataLength ¶ added in v0.6.0
func (a *AppendBlock) DataLength() uint64
func (*AppendBlock) Find ¶
func (a *AppendBlock) Find(id common.ID, combiner common.ObjectCombiner) ([]byte, error)
func (*AppendBlock) Iterator ¶ added in v1.2.0
func (a *AppendBlock) Iterator(combiner common.ObjectCombiner) (encoding.Iterator, error)
func (*AppendBlock) Meta ¶ added in v0.7.0
func (a *AppendBlock) Meta() *backend.BlockMeta
type LocalBlock ¶ added in v0.7.0
type LocalBlock struct { encoding.BackendBlock // contains filtered or unexported fields }
LocalBlock is a block stored in a local storage. It can be searched and flushed to a remote backend, and permanently tracks the flushed time with a special file in the block
func NewLocalBlock ¶ added in v0.7.0
func NewLocalBlock(ctx context.Context, existingBlock *encoding.BackendBlock, l *local.Backend) (*LocalBlock, error)
func (*LocalBlock) FlushedTime ¶ added in v0.7.0
func (c *LocalBlock) FlushedTime() time.Time
FlushedTime returns the time the block was flushed. Will return 0
if the block was never flushed
func (*LocalBlock) SetFlushed ¶ added in v0.7.0
func (c *LocalBlock) SetFlushed(ctx context.Context) error
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
func (*WAL) ClearFolder ¶ added in v1.2.0
func (*WAL) GetFilepath ¶ added in v1.2.0
func (*WAL) LocalBackend ¶ added in v0.7.0
func (*WAL) RescanBlocks ¶ added in v1.0.0
func (w *WAL) RescanBlocks(log log.Logger) ([]*AppendBlock, error)
RescanBlocks returns a slice of append blocks from the wal folder
Click to show internal directories.
Click to hide internal directories.