Versions in this module Expand all Collapse all v1 v1.1.9 Oct 1, 2018 Changes in this version + const DefaultLeaseDuration + var ErrIntOverflowLease = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthLease = fmt.Errorf("proto: negative length found during unmarshaling") + func IncrementValRetryable(ctx context.Context, db *DB, key roachpb.Key, inc int64) (int64, error) + func SendWrapped(ctx context.Context, sender Sender, args roachpb.Request) (roachpb.Response, *roachpb.Error) + func SendWrappedWith(ctx context.Context, sender Sender, h roachpb.Header, args roachpb.Request) (roachpb.Response, *roachpb.Error) + type AutoCommitError struct + func (e *AutoCommitError) Error() string + type Batch struct + Header roachpb.Header + Results []Result + func (b *Batch) AddRawRequest(reqs ...roachpb.Request) + func (b *Batch) CPut(key, value, expValue interface{}) + func (b *Batch) CheckConsistency(s, e interface{}, withDiff bool) + func (b *Batch) Del(keys ...interface{}) + func (b *Batch) DelRange(s, e interface{}, returnKeys bool) + func (b *Batch) Get(key interface{}) + func (b *Batch) Inc(key interface{}, value int64) + func (b *Batch) InitPut(key, value interface{}, failOnTombstones bool) + func (b *Batch) MustPErr() *roachpb.Error + func (b *Batch) Put(key, value interface{}) + func (b *Batch) PutInline(key, value interface{}) + func (b *Batch) RawResponse() *roachpb.BatchResponse + func (b *Batch) ReverseScan(s, e interface{}) + func (b *Batch) Scan(s, e interface{}) + type DB struct + func NewDB(sender Sender, clock *hlc.Clock) *DB + func NewDBWithContext(sender Sender, clock *hlc.Clock, ctx DBContext) *DB + func (db *DB) AddSSTable(ctx context.Context, begin, end interface{}, data []byte) error + func (db *DB) AdminChangeReplicas(ctx context.Context, key interface{}, changeType roachpb.ReplicaChangeType, ...) error + func (db *DB) AdminMerge(ctx context.Context, key interface{}) error + func (db *DB) AdminSplit(ctx context.Context, spanKey, splitKey interface{}) error + func (db *DB) AdminTransferLease(ctx context.Context, key interface{}, target roachpb.StoreID) error + func (db *DB) CPut(ctx context.Context, key, value, expValue interface{}) error + func (db *DB) CheckConsistency(ctx context.Context, begin, end interface{}, withDiff bool) error + func (db *DB) Del(ctx context.Context, keys ...interface{}) error + func (db *DB) DelRange(ctx context.Context, begin, end interface{}) error + func (db *DB) Get(ctx context.Context, key interface{}) (KeyValue, error) + func (db *DB) GetProto(ctx context.Context, key interface{}, msg proto.Message) error + func (db *DB) GetSender() Sender + func (db *DB) Inc(ctx context.Context, key interface{}, value int64) (KeyValue, error) + func (db *DB) InitPut(ctx context.Context, key, value interface{}, failOnTombstones bool) error + func (db *DB) Put(ctx context.Context, key, value interface{}) error + func (db *DB) PutInline(ctx context.Context, key, value interface{}) error + func (db *DB) ReverseScan(ctx context.Context, begin, end interface{}, maxRows int64) ([]KeyValue, error) + func (db *DB) Run(ctx context.Context, b *Batch) error + func (db *DB) Scan(ctx context.Context, begin, end interface{}, maxRows int64) ([]KeyValue, error) + func (db *DB) Txn(ctx context.Context, retryable func(context.Context, *Txn) error) error + func (db *DB) WriteBatch(ctx context.Context, begin, end interface{}, data []byte) error + type DBContext struct + UserPriority roachpb.UserPriority + func DefaultDBContext() DBContext + type KeyValue struct + Key roachpb.Key + Value *roachpb.Value + func (kv *KeyValue) Exists() bool + func (kv *KeyValue) PrettyValue() string + func (kv *KeyValue) String() string + func (kv *KeyValue) ValueBytes() []byte + func (kv *KeyValue) ValueInt() int64 + func (kv *KeyValue) ValueProto(msg proto.Message) error + type Lease struct + type LeaseManager struct + func NewLeaseManager(db *DB, clock *hlc.Clock, options LeaseManagerOptions) *LeaseManager + func (m *LeaseManager) AcquireLease(ctx context.Context, key roachpb.Key) (*Lease, error) + func (m *LeaseManager) ExtendLease(ctx context.Context, l *Lease) error + func (m *LeaseManager) ReleaseLease(ctx context.Context, l *Lease) error + func (m *LeaseManager) TimeRemaining(l *Lease) time.Duration + type LeaseManagerOptions struct + ClientID string + LeaseDuration time.Duration + type LeaseNotAvailableError struct + func (e *LeaseNotAvailableError) Error() string + type LeaseVal struct + Expiration cockroach_util_hlc.Timestamp + Owner string + func (*LeaseVal) Descriptor() ([]byte, []int) + func (*LeaseVal) ProtoMessage() + func (m *LeaseVal) Marshal() (dAtA []byte, err error) + func (m *LeaseVal) MarshalTo(dAtA []byte) (int, error) + func (m *LeaseVal) Reset() + func (m *LeaseVal) Size() (n int) + func (m *LeaseVal) String() string + func (m *LeaseVal) Unmarshal(dAtA []byte) error + type Result struct + Err error + Keys []roachpb.Key + RangeInfos []roachpb.RangeInfo + ResumeSpan roachpb.Span + Rows []KeyValue + func (r Result) String() string + type Sender interface + Send func(context.Context, roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) + func NewSender(conn *grpc.ClientConn) Sender + func Wrap(sender Sender, f func(roachpb.BatchRequest) roachpb.BatchRequest) Sender + type SenderFunc func(context.Context, roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) + func (f SenderFunc) Send(ctx context.Context, ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) + type SenderWithDistSQLBackdoor interface + GetTxnState func(txnID uuid.UUID) (roachpb.Transaction, bool) + type Txn struct + func NewTxn(db *DB, gatewayNodeID roachpb.NodeID) *Txn + func NewTxnWithProto(db *DB, gatewayNodeID roachpb.NodeID, proto roachpb.Transaction) *Txn + func (txn *Txn) AcceptUnhandledRetryableErrors() + func (txn *Txn) AddCommitTrigger(trigger func()) + func (txn *Txn) AnchorKey() []byte + func (txn *Txn) CPut(ctx context.Context, key, value, expValue interface{}) error + func (txn *Txn) CleanupOnError(ctx context.Context, err error) + func (txn *Txn) CommandCount() int + func (txn *Txn) Commit(ctx context.Context) error + func (txn *Txn) CommitInBatch(ctx context.Context, b *Batch) error + func (txn *Txn) CommitOrCleanup(ctx context.Context) error + func (txn *Txn) DebugName() string + func (txn *Txn) Del(ctx context.Context, keys ...interface{}) error + func (txn *Txn) DelRange(ctx context.Context, begin, end interface{}) error + func (txn *Txn) Exec(ctx context.Context, opt TxnExecOptions, ...) (err error) + func (txn *Txn) GenerateForcedRetryableError(msg string) error + func (txn *Txn) Get(ctx context.Context, key interface{}) (KeyValue, error) + func (txn *Txn) GetProto(ctx context.Context, key interface{}, msg proto.Message) error + func (txn *Txn) ID() uuid.UUID + func (txn *Txn) Inc(ctx context.Context, key interface{}, value int64) (KeyValue, error) + func (txn *Txn) InitPut(ctx context.Context, key, value interface{}, failOnTombstones bool) error + func (txn *Txn) InternalSetPriority(priority int32) + func (txn *Txn) IsAborted() bool + func (txn *Txn) IsCommitted() bool + func (txn *Txn) IsFinalized() bool + func (txn *Txn) IsRetryableErrMeantForTxn(retryErr roachpb.HandledRetryableTxnError) bool + func (txn *Txn) IsSerializableRestart() bool + func (txn *Txn) Isolation() enginepb.IsolationType + func (txn *Txn) NewBatch() *Batch + func (txn *Txn) OrigTimestamp() hlc.Timestamp + func (txn *Txn) PrepareForRetry(ctx context.Context, err error) + func (txn *Txn) Proto() *roachpb.Transaction + func (txn *Txn) Put(ctx context.Context, key, value interface{}) error + func (txn *Txn) ResetDeadline() + func (txn *Txn) ReverseScan(ctx context.Context, begin, end interface{}, maxRows int64) ([]KeyValue, error) + func (txn *Txn) Rollback(ctx context.Context) error + func (txn *Txn) Run(ctx context.Context, b *Batch) error + func (txn *Txn) Scan(ctx context.Context, begin, end interface{}, maxRows int64) ([]KeyValue, error) + func (txn *Txn) Send(ctx context.Context, ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) + func (txn *Txn) SetDebugName(name string) + func (txn *Txn) SetFixedTimestamp(ctx context.Context, ts hlc.Timestamp) + func (txn *Txn) SetIsolation(isolation enginepb.IsolationType) error + func (txn *Txn) SetSystemConfigTrigger() error + func (txn *Txn) SetTxnAnchorKey(key roachpb.Key) error + func (txn *Txn) SetUserPriority(userPriority roachpb.UserPriority) error + func (txn *Txn) UpdateDeadlineMaybe(ctx context.Context, deadline hlc.Timestamp) bool + func (txn *Txn) UpdateStateOnRemoteRetryableErr(ctx context.Context, pErr roachpb.Error) + func (txn *Txn) UserPriority() roachpb.UserPriority + type TxnExecOptions struct + AutoCommit bool + AutoRetry bool Incompatible versions in this module v19.2.12+incompatible Jan 12, 2021