engine

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Policy_CollectCommittedInmemData = 1 << iota
	Policy_CollectUncommittedInmemData
	Policy_CollectCommittedPersistedData
	Policy_CollectUncommittedPersistedData
	Policy_CollectCommittedData   = Policy_CollectCommittedInmemData | Policy_CollectCommittedPersistedData
	Policy_CollectUncommittedData = Policy_CollectUncommittedInmemData | Policy_CollectUncommittedPersistedData
	Policy_CollectAllData         = Policy_CollectCommittedData | Policy_CollectUncommittedData
)
View Source
const (
	Policy_CollectUncommittedTombstones = 1 << iota
	Policy_CollectCommittedTombstones
	Policy_CollectAllTombstones = Policy_CollectUncommittedTombstones | Policy_CollectCommittedTombstones
)
View Source
const (
	Policy_SkipUncommitedInMemory = 1 << iota
	Policy_SkipCommittedInMemory
	Policy_SkipUncommitedS3
	Policy_SkipCommittedS3
)

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var PlanDefsToExeDefs = func(tableDef *plan.TableDef) ([]TableDef, *api.SchemaExtra, error) {
	planDefs := tableDef.GetDefs()
	var exeDefs []TableDef
	var propDef *PropertiesDef
	for _, def := range planDefs {
		switch defVal := def.GetDef().(type) {
		case *plan.TableDef_DefType_Properties:
			properties := make([]Property, len(defVal.Properties.GetProperties()))
			for i, p := range defVal.Properties.GetProperties() {
				properties[i] = Property{
					Key:   p.GetKey(),
					Value: p.GetValue(),
				}
			}
			propDef = &PropertiesDef{Properties: properties}
			exeDefs = append(exeDefs, propDef)
		}
	}

	if propDef == nil {
		propDef = &PropertiesDef{Properties: make([]Property, 0)}
		exeDefs = append(exeDefs, propDef)
	}
	extra := &api.SchemaExtra{
		FeatureFlag: tableDef.FeatureFlag,
	}
	propDef.Properties = append(
		propDef.Properties,
		Property{
			Key: "schema_extra",
			ValueFactory: func() string {
				return string(api.MustMarshalTblExtra(extra))
			},
		},
	)

	if tableDef.ViewSql != nil {
		exeDefs = append(exeDefs, &ViewDef{
			View: tableDef.ViewSql.View,
		})
	}

	if tableDef.Partition != nil {
		bytes, err := tableDef.Partition.Marshal()
		if err != nil {
			return nil, nil, err
		}
		exeDefs = append(exeDefs, &PartitionDef{
			Partitioned: 1,
			Partition:   string(bytes),
		})
	}

	c := PlanDefToCstrDef(tableDef)
	if len(c.Cts) > 0 {
		exeDefs = append(exeDefs, c)
	}

	if tableDef.ClusterBy != nil {
		exeDefs = append(exeDefs, &ClusterByDef{
			Name: tableDef.ClusterBy.Name,
		})
	}

	return exeDefs, extra, nil
}

Functions

func CollectChangesDebugLabelFromContext

func CollectChangesDebugLabelFromContext(ctx context.Context) string

CollectChangesDebugLabelFromContext returns the debug label attached by WithCollectChangesDebugLabel, or the empty string when none was set.

func ForRangeBlockInfo

func ForRangeBlockInfo(
	begin, end int,
	relData RelData,
	onBlock func(blk *objectio.BlockInfo) (bool, error)) error

ForRangeBlockInfo [begin, end)

func ForRangeShardID

func ForRangeShardID(
	begin, end int,
	relData RelData,
	onShardID func(shardID uint64) (bool, error)) error

ForRangeShardID [begin, end)

func GetForceBuildRemoteDS

func GetForceBuildRemoteDS() (bool, []uint64)

func GetForceShuffleReader

func GetForceShuffleReader() (bool, []uint64, int)

func GetPrefetchOnSubscribed

func GetPrefetchOnSubscribed() (bool, []*regexp.Regexp)

func RetainRowIDFromContext

func RetainRowIDFromContext(ctx context.Context) bool

RetainRowIDFromContext reports whether the caller requested rowid retention. The default remains false so existing callers are unchanged.

func SetForceBuildRemoteDS

func SetForceBuildRemoteDS(force bool, tbls []string)

func SetForceShuffleReader

func SetForceShuffleReader(force bool, tbls []string, blkCnt int)

func SetPrefetchOnSubscribed

func SetPrefetchOnSubscribed(patterns []string) error

func WithCollectChangesDebugLabel

func WithCollectChangesDebugLabel(ctx context.Context, label string) context.Context

WithCollectChangesDebugLabel attaches a narrow debug label to the context. CollectChanges paths can use this to emit focused diagnostics without turning on high-volume logs for unrelated callers.

func WithPKFilter

func WithPKFilter(ctx context.Context, filter *PKFilter) context.Context

WithPKFilter attaches a PK filter to the context so that CollectChanges can apply object/block pruning via ZoneMap segments. Passing nil or a filter with no segments is a no-op and returns the original context.

func WithRetainRowID

func WithRetainRowID(ctx context.Context, retain bool) context.Context

WithRetainRowID requests that CollectChanges keep rowid in its internal batch shape for callers that need row-level provenance. Callers that don't opt in keep the existing output contract.

func WithSnapshotReadPolicy

func WithSnapshotReadPolicy(ctx context.Context, policy SnapshotReadPolicy) context.Context

WithSnapshotReadPolicy attaches a snapshot-read policy to the context so callers can opt into a different recovery semantic without widening the engine.Relation interface. The default policy is intentionally omitted from the context to keep existing callers unchanged.

Types

type Attribute

type Attribute struct {
	// IsHide whether the attribute is hidden or not
	IsHidden bool
	// IsRowId whether the attribute is rowid or not
	IsRowId bool
	// Column ID
	ID uint64
	// Name name of attribute, letter case: origin
	Name string
	// Alg compression algorithm
	Alg compress.T
	// Type attribute's type
	Type types.Type
	// DefaultExpr default value of this attribute
	Default *plan.Default
	// to update col when define in create table
	OnUpdate *plan.OnUpdate
	// Primary is primary key or not
	Primary bool
	// Clusterby means sort by this column
	ClusterBy bool
	// Comment of attribute
	Comment string
	// AutoIncrement is auto incr or not
	AutoIncrement bool
	// Seqnum, do not change during the whole lifetime of the table
	Seqnum uint16
	// EnumValues is for enum type
	EnumVlaues string
	// GeneratedCol is for generated (computed) columns
	GeneratedCol *plan.GeneratedCol
}

Attribute is a column

func (*Attribute) Descriptor added in v0.8.0

func (*Attribute) Descriptor() ([]byte, []int)

func (*Attribute) Format

func (def *Attribute) Format(buf *bytes.Buffer)

func (*Attribute) GetAlg added in v0.8.0

func (*Attribute) GetAutoIncrement added in v0.8.0

func (m *Attribute) GetAutoIncrement() bool

func (*Attribute) GetClusterBy added in v0.8.0

func (m *Attribute) GetClusterBy() bool

func (*Attribute) GetComment added in v0.8.0

func (m *Attribute) GetComment() string

func (*Attribute) GetDefault added in v0.8.0

func (m *Attribute) GetDefault() *plan.Default

func (*Attribute) GetID added in v0.8.0

func (m *Attribute) GetID() uint64

func (*Attribute) GetIsHidden added in v0.8.0

func (m *Attribute) GetIsHidden() bool

func (*Attribute) GetIsRowId added in v0.8.0

func (m *Attribute) GetIsRowId() bool

func (*Attribute) GetName added in v0.8.0

func (m *Attribute) GetName() string

func (*Attribute) GetOnUpdate added in v0.8.0

func (m *Attribute) GetOnUpdate() *plan.OnUpdate

func (*Attribute) GetPrimary added in v0.8.0

func (m *Attribute) GetPrimary() bool

func (*Attribute) Marshal added in v0.8.0

func (m *Attribute) Marshal() (dAtA []byte, err error)

func (*Attribute) MarshalTo added in v0.8.0

func (m *Attribute) MarshalTo(dAtA []byte) (int, error)

func (*Attribute) MarshalToSizedBuffer added in v0.8.0

func (m *Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Attribute) ProtoMessage added in v0.8.0

func (*Attribute) ProtoMessage()

func (*Attribute) ProtoSize added in v0.8.0

func (m *Attribute) ProtoSize() (n int)

func (*Attribute) Reset added in v0.8.0

func (m *Attribute) Reset()

func (*Attribute) String added in v0.8.0

func (m *Attribute) String() string

func (*Attribute) Unmarshal added in v0.8.0

func (m *Attribute) Unmarshal(dAtA []byte) error

func (*Attribute) XXX_DiscardUnknown added in v0.8.0

func (m *Attribute) XXX_DiscardUnknown()

func (*Attribute) XXX_Marshal added in v0.8.0

func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Attribute) XXX_Merge added in v0.8.0

func (m *Attribute) XXX_Merge(src proto.Message)

func (*Attribute) XXX_Size added in v0.8.0

func (m *Attribute) XXX_Size() int

func (*Attribute) XXX_Unmarshal added in v0.8.0

func (m *Attribute) XXX_Unmarshal(b []byte) error

type AttributeDef

type AttributeDef struct {
	Attr Attribute
}

func (*AttributeDef) Descriptor added in v0.8.0

func (*AttributeDef) Descriptor() ([]byte, []int)

func (*AttributeDef) Format

func (def *AttributeDef) Format(buf *bytes.Buffer)

func (*AttributeDef) GetAttr added in v0.8.0

func (m *AttributeDef) GetAttr() Attribute

func (*AttributeDef) Marshal added in v0.8.0

func (m *AttributeDef) Marshal() (dAtA []byte, err error)

func (*AttributeDef) MarshalTo added in v0.8.0

func (m *AttributeDef) MarshalTo(dAtA []byte) (int, error)

