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

# Functions

AbortSpanKey returns a range-local key by Range ID for an AbortSpan entry, with detail specified by encoding the supplied transaction ID.
Addr returns the address for the key, used to lookup the range containing the key.
AddrUpperBound returns the address of an (exclusive) EndKey, used to lookup ranges containing the keys strictly smaller than that key.
DecodeAbortSpanKey decodes the provided AbortSpan entry, returning the transaction ID.
DecodeFamilyKey returns the family ID in the given row key.
DecodeLockTableSingleKey decodes the single-key lock table key to return the key that was locked.
DecodeNodeTombstoneKey returns the NodeID for the node tombstone.
DecodeRaftLogKeyFromSuffix parses the suffix of a system-local key for a Raft log entry and returns the entry's log index.
DecodeRangeIDKey parses a local range ID key into range ID, infix, suffix, and detail.
DecodeRangeKey decodes the range key into range start key, suffix and optional detail (may be nil).
DecodeStoreCachedSettingsKey returns the setting's key of the cached settings kvs.
DecodeStoreKey returns the suffix and detail portions of a local store key.
DecodeStoreLivenessSupportForKey returns the node ID and store ID of a given localStoreLivenessSupportFor key.
DecodeStoreUnsafeReplicaRecoveryKey decodes uuid key used to create record key for unsafe replica recovery record.
DecodeTableIDIndexID decodes a table id followed by an index id from the provided key.
DecodeTenantPrefix determines the tenant ID from the key prefix, returning the remainder of the key (with the prefix removed) and the decoded tenant ID.
DeprecatedStoreClusterVersionKey returns a store-local key for the cluster version.
EnsureSafeSplitKey transforms an SQL table key such that it is a valid split key (i.e.
GetRowPrefixLength returns the length of the row prefix of the key.
GetTenantKeyParseFn returns a function that parses the relevant prefix of the tenant data into a roachpb.Key, returning the remainder and the key corresponding to the consumed prefix of 'input'.
InMeta1 returns true iff a key is in the meta1 range (which includes RKeyMin).
IsLocal performs a cheap check that returns true iff a range-local key is passed, that is, a key for which `Addr` would return a non-identical RKey (or a decoding error).
IsPseudoTableID returns true if id is in PseudoTableIDs.
LockTableSingleKey creates a key under which all single-key locks for the given key can be found.
LockTableSingleNextKey is equivalent to LockTableSingleKey(key.Next(), buf) but avoids an extra allocation in cases where key.Next() must allocate.
MakeFamilyKey returns the key for the family in the given row by appending to the passed key.
MakeRangeIDPrefix creates a range-local key prefix from rangeID for both replicated and unreplicated data.
MakeRangeIDPrefixBuf creates a new range ID prefix buf suitable for generating the various range ID local keys.
MakeRangeIDReplicatedPrefix creates a range-local key prefix from rangeID for all Raft replicated data.
MakeRangeIDUnreplicatedPrefix creates a range-local key prefix from rangeID for all unreplicated data.
MakeRangeKey creates a range-local key based on the range start key, metadata key suffix, and optional detail (e.g.
MakeRangeKeyPrefix creates a key prefix under which all range-local keys can be found.
MakeSQLCodec creates a new SQLCodec suitable for manipulating SQL keys.
MakeStoreKey creates a store-local key based on the metadata key suffix, and optional detail.
MakeTableIDIndexID returns the key for the table id and index id by appending to the passed key.
MakeTenantPrefix creates the key prefix associated with the specified tenant.
MakeTenantSpan creates the start/end key pair associated with the specified tenant.
MetaReverseScanBounds returns the range [start,end) within which the desired meta record can be found by means of a reverse engine scan.
MetaScanBounds returns the range [start,end) within which the desired meta record can be found by means of an engine scan.
MustAddr calls Addr and panics on errors.
MVCCRangeKeyGCKey returns a range local key protecting range tombstone mvcc stats calculations during range tombstone GC.
NewInvalidRangeMetaKeyError returns a new InvalidRangeMetaKeyError.
NodeLivenessKey returns the key for the node liveness record.
NodeStatusKey returns the key for accessing the node status for the specified node ID.
PrettyPrint prints the key in a human readable format, see TestPrettyPrint.
PrettyPrintRange pretty prints a compact representation of a key range.
QueueLastProcessedKey returns a range-local key for last processed timestamps for the named queue.
RaftHardStateKey returns a system-local key for a Raft HardState.
RaftLogKey returns a system-local key for a Raft log entry.
RaftLogKeyFromPrefix returns a system-local key for a Raft log entry, using the provided Raft log prefix.
RaftLogPrefix returns the system-local prefix shared by all Entries in a Raft log.
RaftReplicaIDKey returns a system-local key for a RaftReplicaID.
RaftTruncatedStateKey returns a system-local key for a RaftTruncatedState.
Range returns a key range encompassing the key ranges of all requests.
RangeAppliedStateKey returns a system-local key for the range applied state key.
RangeDescriptorKey returns a range-local key for the descriptor for the range with specified key.
RangeForceFlushKey returns a system-local key for the range force flush key.
RangeGCHintKey returns a system-local key for GC hint data.
RangeGCThresholdKey returns a system-local key for last used GC threshold on the user keyspace.
RangeLastReplicaGCTimestampKey returns a range-local key for the range's last replica GC timestamp.
RangeLeaseKey returns a system-local key for a range lease.
RangeMetaKey returns a range metadata (meta1, meta2) indexing key for the given key.
RangePriorReadSummaryKey returns a system-local key for a range's prior read summary.
RangeProbeKey returns a range-local key for probing.
RangeTombstoneKey returns a system-local key for a range tombstone.
RangeVersionKey returns a system-local for the range version.
ReplicatedSharedLocksTransactionLatchingKey returns a range-local key, based on the provided range ID and transaction ID, that all replicated shared locking requests from the specified transaction should use to serialize on latches.
RewriteKeyToTenantPrefix updates the passed key, potentially in-place, to ensure the Key has the passed tenant prefix, regardless of what prior tenant prefix, if any, they had before, and returns the updated Key.
RewriteSpanToTenantPrefix updates the passed Span, potentially in-place, to ensure the Key and EndKey have the passed tenant prefix, regardless of what prior tenant prefix, if any, they had before, and returns the updated Span.
SafeFormat is the generalized redaction function used to redact pretty-printed keys.
SpanAddr is like Addr, but it takes a Span instead of a single key and applies the key transformation to the start and end keys in the span, returning an RSpan.
StoreCachedSettingsKey returns a store-local key for store's cached settings.
StoreGossipKey returns a store-local key for the gossip bootstrap metadata.
StoreHLCUpperBoundKey returns the store-local key for storing an upper bound to the wall time used by HLC.
StoreIdentKey returns a store-local key for the store metadata.
StoreLastUpKey returns the key for the store's "last up" timestamp.
StoreLivenessRequesterMetaKey returns the key for the local store's Store Liveness requester metadata.
StoreLivenessSupporterMetaKey returns the key for the local store's Store Liveness supporter metadata.
StoreLivenessSupportForKey returns the key for the Store Liveness support by the local store for a given store identified by nodeID and storeID.
StoreLossOfQuorumRecoveryCleanupActionsKey is a key used for storing data for post recovery cleanup actions node would perform after restart if plan was applied.
StoreLossOfQuorumRecoveryStatusKey is a key used for storing results of loss of quorum recovery plan application.
StoreNodeTombstoneKey returns the key for storing a node tombstone for nodeID.
StoreUnsafeReplicaRecoveryKey creates a key for loss of quorum replica recovery entry.
StripIndexPrefix removes the index, table and tenant prefix from the provided key.
StripTablePrefix removes the table and tenant prefix from the provided key.
StripTenantPrefix removes the tenant prefix from the provided key.
TransactionKey returns a transaction key based on the provided transaction key and ID.
UserKey returns an ordinary key for the given range metadata (meta1, meta2) indexing key.
ValidateLockTableSingleKey is like DecodeLockTableSingleKey, except that it discards the decoded key.

# Constants

Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
DeprecatedMaxSystemConfigDescID is the maximum system descriptor ID that will be gossiped as part of the SystemConfig.
DeprecatedNamespaceTableID was the tableID for the system.namespace table for pre-20.1 clusters.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
DontQuoteRaw is the QuoteOpt used to indicate that we shouldn't use quotes when printing raw keys.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Reserved IDs for other system tables.
pseudo.
Various IDs used by the structured data layer.
MaxReservedDescID is the maximum descriptor ID in the reserved range.
pseudo.
Various IDs used by the structured data layer.
New NamespaceTableID for cluster version >= 20.1 Ensures that NamespaceTable does not get gossiped again.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
pseudo.
PublicSchemaIDForBackup is used temporarily to determine cases of PublicSchemaID being used for backup.
QuoteRaw is the QuoteOpt used to indicate that we should use quotes when printing raw keys.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
RootNamespaceID is the ID of the root namespace.
Various IDs used by the structured data layer.
SequenceColumnFamilyID is the ID of the column family on each special single-column, single-row sequence table.
SequenceIndexID is the ID of the single index on each special single-column, single-row sequence table.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
SystemDatabaseID and following are the database/table IDs for objects in the system span.
pseudo.
pseudo.
Various IDs used by the structured data layer.
pseudo.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
pseudo.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
Various IDs used by the structured data layer.
IDs for the important columns and indexes in the zones table live here to avoid introducing a dependency on sql/sqlbase throughout the codebase.

# Variables

BootstrapVersionKey is the key at which clusters bootstrapped with a version > 1.0 persist the version at which they were bootstrapped.
ClusterInitGracePeriodTimestamp is used for license enforcement.
ConstKeyOverrides provides overrides that define how to translate specific pretty-printed keys.
EverythingSpan is a span that covers everything.
ExcludeFromBackupSpan is a span that covers the keyspace that we exclude from full cluster backup and do not place protected timestamps on.
KeyDict drives the pretty-printing and pretty-scanning of the key space.
LocalAbortSpanSuffix is the suffix for AbortSpan entries.
LocalMax is the end of the local key range.
LocalPrefix is the prefix for all local keys.
LocalQueueLastProcessedSuffix is the suffix for replica queue state keys.
LocalRaftHardStateSuffix is the Suffix for the raft HardState.
LocalRaftLogSuffix is the suffix for the raft log.
LocalRaftReplicaIDSuffix is the suffix for the RaftReplicaID.
LocalRaftTruncatedStateSuffix is the suffix for the unreplicated RaftTruncatedState.
LocalRangeAppliedStateSuffix is the suffix for the range applied state key.
LocalRangeDescriptorSuffix is the suffix for keys storing range descriptors.
LocalRangeForceFlushSuffix is the suffix for the range force flush key.
LocalRangeGCHintSuffix is the suffix for the GC hint struct.
LocalRangeGCThresholdSuffix is the suffix for the GC threshold.
1.
LocalRangeIDReplicatedInfix is the post-Range ID specifier for all Raft replicated per-range data.
LocalRangeLastReplicaGCTimestampSuffix is the suffix for a range's last replica GC timestamp (for GC of old replicas).
LocalRangeLeaseSuffix is the suffix for a range lease.
5.
Constants for system-reserved keys in the KV map.
LocalRangeMVCCRangeKeyGCLockSuffix is the suffix for a lock obtained by range tombstone operations to ensure they don't overlap with GC requests while allowing point traffic to go through unobstructed.
3.
LocalRangePriorReadSummarySuffix is the suffix for a range's prior read summary.
LocalRangeProbeSuffix is the suffix for keys for probing.
LocalRangeStatsLegacySuffix is the suffix for range statistics.
LocalRangeTombstoneSuffix is the suffix for the range tombstone.
LocalRangeVersionSuffix is the suffix for the range version.
LocalReplicatedSharedLocksTransactionLatchingKeySuffix specifies the key suffix ("rsl" = replicated shared locks) for all replicated shared lock attempts, per transaction.
LocalStoreCachedSettingsKeyMax is the end of span of possible cached settings keys.
LocalStoreCachedSettingsKeyMin is the start of span of possible cached settings keys.
4.
LocalStoreUnsafeReplicaRecoveryKeyMax is the end of keyspace used to store loss of quorum recovery record entries.
LocalStoreUnsafeReplicaRecoveryKeyMin is the start of keyspace used to store loss of quorum recovery record entries.
LocalTransactionSuffix specifies the key suffix for transaction records.
LockTableSingleKeyEnd is the exclusive end key of the key range containing single key locks.
Constants for system-reserved keys in the KV map.
LockTableSingleKeyStart is the inclusive start key of the key range containing single key locks.
MaxKey is the infinity marker which is larger than any other key.
MaxPseudoTableID is the largest ID in PseudoTableIDs.
Meta1KeyMax is the end of the range of the first level of key addressing.
Meta1Prefix is the first level of key addressing.
Meta1Span holds all first level addressing records.
Meta2KeyMax is the end of the range of the second level of key addressing.
Meta2MaxSpan begins at key Meta2KeyMax with the last entry in the second level addressing keyspace.
Meta2Prefix is the second level of key addressing.
MetaMax is the end of the range of addressing keys.
1.
MetaSpan holds all first- and second-level addressing records.
MinKey is a minimum key value which sorts before all other keys.
NamespaceTableMax is the end key of system.namespace.
NamespaceTableMin is the start key of system.namespace, which is a system table that does not reside in the same range as other system tables.
NodeIDGenerator is the global node ID generator sequence.
NodeLivenessKeyMax is the maximum value for any node liveness key.
NodeLivenessPrefix specifies the key prefix for the node liveness table.
NodeLivenessSpan holds the liveness records for nodes in the cluster.
NoSplitSpans describes the ranges that should never be split.
PrettyPrintTimeseriesKey is a hook for pretty printing a timeseries key.
PseudoTableIDs is the list of ids from above that are not real tables (i.e.
RangeIDGenerator is the global range ID generator sequence.
Constants for system-reserved keys in the KV map.
ScratchRangeMin is a key used in tests to write arbitrary data without overlapping with meta, system or tenant ranges.
ScratchSpan is used in tests to write arbitrary data without overlapping with meta, system or tenant ranges.
StartupMigrationPrefix specifies the key prefix to store all migration details.
StatusNodePrefix stores all status info for nodes.
StatusPrefix specifies the key prefix to store all status details.
StoreIDGenerator is the global store ID generator sequence.
SystemConfigSplitKey is the key to split at immediately prior to the system config span.
SystemConfigTableDataMax is the end key of system config span.
SystemDescriptorTableSpan is the span for the system.descriptor table.
Constants for system-reserved keys in the KV map.
2.
SystemSpanConfigEntireKeyspace is the key prefix used to denote that the associated system span configuration applies over the entire keyspace (including all secondary tenants).
SystemSpanConfigHostOnTenantKeyspace is the key prefix used to denote that the associated system span configuration was applied by the host tenant over the keyspace of a secondary tenant.
SystemSpanConfigKeyMax is the maximum value for any system span config key.
SystemSpanConfigPrefix is the key prefix for all system span config data.
SystemSpanConfigSecondaryTenantOnEntireKeyspace is the key prefix used to denote that the associated system span configuration was applied by a secondary tenant over its entire keyspace.
SystemSpanConfigSpan is part of the system keyspace that is used to carve out spans for system span configurations.
SystemSQLCodec is a SQL key codec for the system tenant.
SystemZonesTableSpan is the span for the system.zones table.
TableDataMax is the end of the range of table data keys.
TableDataMin is the start of the range of table data keys.
4.
Constants for system-reserved keys in the KV map.
Constants for system-reserved keys in the KV map.
TimeseriesKeyMax is the maximum value for any timeseries data.
TimeseriesPrefix is the key prefix for all timeseries data.
TimeseriesSpan holds all the timeseries data in the cluster.
TrialLicenseExpiry is used to track the expiry of any trial license (past or present).

# Structs

DictEntry contains info on pretty-printing and pretty-scanning keys in a region of the key space.
ErrUglifyUnsupported is returned when UglyPrint doesn't know how to process a key.
InvalidRangeMetaKeyError indicates that a Range Metadata key is somehow invalid.
SQLCodec provides methods for encoding SQL table keys bound to a given tenant.

# Type aliases

KeyComprehensionTable contains information about how to decode pretty-printed keys, split by key spans.
KeyParserFunc is a function able to reverse pretty-printed keys.
QuoteOpt is a flag option used when pretty-printing keys to indicate whether to quote raw key values.
RangeIDPrefixBuf provides methods for generating range ID local keys while avoiding an allocation on every key generated.