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

# Functions

GRPCTransportFactory is the default TransportFactory, using GRPC.
InitFactoryForLocalTestCluster initializes a TxnCoordSenderFactory that can be used with LocalTestCluster.
IsSendError returns true if err is a sendError.
MakeRangeIterator creates a new RangeIterator.
MakeTxnMetrics returns a TxnMetrics struct that contains metrics whose windowed portions retain data for approximately histogramWindow.
NewBatchTruncationHelper returns a new BatchTruncationHelper for the given requests.
NewCloseStreamRequest returns a mux rangefeed request to close specified stream.
NewDistSender returns a batch.Sender instance which connects to the Cockroach cluster via the supplied gossip instance.
NewDistSenderCircuitBreakers creates new DistSender circuit breakers.
NewDistSenderForLocalTestCluster creates a DistSender for a LocalTestCluster.
NewReplicaSlice creates a ReplicaSlice from the replicas listed in the range descriptor and using gossip to lookup node descriptors.
NewTxnCoordSenderFactory creates a new TxnCoordSenderFactory.
SenderTransportFactory wraps a client.Sender for use as a KV Transport.
TestingWithBeforeSendRequest returns a test only option that invokes function before sending rangefeed request.
TestingWithMuxRangeFeedRequestSenderCapture returns a test only option to specify a callback that will be invoked when mux establishes connection to a node.
TestingWithOnRangefeedEvent returns a test only option to modify rangefeed event.
TestingWithRangeFeedMetrics returns a test only option to specify metrics to use while executing this rangefeed.
TestNewSendError creates a new sendError for the purpose of unit tests.
WithDiff turns on "diff" option for the rangefeed.
WithFiltering opts into rangefeed filtering.
WithMatchingOriginIDs opts the rangefeed into emitting events originally written by clusters with the assoicated origin IDs during logical data replication.
WithRangeObserver is called when the rangefeed starts with a function that can be used to iterate over all the ranges.
WithSystemTablePriority is used for system-internal rangefeeds, it uses a higher admission priority during catch up scans.

# Constants

AllExtantReplicas prescribes that the ReplicaSlice should include all replicas that are not LEARNERs, VOTER_OUTGOING, or VOTER_DEMOTING_{LEARNER/NON_VOTER}.
Ascending means Next() will advance towards keys that compare higher.
The default scaling factor for the number of async ops per vCPU.
Descending means Next() will advance towards keys that compare lower.
DistSenderCircuitBreakersAllRanges indicates that we should trip circuit breakers for any replica that experiences a failure or a stall, regardless of the range it belongs to.
DistSenderCircuitBreakersLivenessRangeOnly indicates we should only trip circuit breakers if a replica belonging to node liveness experiences a failure or stall.
DistSenderCircuitBreakersNoRanges indicates we should never trip circuit breakers.
The minimum number of recommended vCPUs.
OnlyPotentialLeaseholders prescribes that the ReplicaSlice should include only replicas that are allowed to be leaseholders (i.e.
OpTxnCoordSender represents a txn coordinator send operation.
RangeLookupPrefetchCount is the maximum number of range descriptors to prefetch during range lookups.

# Variables

CanSendToFollower is used by the DistSender to determine if it needs to look up the current lease holder for a request.
ErrSavepointOperationInErrorTxn is reported when CreateSavepoint() or ReleaseSavepoint() is called over a txn currently in error.
FollowerReadsUnhealthy controls whether we will send follower reads to nodes that are not considered healthy.
KeepRefreshSpansOnSavepointRollback is a boolean flag that, when enabled, ensures that all refresh spans accumulated since a savepoint was created are kept even after the savepoint is rolled back.
MaxTxnRefreshSpansBytes is a threshold in bytes for refresh spans stored on the coordinator during the lifetime of a transaction.
PipelinedWritesEnabled is the kv.transaction.write_pipelining.enabled cluster setting.
RandomizedTxnAnchorKeyEnabled dictates whether a transactions anchor key is chosen at random from all keys being locked in its first locking batch; otherwise, it's set to the first ever key that's locked by the transaction.
TestingMakeRangeFeedMetrics exposes makeDistSenderRangeFeedMetrics for test use.
TrackedWritesMaxSize is a byte threshold for the tracking of writes performed a single transaction.

# Structs

BatchTruncationHelper is a utility struct that helps with truncating requests to range boundaries as well as figuring out the next key to seek to for the range iterator.
ClientTestingKnobs contains testing options that dictate the behavior of the key-value client.
A DistSender provides methods to access Cockroach's monolithic, distributed key value store.
DistSenderCircuitBreakerMetrics is the set of circuit breaker metrics.
DistSenderCircuitBreakers manages circuit breakers for replicas.
DistSenderConfig holds configuration and auxiliary objects that can be passed to NewDistSender.
DistSenderMetrics is the set of metrics for a given distributed sender.
DistSenderRangeFeedMetrics is a set of rangefeed specific metrics.
PartialRangeFeed structure describes the state of currently executing partial range feed.
RangeFeedContext is the structure containing arguments passed to RangeFeed call.
RangeFeedMessage is a type that encapsulates the kvpb.RangeFeedEvent.
A RangeIterator provides a mechanism for iterating over all ranges in a key span.
ReplicaCircuitBreaker is a circuit breaker for an individual replica.
ReplicaInfo extends the Replica structure with the associated node Locality information.
A SendOptions structure describes the algorithm for sending RPCs to one or more replicas, depending on error conditions and how many successful responses are required.
SpanTimePair is a pair of span along with its starting time.
A TxnCoordSender is the production implementation of kv.TxnSender.
TxnCoordSenderFactory implements kv.TxnSenderFactory.
TxnCoordSenderFactoryConfig holds configuration and auxiliary objects that can be passed to NewTxnCoordSenderFactory.
TxnMetrics holds all metrics relating to KV transactions.

# Interfaces

FirstRangeProvider is capable of providing DistSender with the descriptor of the first range in the cluster and notifying the DistSender when the first range in the cluster has changed.
RangeFeedOption configures a RangeFeed.
Transport objects can send RPCs to one or more replicas of a range.

# Type aliases

ActiveRangeFeedIterFn is an iterator function which is passed PartialRangeFeed structure.
DistSenderCircuitBreakersMode controls if and to what level we trip circuit breakers for replicas in the DistSender when they are failed or stalled.
ForEachRangeFn is used to execute `fn` over each range in a rangefeed.
HealthFunc returns true if the node should be considered alive.
A LatencyFunc returns the latency from this node to a remote node and a bool indicating whether the latency is valid.
A RangeObserver is a function that observes the ranges in a rangefeed by polling fn.
A ReplicaSlice is a slice of ReplicaInfo.
ReplicaSliceFilter controls which kinds of replicas are to be included in the slice for routing BatchRequests to.
ScanDirection determines the semantics of RangeIterator.Next() and RangeIterator.NeedAnother().
TransportFactory encapsulates all interaction with the RPC subsystem, allowing it to be mocked out for testing.