func (*AttributeDef) MarshalToSizedBuffer added in v0.8.0

func (m *AttributeDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AttributeDef) ProtoMessage added in v0.8.0

func (*AttributeDef) ProtoMessage()

func (*AttributeDef) ProtoSize added in v0.8.0

func (m *AttributeDef) ProtoSize() (n int)

func (*AttributeDef) Reset added in v0.8.0

func (m *AttributeDef) Reset()

func (*AttributeDef) String added in v0.8.0

func (m *AttributeDef) String() string

func (*AttributeDef) ToPBVersion added in v0.8.0

func (def *AttributeDef) ToPBVersion() TableDefPB

func (*AttributeDef) Unmarshal added in v0.8.0

func (m *AttributeDef) Unmarshal(dAtA []byte) error

func (*AttributeDef) XXX_DiscardUnknown added in v0.8.0

func (m *AttributeDef) XXX_DiscardUnknown()

func (*AttributeDef) XXX_Marshal added in v0.8.0

func (m *AttributeDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AttributeDef) XXX_Merge added in v0.8.0

func (m *AttributeDef) XXX_Merge(src proto.Message)

func (*AttributeDef) XXX_Size added in v0.8.0

func (m *AttributeDef) XXX_Size() int

func (*AttributeDef) XXX_Unmarshal added in v0.8.0

func (m *AttributeDef) XXX_Unmarshal(b []byte) error

type BaseReader

type BaseReader interface {
	Close() error
	Read(context.Context, []string, *plan.Expr, *mpool.MPool, *batch.Batch) (bool, error)
}

type CatalogCacheGCer

type CatalogCacheGCer interface {
	GCCatalogCache(ctx context.Context, ago time.Duration) error
}

CatalogCacheGCer is an optional interface for engines that support on-demand GC of the in-memory catalog cache.

type ChangesHandle

type ChangesHandle interface {
	Next(ctx context.Context, mp *mpool.MPool) (data *batch.Batch, tombstone *batch.Batch, hint ChangesHandle_Hint, err error)
	Close() error
}

type ChangesHandle_Hint

type ChangesHandle_Hint int
const (
	ChangesHandle_Snapshot ChangesHandle_Hint = iota
	ChangesHandle_Tail_wip
	ChangesHandle_Tail_done
)

type ClusterByDef added in v0.7.0

type ClusterByDef struct {
	Name string
}

func (*ClusterByDef) Descriptor added in v0.8.0

func (*ClusterByDef) Descriptor() ([]byte, []int)

func (*ClusterByDef) GetName added in v0.8.0

func (m *ClusterByDef) GetName() string

func (*ClusterByDef) Marshal added in v0.8.0

func (m *ClusterByDef) Marshal() (dAtA []byte, err error)

func (*ClusterByDef) MarshalTo added in v0.8.0

func (m *ClusterByDef) MarshalTo(dAtA []byte) (int, error)

func (*ClusterByDef) MarshalToSizedBuffer added in v0.8.0

func (m *ClusterByDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterByDef) ProtoMessage added in v0.8.0

func (*ClusterByDef) ProtoMessage()

func (*ClusterByDef) ProtoSize added in v0.8.0

func (m *ClusterByDef) ProtoSize() (n int)

func (*ClusterByDef) Reset added in v0.8.0

func (m *ClusterByDef) Reset()

func (*ClusterByDef) String added in v0.8.0

func (m *ClusterByDef) String() string

func (*ClusterByDef) ToPBVersion added in v0.8.0

func (def *ClusterByDef) ToPBVersion() TableDefPB

func (*ClusterByDef) Unmarshal added in v0.8.0

func (m *ClusterByDef) Unmarshal(dAtA []byte) error

func (*ClusterByDef) XXX_DiscardUnknown added in v0.8.0

func (m *ClusterByDef) XXX_DiscardUnknown()

func (*ClusterByDef) XXX_Marshal added in v0.8.0

func (m *ClusterByDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterByDef) XXX_Merge added in v0.8.0

func (m *ClusterByDef) XXX_Merge(src proto.Message)

func (*ClusterByDef) XXX_Size added in v0.8.0

func (m *ClusterByDef) XXX_Size() int

func (*ClusterByDef) XXX_Unmarshal added in v0.8.0

func (m *ClusterByDef) XXX_Unmarshal(b []byte) error

type CommentDef

type CommentDef struct {
	Comment string
}

func (*CommentDef) Descriptor added in v0.8.0

func (*CommentDef) Descriptor() ([]byte, []int)

func (*CommentDef) GetComment added in v0.8.0

func (m *CommentDef) GetComment() string

func (*CommentDef) Marshal added in v0.8.0

func (m *CommentDef) Marshal() (dAtA []byte, err error)

func (*CommentDef) MarshalTo added in v0.8.0

func (m *CommentDef) MarshalTo(dAtA []byte) (int, error)

func (*CommentDef) MarshalToSizedBuffer added in v0.8.0

func (m *CommentDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CommentDef) ProtoMessage added in v0.8.0

func (*CommentDef) ProtoMessage()

func (*CommentDef) ProtoSize added in v0.8.0

func (m *CommentDef) ProtoSize() (n int)

func (*CommentDef) Reset added in v0.8.0

func (m *CommentDef) Reset()

func (*CommentDef) String added in v0.8.0

func (m *CommentDef) String() string

func (*CommentDef) ToPBVersion added in v0.8.0

func (def *CommentDef) ToPBVersion() TableDefPB

func (*CommentDef) Unmarshal added in v0.8.0

func (m *CommentDef) Unmarshal(dAtA []byte) error

func (*CommentDef) XXX_DiscardUnknown added in v0.8.0

func (m *CommentDef) XXX_DiscardUnknown()

func (*CommentDef) XXX_Marshal added in v0.8.0

func (m *CommentDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CommentDef) XXX_Merge added in v0.8.0

func (m *CommentDef) XXX_Merge(src proto.Message)

func (*CommentDef) XXX_Size added in v0.8.0

func (m *CommentDef) XXX_Size() int

func (*CommentDef) XXX_Unmarshal added in v0.8.0

func (m *CommentDef) XXX_Unmarshal(b []byte) error

type Constraint added in v0.7.0

type Constraint interface {

	// ToPBVersion returns corresponding PB struct.
	ToPBVersion() ConstraintPB
	// contains filtered or unexported methods
}

type ConstraintDef added in v0.7.0

type ConstraintDef struct {
	Cts []Constraint
}

func PlanDefToCstrDef

func PlanDefToCstrDef(tableDef *plan.TableDef) *ConstraintDef

func (*ConstraintDef) GetPrimaryKeyDef added in v0.7.0

func (def *ConstraintDef) GetPrimaryKeyDef() *PrimaryKeyDef

get the primary key definition in the constraint, and return null if there is no primary key

func (*ConstraintDef) MarshalBinary added in v0.7.0

func (def *ConstraintDef) MarshalBinary() (data []byte, err error)

func (*ConstraintDef) ToPBVersion added in v0.8.0

func (def *ConstraintDef) ToPBVersion() TableDefPB

func (*ConstraintDef) UnmarshalBinary added in v0.7.0

func (def *ConstraintDef) UnmarshalBinary(data []byte) error

type ConstraintDefPB added in v0.8.0

type ConstraintDefPB struct {
	Cts []ConstraintPB `protobuf:"bytes,1,rep,name=Cts,proto3" json:"Cts"`
}

PB version of ConstraintDef

func (*ConstraintDefPB) Descriptor added in v0.8.0

func (*ConstraintDefPB) Descriptor() ([]byte, []int)

func (*ConstraintDefPB) FromPBVersion added in v0.8.0

func (def *ConstraintDefPB) FromPBVersion() *ConstraintDef

func (*ConstraintDefPB) GetCts added in v0.8.0

func (m *ConstraintDefPB) GetCts() []ConstraintPB

func (*ConstraintDefPB) Marshal added in v0.8.0

func (m *ConstraintDefPB) Marshal() (dAtA []byte, err error)

func (*ConstraintDefPB) MarshalTo added in v0.8.0

func (m *ConstraintDefPB) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintDefPB) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintDefPB) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintDefPB) ProtoMessage added in v0.8.0

func (*ConstraintDefPB) ProtoMessage()

func (*ConstraintDefPB) ProtoSize added in v0.8.0

func (m *ConstraintDefPB) ProtoSize() (n int)

func (*ConstraintDefPB) Reset added in v0.8.0

func (m *ConstraintDefPB) Reset()

func (*ConstraintDefPB) String added in v0.8.0

func (m *ConstraintDefPB) String() string

func (*ConstraintDefPB) Unmarshal added in v0.8.0

func (m *ConstraintDefPB) Unmarshal(dAtA []byte) error

func (*ConstraintDefPB) XXX_DiscardUnknown added in v0.8.0

func (m *ConstraintDefPB) XXX_DiscardUnknown()

func (*ConstraintDefPB) XXX_Marshal added in v0.8.0

func (m *ConstraintDefPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConstraintDefPB) XXX_Merge added in v0.8.0

func (m *ConstraintDefPB) XXX_Merge(src proto.Message)

func (*ConstraintDefPB) XXX_Size added in v0.8.0

func (m *ConstraintDefPB) XXX_Size() int

func (*ConstraintDefPB) XXX_Unmarshal added in v0.8.0

func (m *ConstraintDefPB) XXX_Unmarshal(b []byte) error

type ConstraintPB added in v0.8.0

type ConstraintPB struct {
	// Types that are valid to be assigned to Ct:
	//	*ConstraintPB_ForeignKeyDef
	//	*ConstraintPB_PrimaryKeyDef
	//	*ConstraintPB_RefChildTableDef
	//	*ConstraintPB_IndexDef
	//	*ConstraintPB_StreamConfigsDef
	Ct isConstraintPB_Ct `protobuf_oneof:"ct"`
}

PB version of Constraint

func (*ConstraintPB) Descriptor added in v0.8.0

