Documentation ¶
Index ¶
- Constants
- Variables
- type KeyEvent
- type KeyEventType
- type KeyEventWaiter
- type Manager
- func (tm *Manager) Close()
- func (tm *Manager) GetTxn(txnId types.TxnId) (*Transaction, error)
- func (tm *Manager) InsertTxnIfNotExists(id types.TxnId, db types.KV) (inserted bool, txn *Transaction, err error)
- func (tm *Manager) MustInsertTxnIfNotExists(id types.TxnId, db types.KV) (inserted bool, txn *Transaction)
- func (tm *Manager) PushReadModifyWriteReaderOnKey(key string, readOpt types.KVCCReadOption) (*readModifyWriteCond, error)
- func (tm *Manager) SignalReadModifyWriteKeyEvent(readModifyWriteTxnId types.TxnId, event ReadModifyWriteKeyEvent)
- type ReadModifyWriteKeyEvent
- type ReadModifyWriteKeyEventType
- type Transaction
- func (t *Transaction) AddUnsafe(key string) (addedNewKey bool)
- func (t *Transaction) ClearWriteIntent(ctx context.Context, key string, opt types.KVCCUpdateMetaOption) (err error)
- func (t *Transaction) GetMaxTxnRecordReadVersion() uint64
- func (t *Transaction) GetTxnRecord(ctx context.Context, opt types.KVCCReadOption) (types.ValueCC, error)
- func (t *Transaction) IsDoneUnsafe() bool
- func (t *Transaction) IsKeyDone(key string) (b bool)
- func (t *Transaction) RemoveTxnRecord(ctx context.Context, opt types.KVCCRemoveTxnRecordOption) (err error)
- func (t *Transaction) RollbackKey(ctx context.Context, key string, opt types.KVCCRollbackKeyOption) (err error)
- func (t *Transaction) SetRollbacking() (abortOnce bool)
- func (t *Transaction) SetTxnRecord(ctx context.Context, val types.Value, opt types.KVCCWriteOption) error
- func (t *Transaction) SetTxnState(_ types.TxnState) (newState types.TxnState, terminateOnce bool)
- func (t *Transaction) SetTxnStateUnsafe(state types.TxnState) (newState types.TxnState)
- func (t *Transaction) WaitTerminateWithTimeout(ctx context.Context, timeout time.Duration) error
- type Writer
- type WritingWriters
Constants ¶
View Source
const ( EstimatedMaxQPS = 1000000 TxnPartitionNum = 256 )
Variables ¶
View Source
var HasMoreWritingWriters = NewWriter(types.DBMeta{Flag: consts.ValueMetaBitMaskHasWriteIntent}, newTransaction(types.MaxTxnId, nil, nil))
HasMoreWritingWriters is a dummy writer used to indicate that has more pending writers afterwards, the Next list is not complete
View Source
var InvalidKeyEvent = KeyEvent{Type: KeyEventTypeInvalid}
Functions ¶
This section is empty.
Types ¶
type KeyEvent ¶
type KeyEvent struct { Key string Type KeyEventType }
Deprecated
func NewKeyEvent ¶
func NewKeyEvent(key string, typ KeyEventType) KeyEvent
type KeyEventType ¶
type KeyEventType int
Deprecated
const ( // Deprecated KeyEventTypeInvalid KeyEventType = iota // Deprecated KeyEventTypeClearWriteIntent // cleared or clearing // Deprecated KeyEventTypeVersionRemoved // Deprecated KeyEventTypeRemoveVersionFailed )
func (KeyEventType) String ¶
func (t KeyEventType) String() string
type KeyEventWaiter ¶
type KeyEventWaiter struct {
// contains filtered or unexported fields
}
Deprecated
func (*KeyEventWaiter) WaitWithTimeout ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cfg types.TabletTxnManagerConfig) *Manager
func (*Manager) InsertTxnIfNotExists ¶
func (*Manager) MustInsertTxnIfNotExists ¶
func (*Manager) PushReadModifyWriteReaderOnKey ¶
func (tm *Manager) PushReadModifyWriteReaderOnKey(key string, readOpt types.KVCCReadOption) (*readModifyWriteCond, error)
func (*Manager) SignalReadModifyWriteKeyEvent ¶
func (tm *Manager) SignalReadModifyWriteKeyEvent(readModifyWriteTxnId types.TxnId, event ReadModifyWriteKeyEvent)
type ReadModifyWriteKeyEvent ¶
type ReadModifyWriteKeyEvent struct { Key string Type ReadModifyWriteKeyEventType }
func NewReadModifyWriteKeyEvent ¶
func NewReadModifyWriteKeyEvent(key string, typ ReadModifyWriteKeyEventType) ReadModifyWriteKeyEvent
func (ReadModifyWriteKeyEvent) String ¶
func (e ReadModifyWriteKeyEvent) String() string
type ReadModifyWriteKeyEventType ¶
type ReadModifyWriteKeyEventType int
const ( ReadModifyWriteKeyEventTypeInvalid ReadModifyWriteKeyEventType = iota ReadModifyWriteKeyEventTypeWriteIntentCleared ReadModifyWriteKeyEventTypeClearWriteIntentFailed ReadModifyWriteKeyEventTypeVersionRemoved ReadModifyWriteKeyEventTypeRemoveVersionFailed ReadModifyWriteKeyEventTypeKeyWritten )
func GetReadModifyWriteKeyEventTypeClearWriteIntent ¶
func GetReadModifyWriteKeyEventTypeClearWriteIntent(success bool) ReadModifyWriteKeyEventType
func GetReadModifyWriteKeyEventTypeRemoveVersion ¶
func GetReadModifyWriteKeyEventTypeRemoveVersion(success bool) ReadModifyWriteKeyEventType
func (ReadModifyWriteKeyEventType) String ¶
func (t ReadModifyWriteKeyEventType) String() string
type Transaction ¶
type Transaction struct { sync.RWMutex ID types.TxnId types.AtomicTxnState GC func(*Transaction) // contains filtered or unexported fields }
func (*Transaction) AddUnsafe ¶
func (t *Transaction) AddUnsafe(key string) (addedNewKey bool)
func (*Transaction) ClearWriteIntent ¶
func (t *Transaction) ClearWriteIntent(ctx context.Context, key string, opt types.KVCCUpdateMetaOption) (err error)
func (*Transaction) GetMaxTxnRecordReadVersion ¶
func (t *Transaction) GetMaxTxnRecordReadVersion() uint64
func (*Transaction) GetTxnRecord ¶
func (t *Transaction) GetTxnRecord(ctx context.Context, opt types.KVCCReadOption) (types.ValueCC, error)
func (*Transaction) IsDoneUnsafe ¶
func (t *Transaction) IsDoneUnsafe() bool
func (*Transaction) IsKeyDone ¶
func (t *Transaction) IsKeyDone(key string) (b bool)
func (*Transaction) RemoveTxnRecord ¶
func (t *Transaction) RemoveTxnRecord(ctx context.Context, opt types.KVCCRemoveTxnRecordOption) (err error)
func (*Transaction) RollbackKey ¶
func (t *Transaction) RollbackKey(ctx context.Context, key string, opt types.KVCCRollbackKeyOption) (err error)
func (*Transaction) SetRollbacking ¶
func (t *Transaction) SetRollbacking() (abortOnce bool)
Hide AtomicTxnState::SetRollbacking
func (*Transaction) SetTxnRecord ¶
func (t *Transaction) SetTxnRecord(ctx context.Context, val types.Value, opt types.KVCCWriteOption) error
func (*Transaction) SetTxnState ¶
Hide AtomicTxnState::SetTxnState
func (*Transaction) SetTxnStateUnsafe ¶
func (t *Transaction) SetTxnStateUnsafe(state types.TxnState) (newState types.TxnState)
func (*Transaction) WaitTerminateWithTimeout ¶
type Writer ¶
type Writer struct { *Transaction Meta types.DBMeta // NOTE: be cautious not inherit the type, otherwise will cause method conflict problem OnUnlocked func() // contains filtered or unexported fields }
func (*Writer) WaitWritten ¶
func (w *Writer) WaitWritten()
Click to show internal directories.
Click to hide internal directories.