package
6.7.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev

# Functions

GroupID accepts a tableID or whatever integer, and encode the integer into a valid GroupID for PD.
NewBundle will create a bundle with the provided ID.
NewBundleFromConstraintsOptions will transform constraints options into the bundle.
NewBundleFromOptions will transform options into the bundle.
NewBundleFromSugarOptions will transform syntax sugar options into the bundle.
NewConstraint will create a Constraint from a string.
NewConstraintDirect will create a Constraint from argument directly.
NewConstraints will check each labels, and build the Constraints.
NewConstraintsDirect is a helper for creating new constraints from individual constraint.
NewConstraintsFromYaml will transform parse the raw 'array' constraints and call NewConstraints.
NewFullTableBundles returns a bundle list with both table bundle and partition bundles.
NewPartitionBundle creates a bundle for partition key range.
NewPartitionListBundles creates a bundle list for a partition list.
NewRule constructs *Rule from role, count, and constraints.
NewRules constructs []*Rule from a yaml-compatible representation of 'array' or 'dict' constraints.
NewTableBundle creates a bundle for table key range.

# Constants

BundleIDPrefix is the bundle prefix of all rule bundles from TiDB_DDL statements.
ConstraintCompatible indicates two constraints are compatible.
ConstraintDuplicated indicates two constraints are duplicated.
ConstraintIncompatible indicates two constraints are incompatible.
DCLabelKey indicates the key of label which represents the dc for Store.
EngineLabelKey is the label that indicates the backend of store instance: tikv or tiflash.
EngineLabelTiFlash is the label value, which a TiFlash instance will have with a label key of EngineLabelKey.
EngineLabelTiFlashCompute is for disaggregated tiflash mode, it's the lable of tiflash_compute nodes.
EngineLabelTiKV is the label value used in some tests.
Exists restricts the store should have the label.
Follower matches a follower.
In restricts the store label value should in the value list.
Leader matches a leader.
Learner matches a learner.
NotExists restricts the store should not have the label.
NotIn restricts the store label value should not in the value list.
PDBundleID is the bundle name of pd, the default bundle for all regions.
RuleIndexPartition is the index for a rule of partition.
RuleIndexTable is the index for a rule of table.
RuleIndexTiFlash is the index for a rule of TiFlash.
TiFlashRuleGroupID is the rule group id of tiflash.
Voter can either match a leader peer or follower peer.

# Variables

ErrConflictingConstraints is from constraints.go.
ErrInvalidBundleID is from bundle.go.
ErrInvalidBundleIDFormat is from bundle.go.
ErrInvalidConstraintFormat is from constraint.go.
ErrInvalidConstraintsFormat is from rule.go.
ErrInvalidConstraintsMapcnt is from rule.go.
ErrInvalidConstraintsMappingNoColonFound is no colon found in mapping.
ErrInvalidConstraintsMappingWrongSeparator is wrong separator in mapping.
ErrInvalidConstraintsRelicas is from rule.go.
ErrInvalidPlacementOptions is from bundle.go.
ErrInvalidSurvivalPreferenceFormat is from rule.go.
ErrLeaderReplicasMustOne is from bundle.go.
ErrMissingRoleField is from bundle.go.
ErrNoRulesToDrop is from bundle.go.
ErrUnsupportedConstraint is from constraint.go.

# Structs

Bundle is a group of all rules and configurations.
Constraint is used to filter store when trying to place peer of a region.
Rule is the core placement rule struct.
RuleGroupConfig defines basic config of rule group.
TiFlashRule extends Rule with other necessary fields.

# Interfaces

PolicyGetter is the interface to get the policy.

# Type aliases

ConstraintCompatibility is the return type of CompatibleWith.
ConstraintOp defines how a Constraint matches a store.
Constraints is a slice of constraints.
PeerRoleType is the expected peer type of the placement rule.