func (*ConstraintPB) Descriptor() ([]byte, []int)

func (*ConstraintPB) FromPBVersion added in v0.8.0

func (def *ConstraintPB) FromPBVersion() Constraint

func (*ConstraintPB) GetCt added in v0.8.0

func (m *ConstraintPB) GetCt() isConstraintPB_Ct

func (*ConstraintPB) GetForeignKeyDef added in v0.8.0

func (m *ConstraintPB) GetForeignKeyDef() *ForeignKeyDef

func (*ConstraintPB) GetIndexDef added in v0.8.0

func (m *ConstraintPB) GetIndexDef() *IndexDef

func (*ConstraintPB) GetPrimaryKeyDef added in v0.8.0

func (m *ConstraintPB) GetPrimaryKeyDef() *PrimaryKeyDef

func (*ConstraintPB) GetRefChildTableDef added in v0.8.0

func (m *ConstraintPB) GetRefChildTableDef() *RefChildTableDef

func (*ConstraintPB) GetStreamConfigsDef added in v1.0.0

func (m *ConstraintPB) GetStreamConfigsDef() *StreamConfigsDef

func (*ConstraintPB) Marshal added in v0.8.0

func (m *ConstraintPB) Marshal() (dAtA []byte, err error)

func (*ConstraintPB) MarshalTo added in v0.8.0

func (m *ConstraintPB) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintPB) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB) ProtoMessage added in v0.8.0

func (*ConstraintPB) ProtoMessage()

func (*ConstraintPB) ProtoSize added in v0.8.0

func (m *ConstraintPB) ProtoSize() (n int)

func (*ConstraintPB) Reset added in v0.8.0

func (m *ConstraintPB) Reset()

func (*ConstraintPB) String added in v0.8.0

func (m *ConstraintPB) String() string

func (*ConstraintPB) Unmarshal added in v0.8.0

func (m *ConstraintPB) Unmarshal(dAtA []byte) error

func (*ConstraintPB) XXX_DiscardUnknown added in v0.8.0

func (m *ConstraintPB) XXX_DiscardUnknown()

func (*ConstraintPB) XXX_Marshal added in v0.8.0

func (m *ConstraintPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConstraintPB) XXX_Merge added in v0.8.0

func (m *ConstraintPB) XXX_Merge(src proto.Message)

func (*ConstraintPB) XXX_OneofWrappers added in v0.8.0

func (*ConstraintPB) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ConstraintPB) XXX_Size added in v0.8.0

func (m *ConstraintPB) XXX_Size() int

func (*ConstraintPB) XXX_Unmarshal added in v0.8.0

func (m *ConstraintPB) XXX_Unmarshal(b []byte) error

type ConstraintPB_ForeignKeyDef added in v0.8.0

type ConstraintPB_ForeignKeyDef struct {
	ForeignKeyDef *ForeignKeyDef `protobuf:"bytes,1,opt,name=ForeignKeyDef,proto3,oneof" json:"ForeignKeyDef,omitempty"`
}

func (*ConstraintPB_ForeignKeyDef) MarshalTo added in v0.8.0

func (m *ConstraintPB_ForeignKeyDef) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB_ForeignKeyDef) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintPB_ForeignKeyDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB_ForeignKeyDef) ProtoSize added in v0.8.0

func (m *ConstraintPB_ForeignKeyDef) ProtoSize() (n int)

type ConstraintPB_IndexDef added in v0.8.0

type ConstraintPB_IndexDef struct {
	IndexDef *IndexDef `protobuf:"bytes,4,opt,name=IndexDef,proto3,oneof" json:"IndexDef,omitempty"`
}

func (*ConstraintPB_IndexDef) MarshalTo added in v0.8.0

func (m *ConstraintPB_IndexDef) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB_IndexDef) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintPB_IndexDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB_IndexDef) ProtoSize added in v0.8.0

func (m *ConstraintPB_IndexDef) ProtoSize() (n int)

type ConstraintPB_PrimaryKeyDef added in v0.8.0

type ConstraintPB_PrimaryKeyDef struct {
	PrimaryKeyDef *PrimaryKeyDef `protobuf:"bytes,2,opt,name=PrimaryKeyDef,proto3,oneof" json:"PrimaryKeyDef,omitempty"`
}

func (*ConstraintPB_PrimaryKeyDef) MarshalTo added in v0.8.0

func (m *ConstraintPB_PrimaryKeyDef) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB_PrimaryKeyDef) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintPB_PrimaryKeyDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB_PrimaryKeyDef) ProtoSize added in v0.8.0

func (m *ConstraintPB_PrimaryKeyDef) ProtoSize() (n int)

type ConstraintPB_RefChildTableDef added in v0.8.0

type ConstraintPB_RefChildTableDef struct {
	RefChildTableDef *RefChildTableDef `protobuf:"bytes,3,opt,name=RefChildTableDef,proto3,oneof" json:"RefChildTableDef,omitempty"`
}

func (*ConstraintPB_RefChildTableDef) MarshalTo added in v0.8.0

func (m *ConstraintPB_RefChildTableDef) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB_RefChildTableDef) MarshalToSizedBuffer added in v0.8.0

func (m *ConstraintPB_RefChildTableDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB_RefChildTableDef) ProtoSize added in v0.8.0

func (m *ConstraintPB_RefChildTableDef) ProtoSize() (n int)

type ConstraintPB_StreamConfigsDef added in v1.0.0

type ConstraintPB_StreamConfigsDef struct {
	StreamConfigsDef *StreamConfigsDef `protobuf:"bytes,5,opt,name=StreamConfigsDef,proto3,oneof" json:"StreamConfigsDef,omitempty"`
}

func (*ConstraintPB_StreamConfigsDef) MarshalTo added in v1.0.0

func (m *ConstraintPB_StreamConfigsDef) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintPB_StreamConfigsDef) MarshalToSizedBuffer added in v1.0.0

func (m *ConstraintPB_StreamConfigsDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConstraintPB_StreamConfigsDef) ProtoSize added in v1.0.0

func (m *ConstraintPB_StreamConfigsDef) ProtoSize() (n int)

type ConstraintType added in v0.7.0

type ConstraintType int8
const (
	Index ConstraintType = iota
	RefChildTable
	ForeignKey
	PrimaryKey
	StreamConfig
)

type DataCollectPolicy

type DataCollectPolicy uint64

type DataSource

type DataSource interface {
	Next(
		ctx context.Context,
		cols []string,
		types []types.Type,
		seqNums []uint16,
		pkSeqNum int32,
		memFilter any,
		mp *mpool.MPool,
		bat *batch.Batch,
	) (*objectio.BlockInfo, DataState, error)

	ApplyTombstones(
		ctx context.Context,
		bid *objectio.Blockid,
		rowsOffset []int64,
		applyPolicy TombstoneApplyPolicy,
	) ([]int64, error)

	GetTombstones(
		ctx context.Context, bid *objectio.Blockid,
	) (deletedRows objectio.Bitmap, err error)

	SetOrderBy(orderby []*plan.OrderBySpec)
	GetOrderBy() []*plan.OrderBySpec

	SetFilterZM(zm objectio.ZoneMap)

	Close()
	String() string
}

type DataSourceType

type DataSourceType uint8
const (
	GeneralLocalDataSource DataSourceType = iota
	ShardingLocalDataSource
	ShardingRemoteDataSource
)

type DataState

type DataState uint8
const (
	InMem DataState = iota
	Persisted
	End
)

type Database

type Database interface {
	Relations(context.Context) ([]string, error)
	Relation(context.Context, string, any) (Relation, error)
	RelationExists(context.Context, string, any) (bool, error)

	Delete(context.Context, string) error
	Create(context.Context, string, []TableDef) error // Create Table - (name, table define)
	GetDatabaseId(context.Context) string
	IsSubscription(context.Context) bool
	GetCreateSql(context.Context) string
}

type Engine

type Engine interface {
	// LogtailEngine has some actions for logtail.
	LogtailEngine

	// transaction interface
	New(ctx context.Context, op client.TxnOperator) error

	// Delete deletes a database
	Delete(ctx context.Context, databaseName string, op client.TxnOperator) error

	// Create creates a database
	Create(ctx context.Context, databaseName string, op client.TxnOperator) error

	// Databases returns all database names
	Databases(ctx context.Context, op client.TxnOperator) (databaseNames []string, err error)

	// Database creates a handle for a database
	Database(ctx context.Context, databaseName string, op client.TxnOperator) (Database, error)

	// Nodes returns all nodes for worker jobs. isInternal, tenant, cnLabel are
	// used to filter CN servers.
	Nodes(isInternal bool, tenant string, username string, cnLabel map[string]string) (cnNodes Nodes, err error)

	// Hints returns hints of engine features
	// return value should not be cached
	// since implementations may update hints after engine had initialized
	Hints() Hints

	BuildBlockReaders(
		ctx context.Context,
		proc any,
		ts timestamp.Timestamp,
		expr *plan.Expr,
		def *plan.TableDef,
		relData RelData,
		num int) ([]Reader, error)

	// Get database name & table name by table id
	GetNameById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName string, tblName string, err error)

	// Get relation by table id
	GetRelationById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName string, tblName string, rel Relation, err error)

	// AllocateIDByKey allocate a globally unique ID by key.
	AllocateIDByKey(ctx context.Context, key string) (uint64, error)

	// Stats returns the stats info of the key.
	// If sync is true, wait for the stats info to be updated, else,
	// just return nil if the current stats info has not been initialized.
	Stats(ctx context.Context, key pb.StatsInfoKey, sync bool) *pb.StatsInfo

	// true if the prefetch is received, false if the prefetch is rejected
	PrefetchTableMeta(ctx context.Context, key pb.StatsInfoKey) bool

	GetMessageCenter() any

	GetService() string

	LatestLogtailAppliedTime() timestamp.Timestamp
}

type EngineType added in v0.8.0

type EngineType int8
const (
	Disttae EngineType = iota
	Memory
	UNKNOWN
)

