Documentation ¶
Index ¶
- Constants
- Variables
- type BatchType
- type Cleaner
- type CleanerState
- type DiskCleaner
- type GCTable
- func (t *GCTable) Compare(table *GCTable) bool
- func (t *GCTable) Merge(GCTable *GCTable)
- func (t *GCTable) ReadTable(ctx context.Context, name string, size int64, fs *objectio.ObjectFS, ...) error
- func (t *GCTable) SaveFullTable(start, end types.TS, fs *objectio.ObjectFS, files []string) ([]objectio.BlockObject, error)
- func (t *GCTable) SaveTable(start, end types.TS, fs *objectio.ObjectFS, files []string) ([]objectio.BlockObject, error)
- func (t *GCTable) SoftGC(table *GCTable, ts types.TS, snapShotList map[uint32]containers.Vector, ...) ([]string, map[uint32][]types.TS)
- func (t *GCTable) String() string
- func (t *GCTable) UpdateTable(data *logtail.CheckpointData)
- type GCWorker
- type ObjectEntry
- type TombstoneEntry
Constants ¶
View Source
const ( MessgeReplay = iota MessgeNormal )
View Source
const ( PrefixGCMeta = "gc" PrefixSnapMeta = "snap" PrefixAcctMeta = "acct" GCMetaDir = "gc/" CKPMetaDir = "ckp/" )
View Source
const ( GCAttrObjectName = "name" GCAttrBlockId = "block_id" GCAttrTableId = "table_id" GCAttrDBId = "db_id" GCAttrCommitTS = "commit_ts" GCCreateTS = "create_time" GCDeleteTS = "delete_time" GCAttrTombstone = "tombstone" GCAttrVersion = "version" )
View Source
const ( AddChecker = "add_checker" RemoveChecker = "remove_checker" )
View Source
const ( CheckerKeyTTL = "ttl" CheckerKeyMinTS = "min_ts" )
View Source
const CurrentVersion = uint16(3)
View Source
const MinMergeCount = 20
View Source
const NotFoundLimit = 10
Variables ¶
View Source
var ( BlockSchemaAttr = []string{ GCAttrObjectName, GCCreateTS, GCDeleteTS, GCAttrCommitTS, GCAttrTableId, } BlockSchemaTypes = []types.Type{ types.New(types.T_varchar, 5000, 0), types.New(types.T_TS, types.MaxVarcharLen, 0), types.New(types.T_TS, types.MaxVarcharLen, 0), types.New(types.T_TS, types.MaxVarcharLen, 0), types.New(types.T_uint64, 0, 0), } BlockSchemaAttrV1 = []string{ GCAttrBlockId, GCAttrTableId, GCAttrDBId, GCAttrObjectName, } BlockSchemaTypesV1 = []types.Type{ types.New(types.T_Blockid, 0, 0), types.New(types.T_uint64, 0, 0), types.New(types.T_uint64, 0, 0), types.New(types.T_varchar, 5000, 0), } TombstoneSchemaAttr = []string{ GCAttrTombstone, GCAttrObjectName, GCAttrCommitTS, } TombstoneSchemaTypes = []types.Type{ types.New(types.T_varchar, 5000, 0), types.New(types.T_varchar, 5000, 0), types.New(types.T_TS, types.MaxVarcharLen, 0), } VersionsSchemaAttr = []string{ GCAttrVersion, } VersionsSchemaTypes = []types.Type{ types.New(types.T_uint16, 0, 0), } DropTableSchemaAttr = []string{ GCAttrTableId, GCAttrDBId, } DropTableSchemaTypes = []types.Type{ types.New(types.T_uint64, 0, 0), types.New(types.T_uint64, 0, 0), } DropDBSchemaAtt = []string{ GCAttrDBId, } DropDBSchemaTypes = []types.Type{ types.New(types.T_uint64, 0, 0), } DeleteFileSchemaAtt = []string{ GCAttrObjectName, } DeleteFileSchemaTypes = []types.Type{ types.New(types.T_varchar, 5000, 0), } )
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶ added in v1.2.0
type Cleaner interface { Replay() error Process() TryGC() error AddChecker(checker func(item any) bool, key string) int RemoveChecker(key string) error GetMaxConsumed() *checkpoint.CheckpointEntry Stop() // for test SetMinMergeCountForTest(count int) GetMinMerged() *checkpoint.CheckpointEntry CheckGC() error GetInputs() *GCTable SetTid(tid uint64) EnableGCForTest() DisableGCForTest() SetCheckGC(enable bool) GetMPool() *mpool.MPool GetSnapshots() (map[uint32]containers.Vector, error) }
func NewCheckpointCleaner ¶ added in v1.2.0
func NewCheckpointCleaner( ctx context.Context, fs *objectio.ObjectFS, ckpClient checkpoint.RunnerReader, disableGC bool, ) Cleaner
type DiskCleaner ¶
type DiskCleaner struct {
// contains filtered or unexported fields
}
DiskCleaner is the main structure of gc operation, and provides "JobFactory" to let tae notify itself to perform a gc
func NewDiskCleaner ¶
func NewDiskCleaner( diskCleaner Cleaner, ) *DiskCleaner
func (*DiskCleaner) GetCleaner ¶ added in v1.2.0
func (cleaner *DiskCleaner) GetCleaner() Cleaner
func (*DiskCleaner) Start ¶
func (cleaner *DiskCleaner) Start()
func (*DiskCleaner) Stop ¶
func (cleaner *DiskCleaner) Stop()
type GCTable ¶
GCTable is a data structure in memory after consuming checkpoint
func NewGCTable ¶
func NewGCTable() *GCTable
func (*GCTable) ReadTable ¶
func (t *GCTable) ReadTable(ctx context.Context, name string, size int64, fs *objectio.ObjectFS, ts types.TS) error
ReadTable reads an s3 file and replays a GCTable in memory
func (*GCTable) SaveFullTable ¶
func (t *GCTable) SaveFullTable(start, end types.TS, fs *objectio.ObjectFS, files []string) ([]objectio.BlockObject, error)
SaveFullTable is to write data to s3
func (*GCTable) SaveTable ¶
func (t *GCTable) SaveTable(start, end types.TS, fs *objectio.ObjectFS, files []string) ([]objectio.BlockObject, error)
SaveTable is to write data to s3
func (*GCTable) SoftGC ¶
func (t *GCTable) SoftGC( table *GCTable, ts types.TS, snapShotList map[uint32]containers.Vector, meta *logtail.SnapshotMeta, ) ([]string, map[uint32][]types.TS)
SoftGC is to remove objectentry that can be deleted from GCTable
func (*GCTable) UpdateTable ¶
func (t *GCTable) UpdateTable(data *logtail.CheckpointData)
type ObjectEntry ¶
type ObjectEntry struct {
// contains filtered or unexported fields
}
type TombstoneEntry ¶ added in v1.2.1
type TombstoneEntry struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.