package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

Package kvpbmock is a generated GoMock package.

# Functions

AppliesTimestampCache returns whether the command is a write that applies the timestamp cache (and closed timestamp), possibly pushing its write timestamp into the future to avoid re-writing history.
BulkOpSummaryID returns the key within a BulkOpSummary's EntryCounts map for the given table and index ID.
BypassesReplicaCircuitBreaker returns whether the command bypasses the per-Replica circuit breakers.
CanBackpressure returns whether the command can be backpressured when waiting for a Range to split after it has grown too large.
CanParallelCommit returns true iff the command can be part of a batch that is committed in parallel.
CanPipeline returns true iff the command can be pipelined.
CanSkipLocked returns whether the command can evaluate under the SkipLocked wait policy.
CombineResponses attempts to combine the two provided responses.
CreateRequest creates an empty Request for each of the Method types.
ErrorUnexpectedlySet creates a string to panic with when a response (typically a kvpb.BatchResponse) unexpectedly has Error set in its response header.
ErrPriority computes the priority of the given error.
IsDecommissionedStatusErr returns true if the error wraps a gRPC status error with a NodeDecommissionedError detail, i.e.
IsIntentWrite returns true if the request produces write intents at the request's sequence number when used within a transaction.
IsLocking returns true if the request acquires locks when used within a transaction.
IsRange returns true if the command is range-based and must include a start and an end key.
IsRangeNotFoundError returns true if err contains a *RangeNotFoundError.
IsReadOnly returns true iff the request is read-only.
IsTransactional returns true if the request may be part of a transaction.
LockingDurability returns the durability of the locks acquired by the request.
LockSpanIterate calls the passed function with the keys or key spans of the transactional locks acquired by the request.
MakeReplicationChanges returns a slice of changes of the given type with an item for each target.
MaybeWrapReplicaCorruptionError wraps a passed error as a replica corruption error unless it matches the error in the passed context, which would suggest the whole operation was cancelled due to the latter rather than indicating a fault which implies replica corruption.
NeedsRefresh returns whether the command must be refreshed in order to avoid client-side retries on serializable transactions.
NewAmbiguousResultError returns an AmbiguousResultError wrapping (via errors.Wrapper) the supplied error.
NewAmbiguousResultErrorf initializes a new AmbiguousResultError with an explanatory format and set of arguments.
NewConditionalPut returns a Request initialized to put value at key if the existing value at key equals expValue.
NewConditionalPutInline returns a Request initialized to put an inline value at key if the existing value at key equals expValue.
NewDecommissionedStatusErrorf returns a GRPC status with the given error code and formatted message whose detail is a *NodeDecommissionedError.
NewDelete returns a Request initialized to delete the value at key.
NewDeleteRange returns a Request initialized to delete the values in the given key range (excluding the endpoint).
NewError creates an Error from the given error.
NewErrorf creates an Error from the given error message.
NewErrorWithTxn creates an Error from the given error and a transaction.
NewGet returns a Request initialized to get the value at key.
NewIncrement returns a Request initialized to increment the value at key by increment.
NewIndeterminateCommitError initializes a new IndeterminateCommitError.
NewIntentMissingError creates a new IntentMissingError.
NewKeyCollisionError constructs a KeyCollisionError, copying its input.
NewLockingGet returns a Request initialized to get the value at key.
NewLockingReverseScan returns a Request initialized to reverse scan from end.
NewLockingScan returns a Request initialized to scan from start to end keys.
NewMinTimestampBoundUnsatisfiableError initializes a new MinTimestampBoundUnsatisfiableError.
NewNodeDescNotFoundError initializes a new DescNotFoundError for a missing node descriptor.
NewNotLeaseHolderError returns a NotLeaseHolderError initialized with the replica for the holder (if any) of the given lease.
NewNotLeaseHolderErrorWithSpeculativeLease returns a NotLeaseHolderError initialized with a speculative lease pointing to the supplied replica.
NewOptimisticEvalConflictsError initializes a new OptimisticEvalConflictsError.
NewProxyFailedError returns an ProxyFailedError wrapping (via errors.Wrapper) the supplied error.
NewPut returns a Request initialized to put the value at key.
NewPutInline returns a Request initialized to put the value at key using an inline value.
NewRangeFeedRetryError initializes a new RangeFeedRetryError.
NewRangeKeyMismatchError initializes a new RangeKeyMismatchError.
NewRangeKeyMismatchErrorWithCTPolicy initializes a new RangeKeyMismatchError.
NewRangeNotFoundError initializes a new RangeNotFoundError for the given RangeID and, optionally, a StoreID.
NewReadWithinUncertaintyIntervalError creates a new uncertainty retry error.
NewRefreshFailedError initializes a new RefreshFailedError.
NewReplicaCorruptionError creates a new error indicating a corrupt replica.
NewReplicaTooOldError initializes a new ReplicaTooOldError.
NewReplicaUnavailableError initializes a new *ReplicaUnavailableError.
NewReverseScan returns a Request initialized to reverse scan from end.
NewScan returns a Request initialized to scan from start to end keys.
NewStoreDescNotFoundError initializes a new DescNotFoundError for a missing store descriptor.
NewStoreNotFoundError initializes a new StoreNotFoundError.
NewTransactionAbortedError initializes a new TransactionAbortedError.
NewTransactionPushError initializes a new TransactionPushError.
NewTransactionRetryError initializes a new TransactionRetryError.
NewTransactionRetryWithProtoRefreshError initializes a new TransactionRetryWithProtoRefreshError.
NewTransactionStatusError initializes a new TransactionStatusError with the given message and reason.
NewWriteTooOldError creates a new write too old error.
PrepareTransactionForRetry returns a new Transaction to be used for retrying the original Transaction.
ReplicationChangesForDemotion returns the replication changes that correspond to the demotion of a voter to a non-voter.
ReplicationChangesForPromotion returns the replication changes that correspond to the promotion of a non-voter to a voter.
RequestHeaderFromSpan creates a RequestHeader addressed at the specified key span.
ResponseKeyIterate calls the passed function with the keys returned in the provided request's response.
TransactionRefreshTimestamp returns whether the supplied error is a retry error that can be discarded if the transaction in the error is refreshed.
TruncatedRequestsString formats a slice of RequestUnions for printing, limited to maxBytes bytes.
UpdatesTimestampCache returns whether the command must update the timestamp cache in order to set a low water mark for the timestamp at which mutations to overlapping key(s) can write such that they don't re-write history.
UpdatesTimestampCacheOnError returns whether the command must update the timestamp cache even on error, as in some cases the data which was read is returned (e.g.
WithConflictingTxn is used to annotate a retry error with the conflicting transaction metadata (optional).

# Constants

AddSSTable links a file into pebble.
AdminChangeReplicas is called to add or remove replicas for a range.
AdminMerge is called to coordinate a merge of two adjacent ranges.
AdminRelocateRange is called to relocate the replicas for a range onto a specified list of stores.
AdminScatter moves replicas and leaseholders for a selection of ranges.
AdminSplit is called to coordinate a split of a range.
AdminTransferLease is called to initiate a range lease transfer.
AdminUnsplit is called to remove the sticky bit of a manually split range.
AdminVerifyProtectedTimestamp determines whether the specified protection record will be respected by this Range.
This lists all ErrorDetail types.
Barrier is a command that ensures all conflicting in-flight operations on this range before this command have finished by the time it returns.
This lists all ErrorDetail types.
BestEffort makes a best-effort attempt to hold any locks acquired until commit time.
CheckConsistency verifies the consistency of all ranges falling within a key span.
ClearRange removes all values (including all of their versions) for keys which fall between args.RequestHeader.Key and args.RequestHeader.EndKey, with the latter endpoint excluded.
CommunicationErrType indicates a gRPC error; this is not an ErrorDetail.
ComputeChecksum starts a checksum computation over a replica snapshot.
ConditionalPut sets the value for a key if the existing value matches the value specified in the request.
This lists all ErrorDetail types.
Delete creates a tombstone value for the specified key, indicating the value has been deleted.
DeleteRange creates tombstone values for keys which fall between args.RequestHeader.Key and args.RequestHeader.EndKey, with the latter endpoint excluded.
EndTxn either commits or aborts an ongoing transaction.
ErrorScoreNonRetriable indicates that the transaction performed an operation that does not warrant a retry.
ErrorScoreTxnAbort indicates that the transaction is aborted.
ErrorScoreTxnRestart indicates that the transaction should be restarted with an incremented epoch.
ErrorScoreUnambiguousError is used for errors which are known to return a transaction reflecting the highest timestamp of any intent that was written.
Export dumps a keyrange into files.
ForShare indicates any keys returned will be locked for share; this means concurrent requests will be able to read the key or lock it ForShare themselves.
ForUpdate indicates any keys returned will be locked for update; the transaction that holds the lock will have exclusive write access to the key.
GC garbage collects values based on expired timestamps for a list of keys in a range.
Get fetches the value for a key from the KV map, respecting a possibly historical timestamp.
GuaranteedDurability guarantees that if the transaction commits then any locks acquired by it will be held until commit time.
HeartbeatTxn sends a periodic heartbeat to extant transaction rows to indicate the client is still alive and the transaction should not be considered abandoned.
Increment increments the value at the specified key.
This lists all ErrorDetail types.
InitPut sets the value for a key if the key doesn't exist.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
InternalErrType indicates a pErr that doesn't contain a recognized error detail.
Invalid is meant to be used in places where supplying lock durability does not make sense.
This lists all ErrorDetail types.
IsSpanEmpty is a non-transaction read request used to determine whether a span contains any keys whatsoever (garbage or otherwise).
LeaseInfo returns information about a range's lease.
This lists all ErrorDetail types.
LinkExternallSSTable links an external sst into pebble.
This lists all ErrorDetail types.
MaxMethod is the maximum method.
Merge merges a given value into the specified key.
This lists all ErrorDetail types.
Migrate updates the range state to conform to a specified cluster version.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
NonLocking indicates any keys returned will not be locked.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
NumMethods represents the total number of API methods.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
Probe is a noop write request used to test the ability to make progress at the replication layer.
This lists all ErrorDetail types.
PushTxn attempts to resolve read or write conflicts between transactions.
Put sets the value for a key at the specified timestamp.
QueryIntent checks whether the specified intent exists.
QueryLocks requests the current state of concurrency control's lock table.
QueryResolvedTimestamp requests the resolved timestamp of the key span it is issued over.
QueryTxn fetches the current state of the designated transaction.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
RangeStats returns the MVCC statistics for a range.
This lists all ErrorDetail types.
RecomputeStats applies a delta to a Range's MVCCStats to fix computational errors.
RecoverTxn attempts to recover an abandoned STAGING transaction.
Refresh verifies no writes to a key have occurred since the transaction orig timestamp and sets a new entry in the timestamp cache at the current transaction timestamp.
This lists all ErrorDetail types.
RefreshRange verifies no writes have occurred to a span of keys since the transaction orig timestamp and sets a new span in the timestamp cache at the current transaction timestamp.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
RequestLease requests a range lease for a replica.
ResolveIntent resolves existing write intents for a key.
ResolveIntentRange resolves existing write intents for a key range.
ReverseScan fetches the values for all keys which fall between args.RequestHeader.Key and args.RequestHeader.EndKey, with the latter endpoint excluded.
RevertRange removes all versions of values more recent than the TargetTime for keys which fall between args.RequestHeader.Key and args.RequestHeader.EndKey, with the latter endpoint excluded.
Scan fetches the values for all keys which fall between args.RequestHeader.Key and args.RequestHeader.EndKey, with the latter endpoint excluded.
This lists all ErrorDetail types.
Subsume freezes a range for merging with its left-hand neighbor.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
TransferLease transfers the range lease from a lease holder to a new one.
TruncateLog discards a prefix of the raft log.
This lists all ErrorDetail types.
This lists all ErrorDetail types.
WriteBatch applies the operations encoded in a BatchRepr.
This lists all ErrorDetail types.
This lists all ErrorDetail types.

# Variables

DeserializeColumnarBatchesFromArrow takes in a slice of serialized (in the Apache Arrow format) coldata.Batch'es and deserializes them.

# Structs

DescNotFoundError is reported when a descriptor is missing.
KeyCollisionError represents a failed attempt to ingest the same key twice.
MissingRecordError is reported when a record is missing.

# Interfaces

ClientVisibleAmbiguousError is to be implemented by errors visible by layers above and that indicate uncertainty.
ClientVisibleRetryError is to be implemented by errors visible by layers above and that can be handled by retrying the transaction.
ErrorDetailInterface is an interface for each error detail.
LockingReadRequest is an interface used to expose the key-level locking strength of a read-only request.
Printer is an interface that lets us use what's common between the errors.Printer interface and redact.SafePrinter so we can write functions that both SafeFormatError and SafeFormat can share.
RangeFeedEventProducer is an adapter for receiving rangefeed events with either the legacy RangeFeed RPC, or the MuxRangeFeed RPC.
RangeFeedEventSink is an interface for sending a single rangefeed event.
Request is an interface for RPC requests.
Response is an interface for RPC responses.
RetryErrOption is used to annotate optional fields in retry related errors.
SafeFormatterRequest is an optional extension interface used to allow request to do custom formatting.
SizedWriteRequest is an interface used to expose the number of bytes a request might write.

# Type aliases

ErrorDetailType identifies the type of KV error.
ErrorPriority is used to rank errors such that the "best" one is chosen to be presented as the batch result when a batch is split up and observes multiple errors.
KeyLockingDurabilityType is used to describe the durability goals of per-key locks acquired by locking Get, Scan, and ReverseScan requests.
KeyLockingStrengthType is used to describe per-key locking strengths associated with Get, Scan, and ReverseScan requests.
LeaseAppliedIndex is attached to every Raft message and is used for replay protection.
Method is the enumerated type for methods.
RaftIndex represents the term of a raft message.
RaftTerm represents the term of a raft message.
ReplicationChanges is a slice of ReplicationChange.