package
20.1.0-beta.2+incompatible
Repository: https://github.com/jbowens/cockroach.git
Documentation: pkg.go.dev

# Packages

Package requestbatcher is a library to enable easy batching of roachpb requests.

# Functions

ChangeReplicasCanMixAddAndRemoveContext convinces (*client.DB).AdminChangeReplicas that the caller is aware that 19.1 nodes don't know how to handle requests that mix additions and removals; 19.2+ binaries understand this due to the work done in the context of atomic replication changes.
DefaultDBContext returns (a copy of) the default options for NewDBWithContext.
IncrementValRetryable increments a key's value by a specified amount and returns the new value.
MakeMockTxnSenderFactory creates a MockTxnSenderFactory from a sender function that receives the transaction in addition to the request.
NewDB returns a new DB.
NewDBWithContext returns a new DB with the given parameters.
NewLeafTxn instantiates a new leaf transaction.
NewMockTransactionalSender creates a MockTransactionalSender.
NewTxn returns a new RootTxn.
NewTxnFromProto is like NewTxn but assumes the Transaction object is already initialized.
NewTxnWithSteppingEnabled is like NewTxn but suitable for use by SQL.
RangeLookup is used to look up RangeDescriptors - a RangeDescriptor is a metadata structure which describes the key range and replica locations of a distinct range in the cluster.
SendWrapped is identical to SendWrappedWith with a zero header.
SendWrappedWith is a convenience function which wraps the request in a batch and sends it via the provided Sender and headers.
TestingIsRangeLookup returns if the provided BatchRequest looks like a single RangeLookup scan.
TestingIsRangeLookupRequest returns if the provided Request looks like a single RangeLookup scan.
Wrap returns a Sender which applies the given function before delegating to the supplied Sender.

# Constants

AnyTxnStatus means GetMeta() will return the info without checking the txn's status.
LeafTxn specifies this sender is for one of potentially many distributed client transactions.
OnlyPending means GetMeta() will return an error if the transaction is not in the pending state.
RootTxn specifies this sender is the root transaction, and is responsible for aggregating all transactional state and finalizing the transaction.
SteppingDisabled is the default mode, where each read can observe the latest write.
SteppingEnabled can be set to indicate that read operations operate on a snapshot taken at the latest Step() invocation.

# Structs

AutoCommitError wraps a non-retryable error coming from auto-commit.
Batch provides for the parallel execution of a number of database operations.
CrossRangeTxnWrapperSender is a Sender whose purpose is to wrap non-transactional requests that span ranges into a transaction so they can execute atomically.
DB is a database handle to a single cockroach cluster.
DBContext contains configuration parameters for DB.
KeyValue represents a single key/value pair.
MockTransactionalSender allows a function to be used as a TxnSender.
MockTxnSenderFactory is a TxnSenderFactory producing MockTxnSenders.
Result holds the result for a single DB or Txn operation (e.g.
Txn is an in-progress distributed database transaction.

# Interfaces

SavepointToken represents a savepoint.
Sender is implemented by modules throughout the crdb stack, on both the "client" and the "server", involved in passing along and ultimately evaluating requests (batches).
TxnSender is the interface used to call into a CockroachDB instance when sending transactional requests.
TxnSenderFactory is the interface used to create new instances of TxnSender.

# Type aliases

NonTransactionalFactoryFunc is a TxnSenderFactory that cannot, in fact, create any transactional senders, only non-transactional ones.
SenderFunc is an adapter to allow the use of ordinary functions as Senders.
SteppingMode is the argument type to ConfigureStepping.
TxnStatusOpt represents options for TxnSender.GetMeta().
TxnType specifies whether a transaction is the root (parent) transaction, or a leaf (child) in a tree of client.Txns, as is used in a DistSQL flow.