type EntireEngine added in v0.7.0

type EntireEngine struct {
	Engine Engine // original engine
}

EntireEngine is a wrapper for Engine to support temporary table

func (*EntireEngine) AllocateIDByKey added in v0.8.0

func (e *EntireEngine) AllocateIDByKey(ctx context.Context, key string) (uint64, error)

func (*EntireEngine) BuildBlockReaders

func (e *EntireEngine) BuildBlockReaders(
	ctx context.Context,
	proc any,
	ts timestamp.Timestamp,
	expr *plan.Expr,
	def *plan.TableDef,
	relData RelData,
	num int) ([]Reader, error)

func (*EntireEngine) Create added in v0.7.0

func (e *EntireEngine) Create(ctx context.Context, databaseName string, op client.TxnOperator) error

func (*EntireEngine) Database added in v0.7.0

func (e *EntireEngine) Database(ctx context.Context, databaseName string, op client.TxnOperator) (Database, error)

func (*EntireEngine) Databases added in v0.7.0

func (e *EntireEngine) Databases(ctx context.Context, op client.TxnOperator) (databaseNames []string, err error)

func (*EntireEngine) Delete added in v0.7.0

func (e *EntireEngine) Delete(ctx context.Context, databaseName string, op client.TxnOperator) error

func (*EntireEngine) GetMessageCenter

func (e *EntireEngine) GetMessageCenter() any

func (*EntireEngine) GetNameById added in v0.7.0

func (e *EntireEngine) GetNameById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName string, tblName string, err error)

func (*EntireEngine) GetRelationById added in v0.7.0

func (e *EntireEngine) GetRelationById(ctx context.Context, op client.TxnOperator, tableId uint64) (dbName string, tblName string, rel Relation, err error)

func (*EntireEngine) GetService

func (e *EntireEngine) GetService() string

func (*EntireEngine) Hints added in v0.7.0

func (e *EntireEngine) Hints() Hints

func (*EntireEngine) LatestLogtailAppliedTime

func (e *EntireEngine) LatestLogtailAppliedTime() timestamp.Timestamp

func (*EntireEngine) New added in v0.7.0

func (*EntireEngine) Nodes added in v0.7.0

func (e *EntireEngine) Nodes(
	isInternal bool, tenant string, username string, cnLabel map[string]string) (cnNodes Nodes, err error,
)

func (*EntireEngine) PrefetchTableMeta

func (e *EntireEngine) PrefetchTableMeta(ctx context.Context, key pb.StatsInfoKey) bool

func (*EntireEngine) Stats added in v1.2.0

func (e *EntireEngine) Stats(ctx context.Context, key pb.StatsInfoKey, sync bool) *pb.StatsInfo

func (*EntireEngine) TryToSubscribeTable added in v1.2.0

func (e *EntireEngine) TryToSubscribeTable(ctx context.Context, accId, dbID, tbID uint64, dbName, tblName string) error

func (*EntireEngine) UnsubscribeTable added in v1.2.0

func (e *EntireEngine) UnsubscribeTable(ctx context.Context, accId, dbID, tbID uint64) error

type FilterHint

type FilterHint struct {
	Must                  bool
	MembershipFilterBytes []byte
	BF                    MembershipFilter
}

type ForeignKeyDef added in v0.7.0

type ForeignKeyDef struct {
	Fkeys []*plan.ForeignKeyDef
}

func (*ForeignKeyDef) Descriptor added in v0.8.0

func (*ForeignKeyDef) Descriptor() ([]byte, []int)

func (*ForeignKeyDef) GetFkeys added in v0.8.0

func (m *ForeignKeyDef) GetFkeys() []*plan.ForeignKeyDef

func (*ForeignKeyDef) Marshal added in v0.8.0

func (m *ForeignKeyDef) Marshal() (dAtA []byte, err error)

func (*ForeignKeyDef) MarshalTo added in v0.8.0

func (m *ForeignKeyDef) MarshalTo(dAtA []byte) (int, error)

func (*ForeignKeyDef) MarshalToSizedBuffer added in v0.8.0

func (m *ForeignKeyDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ForeignKeyDef) ProtoMessage added in v0.8.0

func (*ForeignKeyDef) ProtoMessage()

func (*ForeignKeyDef) ProtoSize added in v0.8.0

func (m *ForeignKeyDef) ProtoSize() (n int)

func (*ForeignKeyDef) Reset added in v0.8.0

func (m *ForeignKeyDef) Reset()

func (*ForeignKeyDef) String added in v0.8.0

func (m *ForeignKeyDef) String() string

func (*ForeignKeyDef) ToPBVersion added in v0.8.0

func (def *ForeignKeyDef) ToPBVersion() ConstraintPB

func (*ForeignKeyDef) Unmarshal added in v0.8.0

func (m *ForeignKeyDef) Unmarshal(dAtA []byte) error

func (*ForeignKeyDef) XXX_DiscardUnknown added in v0.8.0

func (m *ForeignKeyDef) XXX_DiscardUnknown()

func (*ForeignKeyDef) XXX_Marshal added in v0.8.0

func (m *ForeignKeyDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ForeignKeyDef) XXX_Merge added in v0.8.0

func (m *ForeignKeyDef) XXX_Merge(src proto.Message)

func (*ForeignKeyDef) XXX_Size added in v0.8.0

func (m *ForeignKeyDef) XXX_Size() int

func (*ForeignKeyDef) XXX_Unmarshal added in v0.8.0

func (m *ForeignKeyDef) XXX_Unmarshal(b []byte) error

type Hints added in v0.6.0

type Hints struct {
	CommitOrRollbackTimeout time.Duration
}

type IndexDef added in v0.7.0

type IndexDef struct {
	Indexes []*plan.IndexDef
}

func (*IndexDef) Descriptor added in v0.8.0

func (*IndexDef) Descriptor() ([]byte, []int)

func (*IndexDef) GetIndexes added in v0.8.0

func (m *IndexDef) GetIndexes() []*plan.IndexDef

func (*IndexDef) Marshal added in v0.8.0

func (m *IndexDef) Marshal() (dAtA []byte, err error)

func (*IndexDef) MarshalTo added in v0.8.0

func (m *IndexDef) MarshalTo(dAtA []byte) (int, error)

func (*IndexDef) MarshalToSizedBuffer added in v0.8.0

func (m *IndexDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexDef) ProtoMessage added in v0.8.0

func (*IndexDef) ProtoMessage()

func (*IndexDef) ProtoSize added in v0.8.0

func (m *IndexDef) ProtoSize() (n int)

func (*IndexDef) Reset added in v0.8.0

func (m *IndexDef) Reset()

func (*IndexDef) String added in v0.8.0

func (m *IndexDef) String() string

func (*IndexDef) ToPBVersion added in v0.8.0

func (def *IndexDef) ToPBVersion() ConstraintPB

func (*IndexDef) Unmarshal added in v0.8.0

func (m *IndexDef) Unmarshal(dAtA []byte) error

func (*IndexDef) XXX_DiscardUnknown added in v0.8.0

func (m *IndexDef) XXX_DiscardUnknown()

func (*IndexDef) XXX_Marshal added in v0.8.0

func (m *IndexDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexDef) XXX_Merge added in v0.8.0

func (m *IndexDef) XXX_Merge(src proto.Message)

func (*IndexDef) XXX_Size added in v0.8.0

func (m *IndexDef) XXX_Size() int

func (*IndexDef) XXX_Unmarshal added in v0.8.0

func (m *IndexDef) XXX_Unmarshal(b []byte) error

type IndexT

type IndexT int
const (
	Empty IndexT = iota
	ZoneMap
	BsiIndex
)

func (IndexT) ToString

func (node IndexT) ToString() string

type IndexTableDef

type IndexTableDef struct {
	Typ      IndexT
	ColNames []string
	Name     string
}

func (*IndexTableDef) Descriptor added in v0.8.0

func (*IndexTableDef) Descriptor() ([]byte, []int)

func (*IndexTableDef) Format

func (def *IndexTableDef) Format(buf *bytes.Buffer)

func (*IndexTableDef) GetColNames added in v0.8.0

func (m *IndexTableDef) GetColNames() []string

func (*IndexTableDef) GetName added in v0.8.0

func (m *IndexTableDef) GetName() string

func (*IndexTableDef) GetTyp added in v0.8.0

func (m *IndexTableDef) GetTyp() IndexT

func (*IndexTableDef) Marshal added in v0.8.0

func (m *IndexTableDef) Marshal() (dAtA []byte, err error)

func (*IndexTableDef) MarshalTo added in v0.8.0

func (m *IndexTableDef) MarshalTo(dAtA []byte) (int, error)

func (*IndexTableDef) MarshalToSizedBuffer added in v0.8.0

func (m *IndexTableDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexTableDef) ProtoMessage added in v0.8.0

func (*IndexTableDef) ProtoMessage()

func (*IndexTableDef) ProtoSize added in v0.8.0

func (m *IndexTableDef) ProtoSize() (n int)

func (*IndexTableDef) Reset added in v0.8.0

func (m *IndexTableDef) Reset()

func (*IndexTableDef) String added in v0.8.0

func (m *IndexTableDef) String() string

func (*IndexTableDef) ToPBVersion added in v0.8.0

func (def *IndexTableDef) ToPBVersion() TableDefPB

func (*IndexTableDef) Unmarshal added in v0.8.0

func (m *IndexTableDef) Unmarshal(dAtA []byte) error

func (*IndexTableDef) XXX_DiscardUnknown added in v0.8.0

func (m *IndexTableDef) XXX_DiscardUnknown()

func (*IndexTableDef) XXX_Marshal added in v0.8.0

func (m *IndexTableDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexTableDef) XXX_Merge added in v0.8.0

func (m *IndexTableDef) XXX_Merge(src proto.Message)

func (*IndexTableDef) XXX_Size added in v0.8.0

func (m *IndexTableDef) XXX_Size() int

