Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructObjStatsByLoadObjMeta(ctx context.Context, metaLoc objectio.Location, fs fileservice.FileService) (stats objectio.ObjectStats, dataMeta objectio.ObjectDataMeta, err error)
- func EvalSelectedOnFixedSizeColumnFactory[T types.FixedSizeTExceptStrType](v T) func(*vector.Vector, []int32, *[]int32)
- func EvalSelectedOnFixedSizeSortedColumnFactory[T types.FixedSizeTExceptStrType](v T, comp func(T, T) int) func(*vector.Vector, []int32, *[]int32)
- func EvalSelectedOnOrderedSortedColumnFactory[T types.OrderedT](v T) func(*vector.Vector, []int32, *[]int32)
- func EvalSelectedOnVarlenColumnFactory(v []byte) func(*vector.Vector, []int32, *[]int32)
- func EvalSelectedOnVarlenSortedColumnFactory(v []byte) func(*vector.Vector, []int32, *[]int32)
- func ForeachBlkInObjStatsList(next bool, dataMeta objectio.ObjectDataMeta, ...)
- func ForeachSnapshotObjects(ts timestamp.Timestamp, ...) (err error)
- func ListTnService(appendFn func(service *metadata.TNService))
- func NewMergeReader(readers []engine.Reader) *mergeReader
- func UnfoldBlkInfoFromObjStats(stats *objectio.ObjectStats) (blks []catalog.BlockInfo)
- func UpdateStats(ctx context.Context, tbl *txnTable, s *plan2.StatsInfoMap, ...) bool
- func UpdateStatsForPartitionTable(ctx context.Context, baseTable *txnTable, partitionTables []any, ...) bool
- type DNStore
- type Engine
- func (e *Engine) AllocateIDByKey(ctx context.Context, key string) (uint64, error)
- func (e *Engine) Create(ctx context.Context, name string, op client.TxnOperator) error
- func (e *Engine) Database(ctx context.Context, name string, op client.TxnOperator) (engine.Database, error)
- func (e *Engine) Databases(ctx context.Context, op client.TxnOperator) ([]string, error)
- func (e *Engine) Delete(ctx context.Context, name string, op client.TxnOperator) error
- func (e *Engine) GetNameById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName string, tblName string, err error)
- func (e *Engine) GetRelationById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName, tableName string, rel engine.Relation, err error)
- func (e *Engine) Hints() (h engine.Hints)
- func (e *Engine) InitLogTailPushModel(ctx context.Context, timestampWaiter client.TimestampWaiter) error
- func (e *Engine) New(ctx context.Context, op client.TxnOperator) error
- func (e *Engine) NewBlockReader(ctx context.Context, num int, ts timestamp.Timestamp, expr *plan.Expr, ...) ([]engine.Reader, error)
- func (e *Engine) Nodes(isInternal bool, tenant string, username string, cnLabel map[string]string) (engine.Nodes, error)
- func (e *Engine) UpdateOfPull(ctx context.Context, tnList []DNStore, tbl *txnTable, op client.TxnOperator, ...) error
- func (e *Engine) UpdateOfPush(ctx context.Context, databaseId, tableId uint64, ts timestamp.Timestamp) error
- type Entry
- type IDGenerator
- type PartitionReader
- type Pos
- type StatsBlkIter
- type Transaction
- func (txn *Transaction) Adjust() error
- func (txn *Transaction) Commit(ctx context.Context) ([]txn.TxnRequest, error)
- func (txn *Transaction) EndStatement()
- func (txn *Transaction) GetSQLCount() uint64
- func (txn *Transaction) IncrSQLCount()
- func (txn *Transaction) IncrStatementID(ctx context.Context, commit bool) error
- func (txn *Transaction) PutCnBlockDeletes(blockId *types.Blockid, offsets []int64)
- func (txn *Transaction) ReadOnly() bool
- func (txn *Transaction) Rollback(ctx context.Context) error
- func (txn *Transaction) RollbackLastStatement(ctx context.Context) error
- func (txn *Transaction) StartStatement()
- func (txn *Transaction) WriteBatch(typ int, databaseId uint64, tableId uint64, databaseName string, ...) error
- func (txn *Transaction) WriteFile(typ int, databaseId, tableId uint64, databaseName, tableName string, ...) error
- func (txn *Transaction) WriteFileLocked(typ int, databaseId, tableId uint64, databaseName, tableName string, ...) error
Constants ¶
const ( PREFETCH_THRESHOLD = 256 PREFETCH_ROUNDS = 24 SMALLSCAN_THRESHOLD = 100 LARGESCAN_THRESHOLD = 1500 )
const ( INSERT = iota DELETE COMPACTION_CN UPDATE ALTER )
const ( SMALL = iota NORMAL LARGE )
const ( MO_DATABASE_ID_NAME_IDX = 1 MO_DATABASE_ID_ACCOUNT_IDX = 2 MO_DATABASE_LIST_ACCOUNT_IDX = 1 MO_TABLE_ID_NAME_IDX = 1 MO_TABLE_ID_DATABASE_ID_IDX = 2 MO_TABLE_ID_ACCOUNT_IDX = 3 MO_TABLE_LIST_DATABASE_ID_IDX = 1 MO_TABLE_LIST_ACCOUNT_IDX = 2 MO_PRIMARY_OFF = 2 INIT_ROWID_OFFSET = math.MaxUint32 )
const ( HASH_VALUE_FUN string = "hash_value" MAX_RANGE_SIZE int64 = 200 )
const (
AllColumns = "*"
)
const (
WorkspaceThreshold uint64 = 1 * mpool.MB
)
Variables ¶
var GcCycle = 10 * time.Second
Functions ¶
func ConstructObjStatsByLoadObjMeta ¶ added in v1.1.0
func ConstructObjStatsByLoadObjMeta( ctx context.Context, metaLoc objectio.Location, fs fileservice.FileService) (stats objectio.ObjectStats, dataMeta objectio.ObjectDataMeta, err error)
func EvalSelectedOnFixedSizeColumnFactory ¶ added in v0.8.0
func EvalSelectedOnFixedSizeColumnFactory[T types.FixedSizeTExceptStrType]( v T, ) func(*vector.Vector, []int32, *[]int32)
2.1 fixedSize type column + non-sorted
func EvalSelectedOnFixedSizeSortedColumnFactory ¶ added in v0.8.0
func EvalSelectedOnFixedSizeSortedColumnFactory[T types.FixedSizeTExceptStrType]( v T, comp func(T, T) int, ) func(*vector.Vector, []int32, *[]int32)
1.2 fixed size column type + sorted column
func EvalSelectedOnOrderedSortedColumnFactory ¶ added in v0.8.0
func EvalSelectedOnOrderedSortedColumnFactory[T types.OrderedT]( v T, ) func(*vector.Vector, []int32, *[]int32)
1.1 ordered column type + sorted column
func EvalSelectedOnVarlenColumnFactory ¶ added in v0.8.0
2.2 varlen type column + non-sorted
func EvalSelectedOnVarlenSortedColumnFactory ¶ added in v0.8.0
1.3 varlen type column + sorted
func ForeachBlkInObjStatsList ¶ added in v1.1.0
func ForeachBlkInObjStatsList( next bool, dataMeta objectio.ObjectDataMeta, onBlock func(blk *catalog.BlockInfo) bool, objects ...objectio.ObjectStats, )
ForeachBlkInObjStatsList receives an object info list, and visits each blk of these object info by OnBlock, until the onBlock returns false or all blks have been enumerated. when onBlock returns a false, the next argument decides whether continue onBlock on the next stats or exit foreach completely.
func ForeachSnapshotObjects ¶ added in v1.1.0
func ForeachSnapshotObjects( ts timestamp.Timestamp, onObject func(obj logtailreplay.ObjectInfo, isCommitted bool) error, tableSnapshot *logtailreplay.PartitionState, uncommitted ...objectio.ObjectStats, ) (err error)
func ListTnService ¶ added in v1.1.0
ListTnService gets all tn service in the cluster
func NewMergeReader ¶ added in v0.8.0
func UnfoldBlkInfoFromObjStats ¶ added in v1.1.0
func UnfoldBlkInfoFromObjStats(stats *objectio.ObjectStats) (blks []catalog.BlockInfo)
UnfoldBlkInfoFromObjStats constructs a block info list from the given object stats. this unfolds all block info at one operation, if an object contains a great many of blocks, this operation is memory sensitive, we recommend another way, StatsBlkIter or ForEach.
func UpdateStats ¶ added in v1.0.0
func UpdateStats(ctx context.Context, tbl *txnTable, s *plan2.StatsInfoMap, approxNumObjects int) bool
calculate and update the stats for scan node.
func UpdateStatsForPartitionTable ¶ added in v1.0.0
func UpdateStatsForPartitionTable(ctx context.Context, baseTable *txnTable, partitionTables []any, s *plan2.StatsInfoMap, approxNumObjects int) bool
calculate and update the stats for scan node.
Types ¶
type Engine ¶
func New ¶
func New( ctx context.Context, mp *mpool.MPool, fs fileservice.FileService, cli client.TxnClient, hakeeper logservice.CNHAKeeperClient, ) *Engine
func (*Engine) AllocateIDByKey ¶ added in v0.8.0
func (*Engine) GetNameById ¶ added in v0.7.0
func (*Engine) GetRelationById ¶ added in v0.7.0
func (*Engine) InitLogTailPushModel ¶ added in v0.8.0
func (*Engine) NewBlockReader ¶
func (*Engine) UpdateOfPull ¶ added in v0.8.0
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents a delete/insert
type IDGenerator ¶
type PartitionReader ¶
type PartitionReader struct {
// contains filtered or unexported fields
}
func (*PartitionReader) Close ¶
func (p *PartitionReader) Close() error
type StatsBlkIter ¶ added in v1.1.0
type StatsBlkIter struct {
// contains filtered or unexported fields
}
func NewStatsBlkIter ¶ added in v1.1.0
func NewStatsBlkIter(stats *objectio.ObjectStats, meta objectio.ObjectDataMeta) *StatsBlkIter
func (*StatsBlkIter) Entry ¶ added in v1.1.0
func (i *StatsBlkIter) Entry() *catalog.BlockInfo
func (*StatsBlkIter) Next ¶ added in v1.1.0
func (i *StatsBlkIter) Next() bool
type Transaction ¶
Transaction represents a transaction
func (*Transaction) Adjust ¶ added in v1.0.0
func (txn *Transaction) Adjust() error
Adjust adjust writes order
func (*Transaction) Commit ¶ added in v0.8.0
func (txn *Transaction) Commit(ctx context.Context) ([]txn.TxnRequest, error)
func (*Transaction) EndStatement ¶ added in v1.0.0
func (txn *Transaction) EndStatement()
func (*Transaction) GetSQLCount ¶ added in v1.0.0
func (txn *Transaction) GetSQLCount() uint64
func (*Transaction) IncrSQLCount ¶ added in v1.0.0
func (txn *Transaction) IncrSQLCount()
func (*Transaction) IncrStatementID ¶ added in v0.8.0
func (txn *Transaction) IncrStatementID(ctx context.Context, commit bool) error
func (*Transaction) PutCnBlockDeletes ¶ added in v0.8.0
func (txn *Transaction) PutCnBlockDeletes(blockId *types.Blockid, offsets []int64)
func (*Transaction) ReadOnly ¶
func (txn *Transaction) ReadOnly() bool
detecting whether a transaction is a read-only transaction
func (*Transaction) Rollback ¶ added in v0.8.0
func (txn *Transaction) Rollback(ctx context.Context) error
func (*Transaction) RollbackLastStatement ¶ added in v0.8.0
func (txn *Transaction) RollbackLastStatement(ctx context.Context) error
func (*Transaction) StartStatement ¶ added in v1.0.0
func (txn *Transaction) StartStatement()
func (*Transaction) WriteBatch ¶
func (txn *Transaction) WriteBatch( typ int, databaseId uint64, tableId uint64, databaseName string, tableName string, bat *batch.Batch, tnStore DNStore, primaryIdx int, insertBatchHasRowId bool, truncate bool) error
WriteBatch used to write data to the transaction buffer insert/delete/update all use this api insertBatchHasRowId : it denotes the batch has Rowid when the typ is INSERT. if typ is not INSERT, it is always false. truncate : it denotes the batch with typ DELETE on mo_tables is generated when Truncating a table.
func (*Transaction) WriteFile ¶
func (txn *Transaction) WriteFile( typ int, databaseId, tableId uint64, databaseName, tableName string, fileName string, bat *batch.Batch, tnStore DNStore) error
WriteFile used to add a s3 file information to the transaction buffer insert/delete/update all use this api