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

# Functions

AsIntents takes a transaction and a slice of keys and returns it as a slice of intent-strength locks.
AsLocks casts a slice of Intents to a slice of Locks.
CheckCanReceiveLease checks whether `wouldbeLeaseholder` can receive a lease.
ClientTenantFromContext returns the ID of the tenant that's the client of the current RPC, if that infomation was put in the ctx by ContextWithClientTenant.
ContextWithClientTenant creates a new context with information about the tenant that's the client of an RPC.
ContextWithoutClientTenant removes the tenant information from the context.
Empty returns true if `target` is an empty replication target.
EpochAndLeaderLeaseType returns a list of {epcoh, leader} lease types.
ExpirationAndLeaderLeaseType returns a list of {expiration, leader} lease types.
IsSystemTenantID returns whether the provided ID corresponds to that of the system tenant.
IsSystemTenantName returns true if the provided tenantName corresponds to that of the system tenant.
MakeIntent makes an intent-strength lock with the given txn and key.
MakeLeaseInfo creates a LeaseInfo with the given current and next leases.
MakeLock makes a lock with the given txn, key, and strength.
MakeLockAcquisition makes a lock acquisition message from the given txn, key, durability level, and lock strength.
MakeLockUpdate makes a lock update from the given txn and span.
MakePriority generates a random priority value, biased by the specified userPriority.
MakeReplicaSet creates a ReplicaSet wrapper from a raw slice of individual descriptors.
MakeTenantID constructs a new TenantID from the provided uint64.
MakeTransaction creates a new transaction.
MakeValueFromBytes returns a value with bytes and tag set.
MakeValueFromBytesAndTimestamp returns a value with bytes, timestamp and tag set.
MakeValueFromString returns a value with bytes and tag set.
MatchesConstraint return whether the given attributes and locality tags match the constraint's spec.
MergeSpans sorts the incoming spans and merges overlapping spans.
MustMakeTenantID constructs a new TenantID from the provided uint64.
MustParseVersion calls ParseVersion and panics on error.
NewAllTenantKeyspaceTargetsSetTargetType returns a read-only system span config target type that encompasses all targets that have been set on specific tenant keyspaces.
NewEntireKeyspaceTargetType returns a system span config target type that targets the entire keyspace.
NewRangeDescriptor returns a RangeDescriptor populated from the input.
NewSpecificTenantKeyspaceTargetType returns a system span config target type that the given tenant ID's keyspace.
ParseVersion parses a Version from a string of one of the forms: - "<major>.<minor>" - "<major>.<minor>-upgrading-to-<nextmajor>.<nextminor>-step-<internal>" - "<major>.<minor>-<internal>" (older version of the above) We don't use the Patch component, so it is always zero.
PercentilesFromData derives percentiles from a slice of data points.
SubtractSpans subtracts the subspans covered by a set of non-overlapping spans from another set of non-overlapping spans.
TenantIDFromString parses a tenant ID contained within a string.
TestingAllLeaseTypes returns a list of all lease types to test against.
TestingDatabaseSystemSpanConfig exports the span config expected to be installed on system database for testing purposes.
TestingDefaultSpanConfig exports the default span config for testing purposes.
TestingDefaultSystemSpanConfiguration exports the default span config that applies to spanconfig.SystemTargets for testing purposes.
TestingSystemSpanConfig exports the system span config for testing purposes.

# Constants

AllowQueryToBeForwardedToDifferentNode specifies that, if the current node doesn't have a voter replica, the lease info can come from a different node.
LeaseEpoch allows range operations while the node liveness epoch is equal to the lease epoch.
LeaseExpiration allows range operations while the wall clock is within the expiration timestamp.
LeaseLeader allows range operations while the replica is guaranteed to be the range's raft leader.
LeaseNone specifies no lease, to be used as a default value.
LocalMaxByte is the end of the local key range.
MaxDiversityScore is the largest possible diversity score, indicating that two localities are as different from each other as possible.
MaxUserPriority is the maximum allowed user priority.
MinUserPriority is the minimum allowed user priority.
NormalUserPriority is set to 1, meaning ops run through the database are all given equal weight when a random priority is chosen.
PrevishKeyLength is a reasonable key length to use for Key.Prevish(), typically when peeking to the left of a known key.
QueryLocalNodeOnly specifies that an error should be returned if the node is not able to serve the lease query (because it doesn't have a voting replica).
SpanOverhead is the overhead of Span in bytes.
SpansOverhead is the overhead of Spans in bytes.
UnspecifiedUserPriority means NormalUserPriority.
VersionMajorDevOffset is an offset we apply to major version numbers during development; see clusterversion.DevOffset for more information.

# Variables

DefaultLocationInformation is used to populate the system.locations table.
ErrInvalidTenantID is returned when a function encounters tenant ID 0.
ErrReplicaCannotHoldLease can be returned from CheckCanReceiveLease.
ErrReplicaNotFound can be returned from CheckCanReceiveLease.
KeyMax is a maximum key value which sorts after all other keys.
KeyMin is a minimum key value which sorts before all other keys.
LocalMax is the end of the local key range.
LocalPrefix is the prefix for all local keys.
MaxTenantID is the maximum ID of a (non-system) tenant in a multi-tenant cluster.
MinTenantID is the minimum ID of a (non-system) tenant in a multi-tenant cluster.
PrettyPrintKey prints a key in human readable format.
PrettyPrintRange prints a key range in human readable format.
RKeyMax is a maximum key value which sorts after all other keys.
RKeyMin is a minimum key value which sorts before all other keys.
SafeFormatKey is the generalized redaction function used to redact pretty printed keys.
SystemTenantID is the ID associated with the tenant that manages a cluster.
TenantOne is a special tenant ID, associated the numeric ID 1, which for legacy compatibility reasons stores its tables without a tenant prefix.

# Structs

LeaseInfo describes a range's current and potentially future lease.
RangeStatusReport contains info about a range's replication status.
ReleaseSeries is just the major.minor part of a Version.
ReplicaSet is a set of replicas, usually the nodes/stores on which replicas of a range are stored.
RSpan is a key range with an inclusive start RKey and an exclusive end RKey.
A SpanGroup is a specialization of interval.RangeGroup which deals with key spans.

# Type aliases

IndexID is same as descpb.IndexID.
Intent is an intent-strength lock.
Key is a custom type for a byte string in proto messages which refer to Cockroach keys.
KeyValueByKey implements sorting of a slice of KeyValues by key.
LeaseInfoOpt enumerates options for GetRangeLease.
LeaseSequence is a custom type for a lease sequence number.
LeaseType describes the type of lease.
NodeID is a custom type for a cockroach node ID.
NodeIDSlice implements sort.Interface.
RangeGeneration is a custom type for a range generation.
A RangeID is a unique ID associated to a Raft consensus group.
ReplicaID is a custom type for a range replica ID.
RKey denotes a Key whose local addressing has been accounted for.
SequencedWriteBySeq implements sorting of a slice of SequencedWrites by sequence number.
Spans is a slice of spans.
StoreID is a custom type for a cockroach store ID.
StoreIDSlice implements sort.Interface.
TableID is same as descpb.ID.
TenantName is a unique name associated with a tenant in a multi-tenant cluster.
TenantNameContainer is a shared object between the server controller and the tenant server that holds a reference to the current name of the tenant and updates it if needed.
UserPriority is a custom type for transaction's user priority.