func (*IndexTableDef) XXX_Unmarshal added in v0.8.0

func (m *IndexTableDef) XXX_Unmarshal(b []byte) error

type LogtailEngine added in v1.2.0

type LogtailEngine interface {
	// TryToSubscribeTable tries to subscribe a table.
	TryToSubscribeTable(context.Context, uint64, uint64, uint64, string, string) error
	// UnsubscribeTable unsubscribes a table from logtail client.
	UnsubscribeTable(context.Context, uint64, uint64, uint64) error
}

type MembershipFilter

type MembershipFilter interface {
	// Test reports whether the raw fixed bytes of a single key may be present.
	Test(data []byte) bool
	// TestVector tests every row of a key vector, invoking cb(exist, isnull, row).
	TestVector(v *vector.Vector, cb func(bool, bool, int)) []uint8
	// Valid reports whether the filter is usable.
	Valid() bool
	// Exact reports whether membership is exact (a bitset, no false positives)
	// rather than approximate (a bloom filter). Callers can skip downstream
	// re-verification when this is true.
	Exact() bool
	// Free releases any resources held by the filter.
	Free()
}

MembershipFilter is a membership filter over the indexed primary-key values (fulltext calls this PK doc_id) used to prune an index scan to the candidate rows that pass the surrounding relational predicate. It is implemented in pkg/common/docfilter by an exact bitset (cbitmap / CRoaring) for integer PKs and by a CBloomFilter (approximate) for non-integer PKs.

This is the CONSUMER (probe) view, so it deliberately omits Share() — a plain *bloomfilter.CBloomFilter satisfies it directly. The PRODUCER superset is docfilter.MembershipFilter, which adds Share() and is assignable to this interface (enforced by a compile-time assertion in package disttae, where both packages are imported). Keep the shared method set here as the single source of truth; docfilter's interface only adds to it.

type Node

type Node struct {
	Mcpu int
	Id   string `json:"id"`
	Addr string `json:"address"`
	//TODO::change RelData to Tombstoner, since only Tombstones ned to be serialized.
	Data  RelData
	CNCNT int32 // number of all cns
	CNIDX int32 // cn index , starts from 0
}

type Nodes

type Nodes []Node

type PKFilter

type PKFilter struct {
	// Segments is a sorted, non-overlapping list of ZoneMap ranges.
	// Each element is a 64-byte ZoneMap (index.ZM encoding) stored as
	// raw []byte to avoid an import cycle between the engine and index
	// packages.
	//
	// Constructed by the streaming PK materializer during PICK key
	// ingestion.  The gap-based segmentation algorithm ensures high
	// density (few false-positive object/block matches) while keeping
	// the list compact (one ZM per cluster of nearby PKs).
	//
	// Used by logtailreplay/change_handle.go via index.AnySegmentOverlaps()
	// for object-level and block-level pruning.
	Segments [][]byte

	// PrimarySeqnum is the sequence number of the primary key column
	// in the table schema, used for block-level ZoneMap access.
	PrimarySeqnum int

	// ReplaySpec carries an optional packed-PK predicate for in-memory row replay.
	// When present, CollectChanges can use it to avoid scanning the whole
	// partition-state row tree and instead iterate only the matching PK entries.
	//
	// Unlike Segments, ReplaySpec preserves the original logical predicate
	// (`Op` + `Keys`) rather than just a coarse ZoneMap approximation.
	ReplaySpec *PKReplaySpec
}

PKFilter carries a set of ZoneMap segments that CollectChanges implementations use to prune objects and blocks whose sort-key range does not overlap with the requested PK values.

Only the DATA BRANCH PICK path attaches this to the context; CDC, ISCP and other callers leave it nil so their behavior is completely unchanged.

func PKFilterFromContext

func PKFilterFromContext(ctx context.Context) *PKFilter

PKFilterFromContext extracts the PK filter attached by WithPKFilter. Returns nil when no filter was set (the common case for CDC/ISCP).

func (*PKFilter) Valid

func (f *PKFilter) Valid() bool

type PKReplaySpec

type PKReplaySpec struct {
	Op   int
	Keys [][]byte
}

PKReplaySpec stores an optional packed primary-key predicate in a form that logtailreplay can apply directly on the in-memory primary-key index.

type PartitionDef added in v0.6.0

type PartitionDef struct {
	Partitioned int8
	Partition   string
}

func (*PartitionDef) Descriptor added in v0.8.0

func (*PartitionDef) Descriptor() ([]byte, []int)

func (*PartitionDef) GetPartition added in v0.8.0

func (m *PartitionDef) GetPartition() string

func (*PartitionDef) Marshal added in v0.8.0

func (m *PartitionDef) Marshal() (dAtA []byte, err error)

func (*PartitionDef) MarshalTo added in v0.8.0

func (m *PartitionDef) MarshalTo(dAtA []byte) (int, error)

func (*PartitionDef) MarshalToSizedBuffer added in v0.8.0

func (m *PartitionDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PartitionDef) ProtoMessage added in v0.8.0

func (*PartitionDef) ProtoMessage()

func (*PartitionDef) ProtoSize added in v0.8.0

func (m *PartitionDef) ProtoSize() (n int)

func (*PartitionDef) Reset added in v0.8.0

func (m *PartitionDef) Reset()

func (*PartitionDef) String added in v0.8.0

func (m *PartitionDef) String() string

func (*PartitionDef) ToPBVersion added in v0.8.0

func (def *PartitionDef) ToPBVersion() TableDefPB

func (*PartitionDef) Unmarshal added in v0.8.0

func (m *PartitionDef) Unmarshal(dAtA []byte) error

func (*PartitionDef) XXX_DiscardUnknown added in v0.8.0

func (m *PartitionDef) XXX_DiscardUnknown()

func (*PartitionDef) XXX_Marshal added in v0.8.0

func (m *PartitionDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PartitionDef) XXX_Merge added in v0.8.0

func (m *PartitionDef) XXX_Merge(src proto.Message)

func (*PartitionDef) XXX_Size added in v0.8.0

func (m *PartitionDef) XXX_Size() int

func (*PartitionDef) XXX_Unmarshal added in v0.8.0

func (m *PartitionDef) XXX_Unmarshal(b []byte) error

type PrimaryKeyDef added in v0.7.0

type PrimaryKeyDef struct {
	Pkey *plan.PrimaryKeyDef
}

func (*PrimaryKeyDef) Descriptor added in v0.8.0

func (*PrimaryKeyDef) Descriptor() ([]byte, []int)

func (*PrimaryKeyDef) GetPkey added in v0.8.0

func (m *PrimaryKeyDef) GetPkey() *plan.PrimaryKeyDef

func (*PrimaryKeyDef) Marshal added in v0.8.0

func (m *PrimaryKeyDef) Marshal() (dAtA []byte, err error)

func (*PrimaryKeyDef) MarshalTo added in v0.8.0

func (m *PrimaryKeyDef) MarshalTo(dAtA []byte) (int, error)

func (*PrimaryKeyDef) MarshalToSizedBuffer added in v0.8.0

func (m *PrimaryKeyDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrimaryKeyDef) ProtoMessage added in v0.8.0

func (*PrimaryKeyDef) ProtoMessage()

func (*PrimaryKeyDef) ProtoSize added in v0.8.0

func (m *PrimaryKeyDef) ProtoSize() (n int)

func (*PrimaryKeyDef) Reset added in v0.8.0

func (m *PrimaryKeyDef) Reset()

func (*PrimaryKeyDef) String added in v0.8.0

func (m *PrimaryKeyDef) String() string

func (*PrimaryKeyDef) ToPBVersion added in v0.8.0

func (def *PrimaryKeyDef) ToPBVersion() ConstraintPB

func (*PrimaryKeyDef) Unmarshal added in v0.8.0

func (m *PrimaryKeyDef) Unmarshal(dAtA []byte) error

func (*PrimaryKeyDef) XXX_DiscardUnknown added in v0.8.0

func (m *PrimaryKeyDef) XXX_DiscardUnknown()

func (*PrimaryKeyDef) XXX_Marshal added in v0.8.0

func (m *PrimaryKeyDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrimaryKeyDef) XXX_Merge added in v0.8.0

func (m *PrimaryKeyDef) XXX_Merge(src proto.Message)

func (*PrimaryKeyDef) XXX_Size added in v0.8.0

func (m *PrimaryKeyDef) XXX_Size() int

func (*PrimaryKeyDef) XXX_Unmarshal added in v0.8.0

func (m *PrimaryKeyDef) XXX_Unmarshal(b []byte) error

type PropertiesDef

type PropertiesDef struct {
	Properties []Property
}

func (*PropertiesDef) Descriptor added in v0.8.0

func (*PropertiesDef) Descriptor() ([]byte, []int)

func (*PropertiesDef) GetProperties added in v0.8.0

func (m *PropertiesDef) GetProperties() []Property

func (*PropertiesDef) Marshal added in v0.8.0

func (m *PropertiesDef) Marshal() (dAtA []byte, err error)

func (*PropertiesDef) MarshalTo added in v0.8.0

func (m *PropertiesDef) MarshalTo(dAtA []byte) (int, error)

func (*PropertiesDef) MarshalToSizedBuffer added in v0.8.0

func (m *PropertiesDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PropertiesDef) ProtoMessage added in v0.8.0

func (*PropertiesDef) ProtoMessage()

func (*PropertiesDef) ProtoSize added in v0.8.0

func (m *PropertiesDef) ProtoSize() (n int)

func (*PropertiesDef) Reset added in v0.8.0

func (m *PropertiesDef) Reset()

func (*PropertiesDef) String added in v0.8.0

func (m *PropertiesDef) String() string

func (*PropertiesDef) ToPBVersion added in v0.8.0

func (def *PropertiesDef) ToPBVersion() TableDefPB

func (*PropertiesDef) Unmarshal added in v0.8.0

func (m *PropertiesDef) Unmarshal(dAtA []byte) error

