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

# Packages

Package spanconfigbounds provides tools to enforce bounds on spanconfigs.
Package spanconfiglimiter is used to limit how many span configs are installed by tenants.
Package spanconfigreporter reports on whether ranges over the queried spans conform to the span configs that apply to them.
Package spanconfigsplitter is able to split sql descriptors into its constituent spans.
Package spanconfigsqltranslator provides logic to translate sql descriptors and their corresponding zone configurations to constituent spans and span configurations.
Package spanconfigstore exposes utilities for storing and retrieving SpanConfigs associated with a single span.

# Functions

Addition constructs an update that represents adding the given config over the given target.
DecodeTarget takes a raw span and decodes it into a Target given its encoding.
Deletion constructs an update that represents a deletion over the given target.
Delta considers both the committed and uncommitted state of a table descriptor and computes the difference in the number of spans we can apply a configuration over.
EmptyProtectedTSReader returns a ProtectedTSReader which contains no records and is always up-to date.
EntriesToRecords converts a list of roachpb.SpanConfigEntries (received over the wire) to a list of Records.
FullTranslate translates the entire SQL zone configuration state to the span configuration state.
IsCommitTimestampOutOfBoundsError returns whether the given error is the commitTimestampOutOfBoundsError kind.
IsMismatchedDescriptorTypesError returns whether the given error is the mismatchedDescriptorTypesError kind.
MakeAllTenantKeyspaceTargetsSet returns a new SystemTarget that represents all system span configurations installed by the given tenant ID on specific tenant's keyspace (including itself and other tenants).
MakeClusterProtectedTimestampSQLUpdate returns a SQLUpdate that represents an update to a protected timestamp record with a cluster target.
MakeDescriptorSQLUpdate returns a SQLUpdate that represents an update to a descriptor.
MakeEntireKeyspaceTarget returns a new system target that targets the entire keyspace.
MakeRecord returns a Record with the specified Target and SpanConfig.
MakeSpanTargetFromProto returns a new Target backed by an underlying span.
MakeTarget returns a new Target.
MakeTargetFromSpan constructs and returns a span target.
MakeTargetFromSystemTarget returns a Target which wraps a system target.
MakeTenantKeyspaceTarget constructs, validates, and returns a new SystemTarget that targets the keyspace of the target tenant.
MakeTenantProtectedTimestampSQLUpdate returns a SQLUpdate that represents an update to a protected timestamp record with a tenant target.
NewCommitTimestampOutOfBoundsError constructs a commitTimestampOutOfBoundsError.
NewMismatchedDescriptorTypesError constructs a mismatchedDescriptorTypesError.
NewProtectedTimestampStateReader returns an instance of a ProtectedTimestampStateReader that can be used to fetch target specific protected timestamp records given the supplied ptpb.State.
RecordsToEntries converts a list of records to a list roachpb.SpanConfigEntry protos suitable for sending over the wire.
TargetsFromProtos converts a list of roachpb.SpanConfigTargets (received over the wire) to a list of Targets.
TargetsFromRecords extracts the list of underlying targets from the given list of Records.
TargetsToProtos converts a list of targets to a list of roachpb.SpanConfigTarget protos suitable for sending over the wire.
TestingEntireSpanConfigurationStateTargets returns a list of targets which can be used to read the entire span configuration state.
TestingMakeTenantKeyspaceTargetOrFatal is like MakeTenantKeyspaceTarget except it fatals on error.

# Constants

SystemTargetTypeAllTenantKeyspaceTargetsSet represents a system target that encompasses all system targets that have been set by the source tenant over specific tenant's keyspace.
SystemTargetTypeEntireKeyspace indicates that the system target is targeting the entire keyspace.
SystemTargetTypeSpecificTenantKeyspace indicates that the system target is targeting a specific tenant's keyspace.

# Structs

DescriptorUpdate captures the ID and the type of descriptor or zone that been updated.
ProtectedTimestampStateReader provides a target specific view of the protected timestamp records stored in the system table.
ProtectedTimestampUpdate captures a protected timestamp record with a cluster or tenant target that been updated.
Record ties a target to its corresponding config.
SQLUpdate captures either a descriptor or a protected timestamp update.
SystemTarget specifies the target of a system span configuration.
Target specifies the target of an associated span configuration.
TenantProtectedTimestamps represents all the protections that apply to a tenant's keyspace.
TestingKnobs provide fine-grained control over the various span config components for testing.

# Interfaces

KVAccessor mediates access to KV span configurations pertaining to a given tenant.
KVSubscriber presents a consistent[1] snapshot of a StoreReader and ProtectedTSReader that's incrementally maintained with changes made to the global span configurations state (system.span_configurations).
Limiter is used to limit the number of span configs installed by secondary tenants.
ProtectedTSReader is the read-only portion for querying protected timestamp information.
Reconciler is responsible for reconciling a tenant's zone configs (SQL construct) with the cluster's span configs (KV construct).
Reporter generates a conformance report over the given spans, i.e.
Splitter returns the number of split points for the given table descriptor.
SQLTranslator translates SQL descriptors and their corresponding zone configurations to constituent spans and span configurations.
SQLWatcher watches for events on system.zones and system.descriptors.
Store is a data structure used to store spans and their corresponding configs.
StoreReader is the read-only portion of the Store interface.
StoreWriter is the write-only portion of the Store interface.

# Type aliases

SQLWatcherHandler is the signature of a handler that can be passed into SQLWatcher.WatchForSQLUpdates as described below.
Targets is a slice of span config targets.
Update captures a span and the corresponding config change.