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

# Functions

ClusterInfoWithDistribution returns a ClusterInfo.
ClusterInfoWithStoreCount returns a new ClusterInfo with the specified number of stores.
GetClusterInfo returns ClusterInfo for a given configName and panics if no match is found in existing configurations.
LoadClusterInfo loads a predefined configuration which contains cluster information such as regions, zones, etc.
LoadConfig loads a predefined configuration which contains cluster information, range info and initial replica/lease placement.
LoadEventQPS returns the QPS for a given workload event.
LoadRangeInfo loads the ranges specified in RangesInfo into state.
NewCapacityOverride returns a capacity override where no overrides are set.
NewReplicaChanger returns an implementation of the changer interface for replica changes.
NewReplicaLoadCounter returns a new replica load counter.
NewShuffler returns a function which will shuffle elements determinstically but without order.
NewSplitDecider returns a new SplitDecider.
NewState returns an implementation of the State interface.
NewStateEvenDistribution returns a new State where the replica count per store is equal.
NewStateRandDistribution returns a new State where the replica count per store is randomized.
NewStateSkewedDistribution returns a new State where the replica count per store is skewed.
NewStateWeightedRandDistribution returns a new State where the replica count per store is weighted randomized based on weightedStores.
NewStateWithDistribution returns a State where the stores given are initialized with the specified % of the replicas.
NewStateWithReplCounts returns a new test state where each store is initialized the given number of replicas.
NewStorePool returns a store pool with no gossip instance and default values for configuration.
NewZone is a constructor for a simulated availability zone, taking zone name, node count, and custom stores per node.
NewZoneWithSingleStore is a constructor for a simulated availability zone, taking zone name, node count, and a default of one store per node.
OffsetTick offsets start time by adding tick number of seconds to it.
RangeInfoWithReplicas returns a new RangeInfo using the supplied arguments.
RangesInfoRandDistribution returns a RangesInfo, where ranges are generated with a random distribution across stores.
RangesInfoWeightedRandDistribution returns a RangesInfo, where ranges are generated with a weighted random distribution across stores.
RangesInfoWithDistribution returns a RangesInfo, where the stores given are initialized with the specified % of the replicas.
ReverseOffsetTick converts an offset time from the start time, into the number of ticks (seconds) since the start.
TestDistributeQPSCounts distributes QPS evenly among the leaseholder replicas on a store, such that the total QPS for the store matches the qpsCounts argument passed in.
TestingSetRangeQPS sets the QPS for the range with ID rangeID.
TestingStartTime returns a start time that may be used for tests.
TestingWorkloadSeed returns a seed to use for constructing a workload generator in unit tests.
ToKey converts a roachpb formatted key into a simulator int64 key.

# Constants

FirstRangeID is the constant for the ID assigned to the first range within the keyspace.
InvalidKey is a placeholder key that does not exist in the keyspace.
MaxKey is the maximum key in the keyspace.
MinKey is the minimum key in the keyspace.

# Variables

ComplexConfig is an imbalanced multi-region cluster config.
MultiRangeConfig is a ranges config where there are three ranges and stores 1,2,3 have replicas for each range.
MultiRegionConfig is a perfectly balanced cluster config with 3 regions.
SingleRangeConfig is a single range config where there are 3 replicas on stores 1, 2 and 3.
SingleRegionConfig is a simple cluster config with a single region and 3 zones, all have the same number of nodes.
SingleRegionMultiStoreConfig is a simple cluster config with a single region and 3 zones, all zones have 1 node and 6 stores per node.

# Structs

ClusterInfo contains cluster information needed for allocation decisions.
ClusterUsageInfo contains the load and state of the cluster.
LeaseTransferChange contains information necessary to transfer the lease for a range to a an existing replica, on the target store.
ManualSimClock implements the WallClock interface in the hlc pkg.
MockNodeLiveness is responsible for tracking the liveness status of nodes without the need for real heartbeating.
RangeSplitChange contains information necessary to split a range at a given key.
Region is a simulated region which contains one or more zones.
ReplicaChange contains information necessary to add, remove or move (both) a replica for a range.
ReplicaLoadCounter is the sum of all key accesses and size of bytes, both written and read.
SplitDecider implements the LoadSplitter interface.
StoreUsageInfo contains the load on a single store.
Topology represents the locality hierarchy information for a cluster.
Zone is a simulated availability zone.

# Interfaces

CapacityChangeListener listens for notification of capacity change events.
Change is a state change for a range, to a target store that has some delay.
Changer takes state changes and applies them with delay.
ConfigChangeListener listens for notification of configuration changes such as stores being added.
LoadSplitter provides an abstraction for load based splitting.
NewCapacityListener listens for notification of new store capacity events.
Node is a container for stores and is part of a cluster.
Range is a slice of the keyspace, which may have replicas that exist on some store(s).
Replica is a replica for a range that exists on a store.
ReplicaLoad defines the methods a datastructure is required to perform in order to record and report load events.
State encapsulates the current configuration and load of a simulation run.
Store is a container for replicas.

# Type aliases

CapacityOverride is used to override some field(s) of a store's capacity.
Key is a single slot in the keyspace.