func (*PropertiesDef) XXX_DiscardUnknown added in v0.8.0

func (m *PropertiesDef) XXX_DiscardUnknown()

func (*PropertiesDef) XXX_Marshal added in v0.8.0

func (m *PropertiesDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PropertiesDef) XXX_Merge added in v0.8.0

func (m *PropertiesDef) XXX_Merge(src proto.Message)

func (*PropertiesDef) XXX_Size added in v0.8.0

func (m *PropertiesDef) XXX_Size() int

func (*PropertiesDef) XXX_Unmarshal added in v0.8.0

func (m *PropertiesDef) XXX_Unmarshal(b []byte) error

type Property

type Property struct {
	Key          string
	Value        string
	ValueFactory func() string
}

func (*Property) Descriptor added in v0.8.0

func (*Property) Descriptor() ([]byte, []int)

func (*Property) GetKey added in v0.8.0

func (m *Property) GetKey() string

func (*Property) GetValue added in v0.8.0

func (m *Property) GetValue() string

func (*Property) Marshal added in v0.8.0

func (m *Property) Marshal() (dAtA []byte, err error)

func (*Property) MarshalTo added in v0.8.0

func (m *Property) MarshalTo(dAtA []byte) (int, error)

func (*Property) MarshalToSizedBuffer added in v0.8.0

func (m *Property) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Property) ProtoMessage added in v0.8.0

func (*Property) ProtoMessage()

func (*Property) ProtoSize added in v0.8.0

func (m *Property) ProtoSize() (n int)

func (*Property) Reset added in v0.8.0

func (m *Property) Reset()

func (*Property) String added in v0.8.0

func (m *Property) String() string

func (*Property) Unmarshal added in v0.8.0

func (m *Property) Unmarshal(dAtA []byte) error

func (*Property) XXX_DiscardUnknown added in v0.8.0

func (m *Property) XXX_DiscardUnknown()

func (*Property) XXX_Marshal added in v0.8.0

func (m *Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Property) XXX_Merge added in v0.8.0

func (m *Property) XXX_Merge(src proto.Message)

func (*Property) XXX_Size added in v0.8.0

func (m *Property) XXX_Size() int

func (*Property) XXX_Unmarshal added in v0.8.0

func (m *Property) XXX_Unmarshal(b []byte) error

type Ranges added in v1.2.0

type Ranges interface {
	GetBytes(i int) []byte

	Len() int

	Append([]byte)

	Size() int

	SetBytes([]byte)

	GetAllBytes() []byte

	Slice(i, j int) []byte
}

type RangesParam

type RangesParam struct {
	BlockFilters       []*plan.Expr //Slice of expressions used to filter zonemap
	PreAllocBlocks     int          //estimated count of blocks
	TxnOffset          int          //Transaction offset used to specify the starting position for reading data.
	Policy             DataCollectPolicy
	Rsp                *RangesShuffleParam
	DontSupportRelData bool
}
var DefaultRangesParam RangesParam = RangesParam{
	BlockFilters:       nil,
	PreAllocBlocks:     2,
	TxnOffset:          0,
	Policy:             Policy_CollectAllData,
	DontSupportRelData: true,
}

type RangesShuffleParam

type RangesShuffleParam struct {
	// these are for shuffle objects
	Node               *plan.Node
	CNCNT              int32 // number of all cns
	CNIDX              int32 // cn index , starts from 0
	IsLocalCN          bool
	ShuffleRangeUint64 []uint64
	ShuffleRangeInt64  []int64
	Init               bool
}

type Reader

type Reader interface {
	BaseReader
	SetOrderBy([]*plan.OrderBySpec)
	GetOrderBy() []*plan.OrderBySpec
	SetIndexParam(*plan.IndexReaderParam)
	SetFilterZM(objectio.ZoneMap)
}

type RefChildTableDef added in v0.7.0

type RefChildTableDef struct {
	Tables []uint64
}

func (*RefChildTableDef) Descriptor added in v0.8.0

func (*RefChildTableDef) Descriptor() ([]byte, []int)

func (*RefChildTableDef) GetTables added in v0.8.0

func (m *RefChildTableDef) GetTables() []uint64

func (*RefChildTableDef) Marshal added in v0.8.0

func (m *RefChildTableDef) Marshal() (dAtA []byte, err error)

func (*RefChildTableDef) MarshalTo added in v0.8.0

func (m *RefChildTableDef) MarshalTo(dAtA []byte) (int, error)

func (*RefChildTableDef) MarshalToSizedBuffer added in v0.8.0

func (m *RefChildTableDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RefChildTableDef) ProtoMessage added in v0.8.0

func (*RefChildTableDef) ProtoMessage()

func (*RefChildTableDef) ProtoSize added in v0.8.0

func (m *RefChildTableDef) ProtoSize() (n int)

func (*RefChildTableDef) Reset added in v0.8.0

func (m *RefChildTableDef) Reset()

func (*RefChildTableDef) String added in v0.8.0

func (m *RefChildTableDef) String() string

func (*RefChildTableDef) ToPBVersion added in v0.8.0

func (def *RefChildTableDef) ToPBVersion() ConstraintPB

func (*RefChildTableDef) Unmarshal added in v0.8.0

func (m *RefChildTableDef) Unmarshal(dAtA []byte) error

func (*RefChildTableDef) XXX_DiscardUnknown added in v0.8.0

func (m *RefChildTableDef) XXX_DiscardUnknown()

func (*RefChildTableDef) XXX_Marshal added in v0.8.0

func (m *RefChildTableDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RefChildTableDef) XXX_Merge added in v0.8.0

func (m *RefChildTableDef) XXX_Merge(src proto.Message)

func (*RefChildTableDef) XXX_Size added in v0.8.0

func (m *RefChildTableDef) XXX_Size() int

func (*RefChildTableDef) XXX_Unmarshal added in v0.8.0

func (m *RefChildTableDef) XXX_Unmarshal(b []byte) error

type RelData

type RelData interface {
	GetType() RelDataType
	String() string
	MarshalBinary() ([]byte, error)
	UnmarshalBinary(buf []byte) error
	AttachTombstones(tombstones Tombstoner) error
	GetTombstones() Tombstoner
	DataSlice(begin, end int) RelData

	BuildEmptyRelData(preAllocSize int) RelData
	DataCnt() int

	// for memory engine shard id list
	GetShardIDList() []uint64
	GetShardID(i int) uint64
	SetShardID(i int, id uint64)
	AppendShardID(id uint64)

	// for block info list
	Split(i int) []RelData
	GetBlockInfoSlice() objectio.BlockInfoSlice
	GetBlockInfo(i int) objectio.BlockInfo
	SetBlockInfo(i int, blk *objectio.BlockInfo)
	AppendBlockInfo(blk *objectio.BlockInfo)
	AppendBlockInfoSlice(objectio.BlockInfoSlice)
}

type RelDataType

type RelDataType uint8
const (
	RelDataEmpty RelDataType = iota
	RelDataShardIDList
	RelDataBlockList
	RelDataObjList
)

type Relation

type Relation interface {
	Statistics

	Ranges(context.Context, RangesParam) (RelData, error)

	CollectTombstones(ctx context.Context, txnOffset int, policy TombstoneCollectPolicy) (Tombstoner, error)

	// StarCount returns the total number of visible rows at the current transaction snapshot.
	// Optimized for COUNT(*) queries by using metadata (total rows - deleted rows)
	// instead of scanning data blocks.
	StarCount(ctx context.Context) (uint64, error)

	// EstimateCommittedTombstoneCount returns an estimated count of committed tombstone rows.
	// This is very lightweight (only reads metadata, no S3 I/O) and can be used to decide
	// whether to use StarCount optimization.
	// Returns an upper bound estimate (includes duplicates and invisible data object references).
	EstimateCommittedTombstoneCount(ctx context.Context) (int, error)

	CollectChanges(ctx context.Context, from, to types.TS, skipDeletes bool, mp *mpool.MPool) (ChangesHandle, error)

	CollectObjectList(ctx context.Context, from, to types.TS, bat *batch.Batch, mp *mpool.MPool) error

	TableDefs(context.Context) ([]TableDef, error)

	GetExtraInfo() *api.SchemaExtra

	// Get complete tableDef information, including columns, constraints, partitions, version, comments, etc
	GetTableDef(context.Context) *plan.TableDef
	CopyTableDef(context.Context) *plan.TableDef

	GetPrimaryKeys(context.Context) ([]*Attribute, error)

	// Note: Write Will access Fileservice
	Write(context.Context, *batch.Batch) error

	// Delete(context.Context, *vector.Vector, string) error
	Delete(context.Context, *batch.Batch, string) error

	AddTableDef(context.Context, TableDef) error
	DelTableDef(context.Context, TableDef) error

	// only ConstraintDef can be modified
	UpdateConstraint(context.Context, *ConstraintDef) error

	AlterTable(context.Context, *ConstraintDef, []*api.AlterTableReq) error

	// Support renaming tables within explicit transactions (CN worspace)
	TableRenameInTxn(ctx context.Context, constraint [][]byte) error

	GetTableID(context.Context) uint64

	// GetTableName returns the name of the table.
	GetTableName() string

	GetDBID(context.Context) uint64

	// Note: Write Will access Fileservice
	BuildReaders(
		ctx context.Context,
		proc any,
		expr *plan.Expr,
		relData RelData,
		num int,
		txnOffset int,
		orderBy bool,
		policy TombstoneApplyPolicy,
		filterHint FilterHint,
	) ([]Reader, error)

	BuildShardingReaders(
		ctx context.Context,
		proc any,
		expr *plan.Expr,
		relData RelData,
		num int,
		txnOffset int,
		orderBy bool,
		policy TombstoneApplyPolicy,
	) ([]Reader, error)

	TableColumns(ctx context.Context) ([]*Attribute, error)

	//max and min values
	MaxAndMinValues(ctx context.Context) ([][2]any, []uint8, error)

	GetEngineType() EngineType

	GetProcess() any

	// Note: GetColumMetadataScanInfo Will access Fileservice
	GetColumMetadataScanInfo(ctx context.Context, name string, visitTombstone bool) ([]*plan.MetadataScanInfo, error)

	// PrimaryKeysMayBeModified reports whether any rows with any primary keys in keyVector was modified during `from` to `to`
	// If not sure, returns true
	// Initially added for implementing locking rows by primary keys
	PrimaryKeysMayBeModified(ctx context.Context, from types.TS, to types.TS, batch *batch.Batch, pkIndex, partitionIndex int32) (bool, error)

	PrimaryKeysMayBeUpserted(ctx context.Context, from types.TS, to types.TS, batch *batch.Batch, pkIndex int32) (bool, error)

	ApproxObjectsNum(ctx context.Context) int
	MergeObjects(ctx context.Context, objstats []objectio.ObjectStats, targetObjSize uint32) (*api.MergeCommitEntry, error)
	GetNonAppendableObjectStats(ctx context.Context) ([]objectio.ObjectStats, error)

	// GetFlushTS returns the flush timestamp of the relation.
	GetFlushTS(ctx context.Context) (types.TS, error)

	// Reset resets the relation.
	Reset(op client.TxnOperator) error
}

