package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
AddConstraint will add a new label constraint, with validation of all constraints.
ConstraintCompatibleWith will check if two constraints are compatible.
ConstraintsFingerPrint returns a unique string for the constraints.
GetRangeStartAndEndKeyHex get startKeyHex and endKeyHex of range by rangeBundleID.
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.
NewRuleBuilder creates a new RuleBuilder.
NewTableBundle creates a bundle for table key range.
RestoreConstraint converts a Constraint to a string.
RestoreConstraints converts label constraints to a string.
# 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.
DefaultKwd is used to reset the default rule (remove bundle).
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.
EngineRoleLabelKey is the label that indicates if the TiFlash instance is a write node.
EngineRoleLabelWrite is for disaggregated tiflash write node.
KeyRangeGlobal is the key range for system global range.
KeyRangeMeta is the key range for system meta range.
PDBundleID is the bundle name of pd, the default bundle for all regions.
RuleIndexKeyRangeForGlobal is the index for a rule of whole system range.
RuleIndexKeyRangeForMeta is the index for a rule of system meta range.
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.
TiDBBundleRangePrefixForGlobal is the bundle prefix of system global range.
TiDBBundleRangePrefixForMeta is the bundle prefix of system meta range.
TiFlashRuleGroupID is the rule group id of tiflash.
# 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.
ErrInvalidConstraintsReplicas 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
RuleBuilder is used to build the Rules from a constraint string.
# Interfaces
PolicyGetter is the interface to get the policy.
# Type aliases
Bundle is a group of all rules and configurations.
ConstraintCompatibility is the return type of CompatibleWith.