Documentation ¶
Index ¶
- Variables
- func CreateSessionFunc(store kv.Storage) pools.Factory
- func DisableStats4Test()
- func GetDomain(store kv.Storage) (*domain.Domain, error)
- func SetSchemaLease(lease time.Duration)
- func SetStatsLease(lease time.Duration)
- type ColumnInfo
- type ProcessInfo
- type RecordSet
- type ResultSet
- type RetrieveTxnOpt
- type Session
- type SessionManager
- type TxnState
- func (st *TxnState) BatchGet(ctx context.Context, keys []kv.Key) (map[string][]byte, error)
- func (st *TxnState) Commit(ctx context.Context) error
- func (st *TxnState) Delete(k kv.Key) error
- func (st *TxnState) Flush() (int, error)
- func (st *TxnState) Get(ctx context.Context, k kv.Key) ([]byte, error)
- func (st *TxnState) GetMemBuffer() kv.MemBuffer
- func (st *TxnState) GoString() string
- func (st *TxnState) Iter(k kv.Key, upperBound kv.Key) (kv.Iterator, error)
- func (st *TxnState) IterReverse(k kv.Key) (kv.Iterator, error)
- func (st *TxnState) KeysNeedToLock() ([]kv.Key, error)
- func (st *TxnState) Rollback() error
- func (st *TxnState) Set(k kv.Key, v []byte) error
- func (st *TxnState) Size() int
- func (st *TxnState) String() string
- func (st *TxnState) Valid() bool
- type TxnStateOption
Constants ¶
This section is empty.
Variables ¶
var (
SessCount int32 = 0
)
Functions ¶
func SetSchemaLease ¶
SetSchemaLease changes the default schema lease time for DDL. This function is very dangerous, don't use it if you really know what you do. SetSchemaLease only affects not local storage after bootstrapped.
func SetStatsLease ¶
SetStatsLease changes the default stats lease time for loading stats info.
Types ¶
type ColumnInfo ¶
type ColumnInfo struct { Schema string Table string OrgTable string Name string OrgName string ColumnLength uint32 Decimal uint8 Type uint8 DefaultValueLength uint64 DefaultValue []byte }
ColumnInfo contains information of a column
type ProcessInfo ¶
type ProcessInfo struct { }
type ResultSet ¶
type ResultSet interface { Columns() []*ColumnInfo NewChunk() *chunk.Chunk Next(context.Context, *chunk.Chunk) error StoreFetchedRows(rows []chunk.Row) GetFetchedRows() []chunk.Row Close() error }
ResultSet is the result set of an query.
type RetrieveTxnOpt ¶
type Session ¶
type Session interface { sessionctx.Context Close() SetLabels(map[string]string) Labels() map[string]string HandleRead(context.Context, rpc.ReadRequest, kv.Transaction) (RecordSet, error) HandleMutate(context.Context, rpc.MutationRequest, kv.Transaction) (rpc.Response, error) RetrieveTxn(context.Context, *tspb.TransactionSelector, *RetrieveTxnOpt) (*TxnState, error) RawkvAccess(context.Context, string) (bool, error) CommitTxn(context.Context, kv.Transaction) error RollbackTxn(context.Context, kv.Transaction) error SetDB(db string) GetName() string ToProto() *tspb.Session SetLastActive(time.Time) LastActive() time.Time Active() bool }
type SessionManager ¶
type SessionManager interface { ShowProcessList() map[uint64]*ProcessInfo GetProcessInfo(id uint64) (*ProcessInfo, bool) Kill(connectionID uint64, query bool) }
type TxnState ¶
type TxnState struct { // States of a TxnState should be one of the followings: // Invalid: kv.Transaction == nil && txnFuture == nil // Pending: kv.Transaction == nil && txnFuture != nil // Valid: kv.Transaction != nil && txnFuture == nil ID string kv.Transaction TxnOpt TxnStateOption // contains filtered or unexported fields }
TxnState wraps kv.Transaction to provide a new kv.Transaction. 1. It holds all statement related modification in the buffer before flush to the txn, so if execute statement meets error, the txn won't be made dirty. 2. It's a lazy transaction, that means it's a txnFuture before StartTS() is really need.
func NewTxnState ¶
func (*TxnState) GetMemBuffer ¶
GetMemBuffer overrides the Transaction interface.
func (*TxnState) IterReverse ¶
IterReverse overrides the Transaction interface.
func (*TxnState) KeysNeedToLock ¶
KeysNeedToLock returns the keys need to be locked.
type TxnStateOption ¶
TxnStateOption Zetta TxnState Option