type SnapshotReadPolicy

type SnapshotReadPolicy uint8

SnapshotReadPolicy controls how CollectChanges rebuilds changes once the requested range can no longer be served purely from the in-memory partition state and has to rely on snapshot-based recovery.

The default policy must remain compatible with existing CDC/replay callers.

const (
	// SnapshotReadPolicyCheckpointReplay keeps the existing checkpoint replay
	// behavior. It reconstructs change batches from checkpoint metadata and
	// preserves the historical semantics already used by CDC restart paths.
	SnapshotReadPolicyCheckpointReplay SnapshotReadPolicy = iota
	// SnapshotReadPolicyVisibleState preserves the exact visible net effect of
	// CollectChanges(start, end) when snapshot read is required. The primary
	// recovery path still uses range-aware checkpoint object selection; if those
	// object files are gone as well, it falls back to reconstructing the range
	// from visible snapshots.
	SnapshotReadPolicyVisibleState
)

func SnapshotReadPolicyFromContext

func SnapshotReadPolicyFromContext(ctx context.Context) SnapshotReadPolicy

SnapshotReadPolicyFromContext returns the policy requested by the caller. Missing context state always falls back to the checkpoint replay semantic.

type Statistics

type Statistics interface {
	// NOTE: Stats May indirectly access the file service
	Stats(ctx context.Context, sync bool) (*pb.StatsInfo, error)
	Rows(ctx context.Context) (uint64, error)
	Size(ctx context.Context, columnName string) (uint64, error)
}

type StreamConfigsDef added in v1.0.0

type StreamConfigsDef struct {
	Configs []*plan.Property
}

func (*StreamConfigsDef) Descriptor added in v1.0.0

func (*StreamConfigsDef) Descriptor() ([]byte, []int)

func (*StreamConfigsDef) GetConfigs added in v1.0.0

func (m *StreamConfigsDef) GetConfigs() []*plan.Property

func (*StreamConfigsDef) Marshal added in v1.0.0

func (m *StreamConfigsDef) Marshal() (dAtA []byte, err error)

func (*StreamConfigsDef) MarshalTo added in v1.0.0

func (m *StreamConfigsDef) MarshalTo(dAtA []byte) (int, error)

func (*StreamConfigsDef) MarshalToSizedBuffer added in v1.0.0

func (m *StreamConfigsDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StreamConfigsDef) ProtoMessage added in v1.0.0

func (*StreamConfigsDef) ProtoMessage()

func (*StreamConfigsDef) ProtoSize added in v1.0.0

func (m *StreamConfigsDef) ProtoSize() (n int)

func (*StreamConfigsDef) Reset added in v1.0.0

func (m *StreamConfigsDef) Reset()

func (*StreamConfigsDef) String added in v1.0.0

func (m *StreamConfigsDef) String() string

func (*StreamConfigsDef) ToPBVersion added in v1.0.0

func (def *StreamConfigsDef) ToPBVersion() ConstraintPB

func (*StreamConfigsDef) Unmarshal added in v1.0.0

func (m *StreamConfigsDef) Unmarshal(dAtA []byte) error

func (*StreamConfigsDef) XXX_DiscardUnknown added in v1.0.0

func (m *StreamConfigsDef) XXX_DiscardUnknown()

func (*StreamConfigsDef) XXX_Marshal added in v1.0.0

func (m *StreamConfigsDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamConfigsDef) XXX_Merge added in v1.0.0

func (m *StreamConfigsDef) XXX_Merge(src proto.Message)

func (*StreamConfigsDef) XXX_Size added in v1.0.0

func (m *StreamConfigsDef) XXX_Size() int

func (*StreamConfigsDef) XXX_Unmarshal added in v1.0.0

func (m *StreamConfigsDef) XXX_Unmarshal(b []byte) error

type TableDef

type TableDef interface {

	// ToPBVersion returns corresponding PB struct.
	ToPBVersion() TableDefPB
	// contains filtered or unexported methods
}

func PlanColsToExeCols

func PlanColsToExeCols(planCols []*plan.ColDef) []TableDef

type TableDefPB added in v0.8.0

type TableDefPB struct {
	// Types that are valid to be assigned to Def:
	//	*TableDefPB_CommentDef
	//	*TableDefPB_PartitionDef
	//	*TableDefPB_ViewDef
	//	*TableDefPB_AttributeDef
	//	*TableDefPB_IndexTableDef
	//	*TableDefPB_PropertiesDef
	//	*TableDefPB_ClusterByDef
	//	*TableDefPB_ConstraintDefPB
	//	*TableDefPB_VersionDef
	Def isTableDefPB_Def `protobuf_oneof:"def"`
}

PB version of TableDef

func (*TableDefPB) Descriptor added in v0.8.0

func (*TableDefPB) Descriptor() ([]byte, []int)

func (*TableDefPB) FromPBVersion added in v0.8.0

func (def *TableDefPB) FromPBVersion() TableDef

func (*TableDefPB) GetAttributeDef added in v0.8.0

func (m *TableDefPB) GetAttributeDef() *AttributeDef

func (*TableDefPB) GetClusterByDef added in v0.8.0

func (m *TableDefPB) GetClusterByDef() *ClusterByDef

func (*TableDefPB) GetCommentDef added in v0.8.0

func (m *TableDefPB) GetCommentDef() *CommentDef

func (*TableDefPB) GetConstraintDefPB added in v0.8.0

func (m *TableDefPB) GetConstraintDefPB() *ConstraintDefPB

func (*TableDefPB) GetDef added in v0.8.0

func (m *TableDefPB) GetDef() isTableDefPB_Def

func (*TableDefPB) GetIndexTableDef added in v0.8.0

func (m *TableDefPB) GetIndexTableDef() *IndexTableDef

func (*TableDefPB) GetPartitionDef added in v0.8.0

func (m *TableDefPB) GetPartitionDef() *PartitionDef

func (*TableDefPB) GetPropertiesDef added in v0.8.0

func (m *TableDefPB) GetPropertiesDef() *PropertiesDef

func (*TableDefPB) GetVersionDef added in v0.8.0

func (m *TableDefPB) GetVersionDef() *VersionDef

func (*TableDefPB) GetViewDef added in v0.8.0

func (m *TableDefPB) GetViewDef() *ViewDef

func (*TableDefPB) Marshal added in v0.8.0

func (m *TableDefPB) Marshal() (dAtA []byte, err error)

func (*TableDefPB) MarshalTo added in v0.8.0

func (m *TableDefPB) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB) ProtoMessage added in v0.8.0

func (*TableDefPB) ProtoMessage()

func (*TableDefPB) ProtoSize added in v0.8.0

func (m *TableDefPB) ProtoSize() (n int)

func (*TableDefPB) Reset added in v0.8.0

func (m *TableDefPB) Reset()

func (*TableDefPB) String added in v0.8.0

func (m *TableDefPB) String() string

func (*TableDefPB) Unmarshal added in v0.8.0

func (m *TableDefPB) Unmarshal(dAtA []byte) error

func (*TableDefPB) XXX_DiscardUnknown added in v0.8.0

func (m *TableDefPB) XXX_DiscardUnknown()

func (*TableDefPB) XXX_Marshal added in v0.8.0

func (m *TableDefPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDefPB) XXX_Merge added in v0.8.0

func (m *TableDefPB) XXX_Merge(src proto.Message)

func (*TableDefPB) XXX_OneofWrappers added in v0.8.0

func (*TableDefPB) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*TableDefPB) XXX_Size added in v0.8.0

func (m *TableDefPB) XXX_Size() int

func (*TableDefPB) XXX_Unmarshal added in v0.8.0

func (m *TableDefPB) XXX_Unmarshal(b []byte) error

type TableDefPB_AttributeDef added in v0.8.0

type TableDefPB_AttributeDef struct {
	AttributeDef *AttributeDef `protobuf:"bytes,4,opt,name=AttributeDef,proto3,oneof" json:"AttributeDef,omitempty"`
}

func (*TableDefPB_AttributeDef) MarshalTo added in v0.8.0

func (m *TableDefPB_AttributeDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_AttributeDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_AttributeDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_AttributeDef) ProtoSize added in v0.8.0

func (m *TableDefPB_AttributeDef) ProtoSize() (n int)

type TableDefPB_ClusterByDef added in v0.8.0

type TableDefPB_ClusterByDef struct {
	ClusterByDef *ClusterByDef `protobuf:"bytes,7,opt,name=ClusterByDef,proto3,oneof" json:"ClusterByDef,omitempty"`
}

func (*TableDefPB_ClusterByDef) MarshalTo added in v0.8.0

func (m *TableDefPB_ClusterByDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_ClusterByDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_ClusterByDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_ClusterByDef) ProtoSize added in v0.8.0

