rpc

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_ALLOWED_TXN_LATENCY = time.Millisecond * 300
	MAX_TXN_COMMIT_LATENCY  = time.Minute * 2
)

Variables

This section is empty.

Functions

func AppendDataToTable added in v0.8.0

func AppendDataToTable(ctx context.Context, rel handle.Relation, bat *batch.Batch) (err error)

func AttrFromColDef added in v0.8.0

func AttrFromColDef(col *catalog.ColDef) (attrs *engine.Attribute, err error)

func CreateRelation added in v0.8.0

func CreateRelation(
	_ context.Context,
	dbH handle.Database,
	name string,
	id uint64,
	defs []engine.TableDef) (err error)

func DefsToSchema added in v0.8.0

func DefsToSchema(name string, defs []engine.TableDef) (schema *catalog.Schema, err error)

func GetHideKeysOfTable added in v0.8.0

func GetHideKeysOfTable(rel handle.Relation) ([]*engine.Attribute, error)

func IsDistrictTable added in v1.0.1

func IsDistrictTable(name string) bool

func PrintTuple added in v1.0.1

func PrintTuple(tuple types.Tuple) string

func RunFactory added in v1.0.0

func RunFactory[T InspectCmd](t T) func(cmd *cobra.Command, args []string)

func RunInspect added in v0.7.0

func RunInspect(ctx context.Context, inspectCtx *inspectContext)

func SchemaToDefs added in v0.8.0

func SchemaToDefs(schema *catalog.Schema) (defs []engine.TableDef, err error)

func TableDefs added in v0.8.0

func TableDefs(rel handle.Relation) ([]engine.TableDef, error)

func TableNamesOfDB added in v0.8.0

func TableNamesOfDB(db handle.Database) ([]string, error)

Types

type Handle

type Handle struct {
	GCManager *gc.Manager
	// contains filtered or unexported fields
}

func NewTAEHandle

func NewTAEHandle(ctx context.Context, path string, opt *options.Options) *Handle

func (*Handle) CacheTxnRequest

func (h *Handle) CacheTxnRequest(
	ctx context.Context,
	meta txn.TxnMeta,
	req any,
	rsp any) (err error)

func (*Handle) EvaluateTxnRequest added in v0.7.0

func (h *Handle) EvaluateTxnRequest(
	ctx context.Context,
	meta txn.TxnMeta,
) error

EvaluateTxnRequest only evaluate the request ,do not change the state machine of TxnEngine.

func (*Handle) GCCache added in v0.8.0

func (h *Handle) GCCache(now time.Time) error

TODO: vast items within h.mu.txnCtxs would incur performance penality.

func (*Handle) GetDB added in v0.8.0

func (h *Handle) GetDB() *db.DB

func (*Handle) HandleAddFaultPoint added in v1.0.0

func (h *Handle) HandleAddFaultPoint(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.FaultPoint,
	resp *api.SyncLogTailResp) (func(), error)

func (*Handle) HandleAlterTable added in v0.8.0

func (h *Handle) HandleAlterTable(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *api.AlterTableReq,
	resp *db.WriteResp) (err error)

func (*Handle) HandleBackup added in v1.0.0

func (h *Handle) HandleBackup(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.Checkpoint,
	resp *api.SyncLogTailResp) (cb func(), err error)

func (*Handle) HandleClose

func (h *Handle) HandleClose(ctx context.Context) (err error)

func (*Handle) HandleCommit

func (h *Handle) HandleCommit(
	ctx context.Context,
	meta txn.TxnMeta) (cts timestamp.Timestamp, err error)

func (*Handle) HandleCommitting

func (h *Handle) HandleCommitting(
	ctx context.Context,
	meta txn.TxnMeta) (err error)

func (*Handle) HandleCreateDatabase

func (h *Handle) HandleCreateDatabase(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *db.CreateDatabaseReq,
	resp *db.CreateDatabaseResp) (err error)

func (*Handle) HandleCreateRelation

func (h *Handle) HandleCreateRelation(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *db.CreateRelationReq,
	resp *db.CreateRelationResp) (err error)

func (*Handle) HandleDestroy

func (h *Handle) HandleDestroy(ctx context.Context) (err error)

func (*Handle) HandleDropDatabase

func (h *Handle) HandleDropDatabase(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *db.DropDatabaseReq,
	resp *db.DropDatabaseResp) (err error)

func (*Handle) HandleDropOrTruncateRelation

func (h *Handle) HandleDropOrTruncateRelation(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *db.DropOrTruncateRelationReq,
	resp *db.DropOrTruncateRelationResp) (err error)

func (*Handle) HandleFlushTable

func (h *Handle) HandleFlushTable(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.FlushTable,
	resp *api.SyncLogTailResp) (cb func(), err error)

func (*Handle) HandleForceCheckpoint added in v0.7.0

func (h *Handle) HandleForceCheckpoint(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.Checkpoint,
	resp *api.SyncLogTailResp) (cb func(), err error)

func (*Handle) HandleForceGlobalCheckpoint added in v1.1.2

func (h *Handle) HandleForceGlobalCheckpoint(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.Checkpoint,
	resp *api.SyncLogTailResp) (cb func(), err error)

func (*Handle) HandleGetLogTail

func (h *Handle) HandleGetLogTail(
	ctx context.Context,
	meta txn.TxnMeta,
	req *api.SyncLogTailReq,
	resp *api.SyncLogTailResp) (closeCB func(), err error)

func (*Handle) HandleInspectTN added in v1.0.0

func (h *Handle) HandleInspectTN(
	ctx context.Context,
	meta txn.TxnMeta,
	req *db.InspectTN,
	resp *db.InspectResp) (cb func(), err error)

func (*Handle) HandlePreCommitWrite

func (h *Handle) HandlePreCommitWrite(
	ctx context.Context,
	meta txn.TxnMeta,
	req *api.PrecommitWriteCmd,
	resp *api.SyncLogTailResp) (err error)

func (*Handle) HandlePrepare

func (h *Handle) HandlePrepare(
	ctx context.Context,
	meta txn.TxnMeta) (pts timestamp.Timestamp, err error)

func (*Handle) HandleRollback

func (h *Handle) HandleRollback(
	ctx context.Context,
	meta txn.TxnMeta) (err error)

func (*Handle) HandleStartRecovery

func (h *Handle) HandleStartRecovery(
	ctx context.Context,
	ch chan txn.TxnMeta)

func (*Handle) HandleStorageUsage added in v1.0.1

func (h *Handle) HandleStorageUsage(ctx context.Context, meta txn.TxnMeta,
	req *db.StorageUsageReq, resp *db.StorageUsageResp) (func(), error)

func (*Handle) HandleTraceSpan added in v1.0.0

func (h *Handle) HandleTraceSpan(ctx context.Context,
	meta txn.TxnMeta,
	req *db.TraceSpan,
	resp *api.SyncLogTailResp) (func(), error)

func (*Handle) HandleWrite

func (h *Handle) HandleWrite(
	ctx context.Context,
	txn txnif.AsyncTxn,
	req *db.WriteReq,
	resp *db.WriteResp) (err error)

HandleWrite Handle DML commands

type InspectCmd added in v1.0.0

type InspectCmd interface {
	FromCommand(cmd *cobra.Command) error
	String() string
	Run() error
}

Jump to

Keyboard shortcuts

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