Documentation
¶
Index ¶
- Constants
- Variables
- func CollectTableRanges(ctx context.Context, objs []objectio.ObjectStats, data *batch.Batch, ...) (err error)
- func CollectTableRangesFromFile(ctx context.Context, obj objectio.ObjectStats, data *batch.Batch, ...) (err error)
- func EncodeCluser(packer *types.Packer, tableId uint64, objectType int8, obj *objectio.ObjectId, ...)
- func ForEachFile(ctx context.Context, obj objectio.ObjectStats, ...) (err error)
- func GetMaxTSOfCompactCKP(ctx context.Context, fs fileservice.FileService) (ts types.TS, err error)
- func ListCKPMetaFiles(ctx context.Context, fs fileservice.FileService) (files []ioutil.TSRangeFile, err error)
- func ListCKPMetaNames(ctx context.Context, fs fileservice.FileService) (files []string, err error)
- func MakeDataScanTableEntryBatch() *batch.Batch
- func MakeDataScanTableIDBatch() *batch.Batch
- func MakeTableRangeBatch() *batch.Batch
- func NewDataReader(ctx context.Context, fs fileservice.FileService, obj objectio.ObjectStats, ...) engine.Reader
- func NewDataSinker(mp *mpool.MPool, fs fileservice.FileService, opts ...ioutil.SinkerOption) *ioutil.Sinker
- func NewMetaBatch() *batch.Batch
- func NewMetaSinker(mp *mpool.MPool, fs fileservice.FileService, opts ...ioutil.SinkerOption) *ioutil.Sinker
- func NewObjectListBatch() *batch.Batch
- func ScanObjectStats(data *batch.Batch) (objs []objectio.ObjectStats)
- func TableRangesRows(r []TableRange) int
- func TableRangesString(r []TableRange) string
- type ObjectIter
- type TableRange
Constants ¶
const ( TableObjectsAttr_Accout = "account_id" TableObjectsAttr_DB = "db_id" TableObjectsAttr_Table = "table_id" TableObjectsAttr_ObjectType = "object_type" TableObjectsAttr_ID = "id" TableObjectsAttr_CreateTS = "create_ts" TableObjectsAttr_DeleteTS = "delete_ts" // TableObjects should be clustered by `table`+`object_type`+`id` + `is_deleted` TableObjectsAttr_Cluster = "cluster" )
const ( TableObjectsAttr_Accout_Idx = ioutil.TableObjectsAttr_Accout_Idx TableObjectsAttr_DB_Idx = ioutil.TableObjectsAttr_DB_Idx TableObjectsAttr_Table_Idx = ioutil.TableObjectsAttr_Table_Idx TableObjectsAttr_ObjectType_Idx = ioutil.TableObjectsAttr_ObjectType_Idx TableObjectsAttr_ID_Idx = ioutil.TableObjectsAttr_ID_Idx TableObjectsAttr_CreateTS_Idx = ioutil.TableObjectsAttr_CreateTS_Idx TableObjectsAttr_DeleteTS_Idx = ioutil.TableObjectsAttr_DeleteTS_Idx TableObjectsAttr_Cluster_Idx = ioutil.TableObjectsAttr_Cluster_Idx TableObjectsAttr_PhysicalAddr_Idx = 8 )
const ( ObjectType_Invalid = ioutil.ObjectType_Invalid ObjectType_Data = ioutil.ObjectType_Data ObjectType_Tombstone = ioutil.ObjectType_Tombstone )
const ( MetaAttr_Table = "table_id" MetaAttr_ObjectType = "object_type" MetaAttr_Start = "start_rowid" MetaAttr_End = "end_rowid" MetaAttr_ObjectStats = "objectStats" )
const ( MetaAttr_Table_Idx = 0 MetaAttr_ObjectType_Idx = 1 MetaAttr_Start_Idx = 2 MetaAttr_End_Idx = 3 MetaAttr_ObjectStats_Idx = 4 )
Variables ¶
var DataScan_ObjectEntryAttrs = []string{ TableObjectsAttr_Table, TableObjectsAttr_ID, TableObjectsAttr_CreateTS, TableObjectsAttr_DeleteTS, }
var DataScan_ObjectEntrySeqnums = []uint16{ TableObjectsAttr_Table_Idx, TableObjectsAttr_ID_Idx, TableObjectsAttr_CreateTS_Idx, TableObjectsAttr_DeleteTS_Idx, }
var DataScan_ObjectEntryTypes = []types.Type{ TableObjectsTypes[TableObjectsAttr_Table_Idx], TableObjectsTypes[TableObjectsAttr_ID_Idx], TableObjectsTypes[TableObjectsAttr_CreateTS_Idx], TableObjectsTypes[TableObjectsAttr_DeleteTS_Idx], }
var DataScan_TableIDAtrrs = append(TableObjectsAttrs, objectio.PhysicalAddr_Attr)
used to scan data with columns: [table object attrs, `phy_addr`]
var DataScan_TableIDSeqnums = append(TableObjectsSeqnums, objectio.SEQNUM_ROWID)
var DataScan_TableIDTypes = append(TableObjectsTypes, objectio.RowidType)
var DataSinkerFactory ioutil.FileSinkerFactory
var MetaAttrs = []string{ MetaAttr_Table, MetaAttr_ObjectType, MetaAttr_Start, MetaAttr_End, MetaAttr_ObjectStats, }
var MetaSchema_TableRange_Attrs = MetaAttrs
var MetaSchema_TableRange_Seqnums = MetaSeqnums
MetaSchema ['table_id', 'object_type', 'start_row', 'end_row', 'location'] [uint64, int8, row id, row id, string] `table_id` is the id of the table `object_type` is the type of the object [Data|Tombstone] `start_row` is the start rowid of the table in the object `end_row` is the end rowid of the table in the object (same object as `start_row`) `location` is the location of the object
var MetaSchema_TableRange_Types = MetaTypes
var MetaSeqnums = []uint16{0, 1, 2, 3, 4}
var MetaSinkerFactory ioutil.FileSinkerFactory
var MetaTypes = []types.Type{ types.T_uint64.ToType(), types.T_int8.ToType(), types.T_Rowid.ToType(), types.T_Rowid.ToType(), types.T_char.ToType(), }
var TableObjectsAttrs = []string{ TableObjectsAttr_Accout, TableObjectsAttr_DB, TableObjectsAttr_Table, TableObjectsAttr_ObjectType, TableObjectsAttr_ID, TableObjectsAttr_CreateTS, TableObjectsAttr_DeleteTS, TableObjectsAttr_Cluster, }
var TableObjectsSeqnums = []uint16{0, 1, 2, 3, 4, 5, 6, 7}
Functions ¶
func CollectTableRanges ¶
func CollectTableRanges( ctx context.Context, objs []objectio.ObjectStats, data *batch.Batch, mp *mpool.MPool, fs fileservice.FileService, ) (err error)
func CollectTableRangesFromFile ¶
func CollectTableRangesFromFile( ctx context.Context, obj objectio.ObjectStats, data *batch.Batch, mp *mpool.MPool, fs fileservice.FileService, ) (err error)
the data in the obj must be sorted by the table id and object type
func EncodeCluser ¶
func ForEachFile ¶
func ForEachFile( ctx context.Context, obj objectio.ObjectStats, forEachRow func( accout uint32, dbid, tid uint64, objectType int8, objectStats objectio.ObjectStats, start, end types.TS, rowID types.Rowid, ) error, postEachRow func() error, mp *mpool.MPool, fs fileservice.FileService, ) (err error)
func GetMaxTSOfCompactCKP ¶
func GetMaxTSOfCompactCKP( ctx context.Context, fs fileservice.FileService, ) (ts types.TS, err error)
GetMaxTSOfCompactCKP returns the max ts of the compact checkpoint
func ListCKPMetaFiles ¶
func ListCKPMetaFiles( ctx context.Context, fs fileservice.FileService, ) (files []ioutil.TSRangeFile, err error)
ListCKPMetaFiles returns all checkpoint meta files
func ListCKPMetaNames ¶
func ListCKPMetaNames( ctx context.Context, fs fileservice.FileService, ) (files []string, err error)
ListCKPMetaNames returns the names of all checkpoint meta files
func MakeTableRangeBatch ¶
func NewDataReader ¶
func NewDataReader( ctx context.Context, fs fileservice.FileService, obj objectio.ObjectStats, opts ...readutil.ReaderOption, ) engine.Reader
func NewDataSinker ¶
func NewDataSinker( mp *mpool.MPool, fs fileservice.FileService, opts ...ioutil.SinkerOption, ) *ioutil.Sinker
func NewMetaBatch ¶
func NewMetaSinker ¶
func NewMetaSinker( mp *mpool.MPool, fs fileservice.FileService, opts ...ioutil.SinkerOption, ) *ioutil.Sinker
func NewObjectListBatch ¶
func ScanObjectStats ¶
func ScanObjectStats( data *batch.Batch, ) (objs []objectio.ObjectStats)
func TableRangesRows ¶
func TableRangesRows(r []TableRange) int
func TableRangesString ¶
func TableRangesString(r []TableRange) string
Types ¶
type ObjectIter ¶
type ObjectIter struct {
// contains filtered or unexported fields
}
func NewObjectIter ¶
func NewObjectIter( ctx context.Context, ranges []TableRange, mp *mpool.MPool, fs fileservice.FileService, ) (iter ObjectIter)
func (*ObjectIter) Close ¶
func (iter *ObjectIter) Close()
func (*ObjectIter) Entry ¶
func (iter *ObjectIter) Entry() (ret objectio.ObjectEntry)
func (*ObjectIter) Next ¶
func (iter *ObjectIter) Next() (bool, error)
func (*ObjectIter) Reset ¶
func (iter *ObjectIter) Reset()
type TableRange ¶
type TableRange struct {
TableID uint64
ObjectType int8
Start types.Rowid
End types.Rowid
ObjectStats objectio.ObjectStats
}
func ExportToTableRanges ¶
func ExportToTableRanges( data *batch.Batch, ) (ranges []TableRange)
func ExportToTableRangesByFilter ¶
func ExportToTableRangesByFilter( data *batch.Batch, tableId uint64, objectType int8, ) (ranges []TableRange)
data should be sorted by table id and object type the schema of the table entry
func (*TableRange) AppendTo ¶
the schema of the table entry 0: table id 1: object type 2: start rowid 3: end rowid 4: location
func (*TableRange) IsEmpty ¶
func (r *TableRange) IsEmpty() bool
func (*TableRange) MarshalJSON ¶
func (r *TableRange) MarshalJSON() ([]byte, error)
func (*TableRange) Rows ¶
func (r *TableRange) Rows() int
func (*TableRange) String ¶
func (r *TableRange) String() string