func (m *TableDefPB_ClusterByDef) ProtoSize() (n int)

type TableDefPB_CommentDef added in v0.8.0

type TableDefPB_CommentDef struct {
	CommentDef *CommentDef `protobuf:"bytes,1,opt,name=CommentDef,proto3,oneof" json:"CommentDef,omitempty"`
}

func (*TableDefPB_CommentDef) MarshalTo added in v0.8.0

func (m *TableDefPB_CommentDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_CommentDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_CommentDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_CommentDef) ProtoSize added in v0.8.0

func (m *TableDefPB_CommentDef) ProtoSize() (n int)

type TableDefPB_ConstraintDefPB added in v0.8.0

type TableDefPB_ConstraintDefPB struct {
	ConstraintDefPB *ConstraintDefPB `protobuf:"bytes,8,opt,name=ConstraintDefPB,proto3,oneof" json:"ConstraintDefPB,omitempty"`
}

func (*TableDefPB_ConstraintDefPB) MarshalTo added in v0.8.0

func (m *TableDefPB_ConstraintDefPB) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_ConstraintDefPB) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_ConstraintDefPB) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_ConstraintDefPB) ProtoSize added in v0.8.0

func (m *TableDefPB_ConstraintDefPB) ProtoSize() (n int)

type TableDefPB_IndexTableDef added in v0.8.0

type TableDefPB_IndexTableDef struct {
	IndexTableDef *IndexTableDef `protobuf:"bytes,5,opt,name=IndexTableDef,proto3,oneof" json:"IndexTableDef,omitempty"`
}

func (*TableDefPB_IndexTableDef) MarshalTo added in v0.8.0

func (m *TableDefPB_IndexTableDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_IndexTableDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_IndexTableDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_IndexTableDef) ProtoSize added in v0.8.0

func (m *TableDefPB_IndexTableDef) ProtoSize() (n int)

type TableDefPB_PartitionDef added in v0.8.0

type TableDefPB_PartitionDef struct {
	PartitionDef *PartitionDef `protobuf:"bytes,2,opt,name=PartitionDef,proto3,oneof" json:"PartitionDef,omitempty"`
}

func (*TableDefPB_PartitionDef) MarshalTo added in v0.8.0

func (m *TableDefPB_PartitionDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_PartitionDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_PartitionDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_PartitionDef) ProtoSize added in v0.8.0

func (m *TableDefPB_PartitionDef) ProtoSize() (n int)

type TableDefPB_PropertiesDef added in v0.8.0

type TableDefPB_PropertiesDef struct {
	PropertiesDef *PropertiesDef `protobuf:"bytes,6,opt,name=PropertiesDef,proto3,oneof" json:"PropertiesDef,omitempty"`
}

func (*TableDefPB_PropertiesDef) MarshalTo added in v0.8.0

func (m *TableDefPB_PropertiesDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_PropertiesDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_PropertiesDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_PropertiesDef) ProtoSize added in v0.8.0

func (m *TableDefPB_PropertiesDef) ProtoSize() (n int)

type TableDefPB_VersionDef added in v0.8.0

type TableDefPB_VersionDef struct {
	VersionDef *VersionDef `protobuf:"bytes,9,opt,name=VersionDef,proto3,oneof" json:"VersionDef,omitempty"`
}

func (*TableDefPB_VersionDef) MarshalTo added in v0.8.0

func (m *TableDefPB_VersionDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_VersionDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_VersionDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_VersionDef) ProtoSize added in v0.8.0

func (m *TableDefPB_VersionDef) ProtoSize() (n int)

type TableDefPB_ViewDef added in v0.8.0

type TableDefPB_ViewDef struct {
	ViewDef *ViewDef `protobuf:"bytes,3,opt,name=ViewDef,proto3,oneof" json:"ViewDef,omitempty"`
}

func (*TableDefPB_ViewDef) MarshalTo added in v0.8.0

func (m *TableDefPB_ViewDef) MarshalTo(dAtA []byte) (int, error)

func (*TableDefPB_ViewDef) MarshalToSizedBuffer added in v0.8.0

func (m *TableDefPB_ViewDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TableDefPB_ViewDef) ProtoSize added in v0.8.0

func (m *TableDefPB_ViewDef) ProtoSize() (n int)

type TombstoneApplyPolicy

type TombstoneApplyPolicy uint64

type TombstoneCollectPolicy

type TombstoneCollectPolicy uint64

type TombstoneType

type TombstoneType uint8
const (
	InvalidTombstoneData TombstoneType = iota
	TombstoneData
)

type Tombstoner

type Tombstoner interface {
	Type() TombstoneType
	HasAnyInMemoryTombstone() bool
	HasAnyTombstoneFile() bool

	String() string
	StringWithPrefix(string) string

	// false positive check, HasBlockTombstone will access FileService
	HasBlockTombstone(ctx context.Context, id *objectio.Blockid, fs fileservice.FileService) (bool, error)

	MarshalBinaryWithBuffer(w *bytes.Buffer) error
	UnmarshalBinary(buf []byte) error

	PrefetchTombstones(srvId string, fs fileservice.FileService, bid []objectio.Blockid)

	// it applies the block related in-memory tombstones to the rowsOffset
	// `bid` is the block id
	// `rowsOffset` is the input rows offset to apply
	// `deleted` is the rows that are deleted from this apply
	// `left` is the rows that are left after this apply
	ApplyInMemTombstones(
		bid *types.Blockid,
		rowsOffset []int64,
		deleted *objectio.Bitmap,
	) (left []int64)

	// it applies the block related tombstones from the persisted tombstone file
	// to the rowsOffset
	ApplyPersistedTombstones(
		ctx context.Context,
		fs fileservice.FileService,
		snapshot *types.TS,
		bid *types.Blockid,
		rowsOffset []int64,
		deletedMask *objectio.Bitmap,
	) (left []int64, err error)

	// a.merge(b) => a = a U b
	// a and b must be sorted ascendingly
	// a.Type() must be equal to b.Type()
	Merge(other Tombstoner) error

	// in-memory tombstones must be sorted ascendingly
	// it should be called after all in-memory tombstones are added
	SortInMemory()
}

type VectorPool added in v0.8.0

type VectorPool interface {
	PutBatch(bat *batch.Batch)
	GetVector(typ types.Type) *vector.Vector
}

type VersionDef added in v0.8.0

type VersionDef struct {
	Version uint32
}

func (*VersionDef) Descriptor added in v0.8.0

func (*VersionDef) Descriptor() ([]byte, []int)

func (*VersionDef) GetVersion added in v0.8.0

func (m *VersionDef) GetVersion() uint32

func (*VersionDef) Marshal added in v0.8.0

func (m *VersionDef) Marshal() (dAtA []byte, err error)

func (*VersionDef) MarshalTo added in v0.8.0

func (m *VersionDef) MarshalTo(dAtA []byte) (int, error)

func (*VersionDef) MarshalToSizedBuffer added in v0.8.0

func (m *VersionDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VersionDef) ProtoMessage added in v0.8.0

func (*VersionDef) ProtoMessage()

func (*VersionDef) ProtoSize added in v0.8.0

func (m *VersionDef) ProtoSize() (n int)

func (*VersionDef) Reset added in v0.8.0

func (m *VersionDef) Reset()

func (*VersionDef) String added in v0.8.0

func (m *VersionDef) String() string

func (*VersionDef) ToPBVersion added in v0.8.0

func (def *VersionDef) ToPBVersion() TableDefPB

func (*VersionDef) Unmarshal added in v0.8.0

func (m *VersionDef) Unmarshal(dAtA []byte) error

func (*VersionDef) XXX_DiscardUnknown added in v0.8.0

func (m *VersionDef) XXX_DiscardUnknown()

func (*VersionDef) XXX_Marshal added in v0.8.0

func (m *VersionDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionDef) XXX_Merge added in v0.8.0

func (m *VersionDef) XXX_Merge(src proto.Message)

func (*VersionDef) XXX_Size added in v0.8.0

func (m *VersionDef) XXX_Size() int

func (*VersionDef) XXX_Unmarshal added in v0.8.0

func (m *VersionDef) XXX_Unmarshal(b []byte) error

type ViewDef added in v0.6.0

type ViewDef struct {
	View string
}

func (*ViewDef) Descriptor added in v0.8.0

func (*ViewDef) Descriptor() ([]byte, []int)

func (*ViewDef) GetView added in v0.8.0

func (m *ViewDef) GetView() string

func (*ViewDef) Marshal added in v0.8.0

func (m *ViewDef) Marshal() (dAtA []byte, err error)

func (*ViewDef) MarshalTo added in v0.8.0

func (m *ViewDef) MarshalTo(dAtA []byte) (int, error)

func (*ViewDef) MarshalToSizedBuffer added in v0.8.0

func (m *ViewDef) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ViewDef) ProtoMessage added in v0.8.0

func (*ViewDef) ProtoMessage()

func (*ViewDef) ProtoSize added in v0.8.0

func (m *ViewDef) ProtoSize() (n int)

func (*ViewDef) Reset added in v0.8.0

func (m *ViewDef) Reset()

func (*ViewDef) String added in v0.8.0

func (m *ViewDef) String() string

func (*ViewDef) ToPBVersion added in v0.8.0

func (def *ViewDef) ToPBVersion() TableDefPB

func (*ViewDef) Unmarshal added in v0.8.0

func (m *ViewDef) Unmarshal(dAtA []byte) error

func (*ViewDef) XXX_DiscardUnknown added in v0.8.0

func (m *ViewDef) XXX_DiscardUnknown()

func (*ViewDef) XXX_Marshal added in v0.8.0

func (m *ViewDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ViewDef) XXX_Merge added in v0.8.0

func (m *ViewDef) XXX_Merge(src proto.Message)

func (*ViewDef) XXX_Size added in v0.8.0

func (m *ViewDef) XXX_Size() int

func (*ViewDef) XXX_Unmarshal added in v0.8.0

func (m *ViewDef) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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