Documentation
¶
Index ¶
- Constants
- func AppendToRootPath(rootPath string, key string) string
- func ClusterBootstrapTimeKey() string
- func ClusterID() uint64
- func ClusterRootPath(rootPath string) string
- func ConfigPath() string
- func EncodeKeyspaceID(spaceID uint32) string
- func ExternalTimestampPath() string
- func ExtractStoreIDFromPath(path string) (uint64, error)
- func FullTimestampPath(groupID uint32) string
- func GCSafePointPath() string
- func GCSafePointServicePath(serviceID string) string
- func GCSafePointServicePrefixPath() string
- func GCSafePointV2Path(keyspaceID uint32) string
- func GCSafePointV2Prefix() string
- func GetCompiledKeyspaceGroupIDRegexp() *regexp.Regexp
- func GetCompiledNonDefaultIDRegexp() *regexp.Regexp
- func KeyspaceGroupGlobalTSPath(groupID uint32) string
- func KeyspaceGroupIDPath(id uint32) string
- func KeyspaceGroupIDPrefix() string
- func KeyspaceGroupLocalTSPath(keyPrefix string, groupID uint32, dcLocation string) string
- func KeyspaceGroupPrimaryPath(rootPath string, keyspaceGroupID uint32) string
- func KeyspaceGroupsElectionPath(rootPath string, keyspaceGroupID uint32) string
- func KeyspaceIDAlloc() string
- func KeyspaceIDPath(name string) string
- func KeyspaceMetaPath(spaceID uint32) string
- func KeyspaceMetaPrefix() string
- func LegacyRootPath() string
- func MinResolvedTSPath() string
- func PDRootPath() string
- func RegionLabelKeyPath(ruleKey string) string
- func RegionLabelPathPrefix() string
- func RegionPath(regionID uint64) string
- func RegistryPath(serviceName, serviceAddr string) string
- func ReplicationModePath(mode string) string
- func ResetClusterID()
- func ResourceGroupSettingKeyPath(groupName string) string
- func ResourceGroupStateKeyPath(groupName string) string
- func ResourceManagerSvcRootPath() string
- func RuleCommonPathPrefix() string
- func RuleGroupIDPath(groupID string) string
- func RuleGroupPathPrefix() string
- func RuleKeyPath(ruleKey string) string
- func RulesPathPrefix() string
- func SchedulerConfigPath(schedulerName string) string
- func SchedulerConfigPathPrefix() string
- func SchedulingPrimaryPath() string
- func SchedulingSvcRootPath() string
- func ServicePath(serviceName string) string
- func ServiceSafePointV2Path(keyspaceID uint32, serviceID string) string
- func ServiceSafePointV2Prefix(keyspaceID uint32) string
- func SetClusterID(id uint64)
- func StoreLeaderWeightPath(storeID uint64) string
- func StorePath(storeID uint64) string
- func StorePathPrefix() string
- func StoreRegionWeightPath(storeID uint64) string
- func TSOPath() string
- func TSOSvcRootPath() string
- func TimestampPath(tsPath string) string
Constants ¶
const ( // ClusterPath is the path to save the cluster meta information. ClusterPath = "raft" // Config is the path to save the PD config. Config = "config" // ServiceMiddlewarePath is the path to save the service middleware config. ServiceMiddlewarePath = "service_middleware" // RulesPath is the path to save the placement rules. RulesPath = "rules" // RuleGroupPath is the path to save the placement rule groups. RuleGroupPath = "rule_group" // RegionLabelPath is the path to save the region label. RegionLabelPath = "region_label" // CustomSchedulerConfigPath is the path to save the scheduler config. CustomSchedulerConfigPath = "scheduler_config" // GCWorkerServiceSafePointID is the service id of GC worker. GCWorkerServiceSafePointID = "gc_worker" // resource group storage endpoint has prefix `resource_group` // ResourceGroupSettingsPath is the path to save the resource group settings. ResourceGroupSettingsPath = "settings" // ResourceGroupStatesPath is the path to save the resource group states. ResourceGroupStatesPath = "states" // ControllerConfigPath is the path to save the controller config. ControllerConfigPath = "controller" // TimestampKey is the key of timestamp oracle used for the suffix. TimestampKey = "timestamp" // ClusterIDPath is the path to store cluster id ClusterIDPath = "/pd/cluster_id" )
Variables ¶
This section is empty.
Functions ¶
func AppendToRootPath ¶
AppendToRootPath appends the given key to the rootPath.
func ClusterBootstrapTimeKey ¶
func ClusterBootstrapTimeKey() string
ClusterBootstrapTimeKey returns the path to save the cluster bootstrap timestamp.
func ClusterRootPath ¶
ClusterRootPath appends the `ClusterPath` to the rootPath.
func EncodeKeyspaceID ¶
EncodeKeyspaceID from uint32 to string. It adds extra padding to make encoded ID ordered. Encoded ID can be decoded directly with strconv.ParseUint. Width of the padded keyspaceID is 8 (decimal representation of uint24max is 16777215).
func ExternalTimestampPath ¶
func ExternalTimestampPath() string
ExternalTimestampPath returns the external timestamp path.
func ExtractStoreIDFromPath ¶
ExtractStoreIDFromPath extracts the store ID from the given path.
func FullTimestampPath ¶
FullTimestampPath returns the full timestamp path.
- for the default keyspace group: /pd/{cluster_id}/timestamp
- for the non-default keyspace groups: /ms/{cluster_id}/tso/{group}/gta/timestamp
func GCSafePointPath ¶
func GCSafePointPath() string
GCSafePointPath returns the GC safe point key path.
func GCSafePointServicePath ¶
GCSafePointServicePath returns the GC safe point service key path with the given service ID.
func GCSafePointServicePrefixPath ¶
func GCSafePointServicePrefixPath() string
GCSafePointServicePrefixPath returns the GC safe point service key path prefix.
func GCSafePointV2Path ¶
GCSafePointV2Path is the storage path of gc safe point v2. Path: keyspaces/gc_safe_point/{keyspaceID}
func GCSafePointV2Prefix ¶
func GCSafePointV2Prefix() string
GCSafePointV2Prefix is the path prefix to all gc safe point v2. Prefix: keyspaces/gc_safe_point/
func GetCompiledKeyspaceGroupIDRegexp ¶
GetCompiledKeyspaceGroupIDRegexp returns the compiled regular expression for matching keyspace group id.
func GetCompiledNonDefaultIDRegexp ¶
GetCompiledNonDefaultIDRegexp returns the compiled regular expression for matching non-default keyspace group id.
func KeyspaceGroupGlobalTSPath ¶
KeyspaceGroupGlobalTSPath constructs the timestampOracle path prefix for Global TSO, which is:
- for the default keyspace group: "" in /pd/{cluster_id}/timestamp
- for the non-default keyspace groups: {group}/gta in /ms/{cluster_id}/tso/{group}/gta/timestamp
func KeyspaceGroupIDPath ¶
KeyspaceGroupIDPath returns the path to keyspace id from the given name. Path: tso/keyspace_groups/membership/{id}
func KeyspaceGroupIDPrefix ¶
func KeyspaceGroupIDPrefix() string
KeyspaceGroupIDPrefix returns the prefix of keyspace group id. Path: tso/keyspace_groups/membership
func KeyspaceGroupLocalTSPath ¶
KeyspaceGroupLocalTSPath constructs the timestampOracle path prefix for Local TSO, which is:
- for the default keyspace group: lta/{dc-location} in /pd/{cluster_id}/lta/{dc-location}/timestamp
- for the non-default keyspace groups: {group}/lta/{dc-location} in /ms/{cluster_id}/tso/{group}/lta/{dc-location}/timestamp
func KeyspaceGroupPrimaryPath ¶
KeyspaceGroupPrimaryPath returns the path of keyspace group primary. default keyspace group: "/ms/{cluster_id}/tso/00000/primary". non-default keyspace group: "/ms/{cluster_id}/tso/keyspace_groups/election/{group}/primary".
func KeyspaceGroupsElectionPath ¶
KeyspaceGroupsElectionPath returns the path of keyspace groups election. default keyspace group: "/ms/{cluster_id}/tso/00000". non-default keyspace group: "/ms/{cluster_id}/tso/keyspace_groups/election/{group}".
func KeyspaceIDAlloc ¶
func KeyspaceIDAlloc() string
KeyspaceIDAlloc returns the path of the keyspace id's persistent window boundary. Path: keyspaces/alloc_id
func KeyspaceIDPath ¶
KeyspaceIDPath returns the path to keyspace id from the given name. Path: keyspaces/id/{name}
func KeyspaceMetaPath ¶
KeyspaceMetaPath returns the path to the given keyspace's metadata. Path: keyspaces/meta/{space_id}
func KeyspaceMetaPrefix ¶
func KeyspaceMetaPrefix() string
KeyspaceMetaPrefix returns the prefix of keyspaces' metadata. Prefix: keyspaces/meta/
func LegacyRootPath ¶
func LegacyRootPath() string
LegacyRootPath returns the root path of legacy pd service. Path: /pd/{cluster_id}
func MinResolvedTSPath ¶
func MinResolvedTSPath() string
MinResolvedTSPath returns the min resolved ts path.
func RegionLabelKeyPath ¶
RegionLabelKeyPath returns the path to save the region label with the given rule key.
func RegionLabelPathPrefix ¶
func RegionLabelPathPrefix() string
RegionLabelPathPrefix returns the path prefix to save the region label.
func RegionPath ¶
RegionPath returns the region meta info key path with the given region ID.
func RegistryPath ¶
RegistryPath returns the full path to store microservice addresses.
func ReplicationModePath ¶
ReplicationModePath returns the path to save the replication mode with the given mode.
func ResetClusterID ¶
func ResetClusterID()
ResetClusterID resets the cluster ID to 0. It's only used in tests.
func ResourceGroupSettingKeyPath ¶
ResourceGroupSettingKeyPath returns the path to save the resource group settings.
func ResourceGroupStateKeyPath ¶
ResourceGroupStateKeyPath returns the path to save the resource group states.
func ResourceManagerSvcRootPath ¶
func ResourceManagerSvcRootPath() string
ResourceManagerSvcRootPath returns the root path of resource manager service. Path: /ms/{cluster_id}/resource_manager
func RuleCommonPathPrefix ¶
func RuleCommonPathPrefix() string
RuleCommonPathPrefix returns the path prefix to save the placement rule common config.
func RuleGroupIDPath ¶
RuleGroupIDPath returns the path to save the placement rule group with the given group ID.
func RuleGroupPathPrefix ¶
func RuleGroupPathPrefix() string
RuleGroupPathPrefix returns the path prefix to save the placement rule groups.
func RuleKeyPath ¶
RuleKeyPath returns the path to save the placement rule with the given rule key.
func RulesPathPrefix ¶
func RulesPathPrefix() string
RulesPathPrefix returns the path prefix to save the placement rules.
func SchedulerConfigPath ¶
SchedulerConfigPath returns the path to save the scheduler config.
func SchedulerConfigPathPrefix ¶
func SchedulerConfigPathPrefix() string
SchedulerConfigPathPrefix returns the path prefix to save the scheduler config.
func SchedulingPrimaryPath ¶
func SchedulingPrimaryPath() string
SchedulingPrimaryPath returns the path of scheduling primary. Path: /ms/{cluster_id}/scheduling/primary
func SchedulingSvcRootPath ¶
func SchedulingSvcRootPath() string
SchedulingSvcRootPath returns the root path of scheduling service. Path: /ms/{cluster_id}/scheduling
func ServicePath ¶
ServicePath returns the path to store microservice addresses.
func ServiceSafePointV2Path ¶
ServiceSafePointV2Path is the storage path of service safe point v2. Path: keyspaces/service_safe_point/{spaceID}/{serviceID}
func ServiceSafePointV2Prefix ¶
ServiceSafePointV2Prefix is the path prefix of all service safe point that belongs to a specific keyspace. Can be used to retrieve keyspace's service safe point at once. Path: keyspaces/service_safe_point/{spaceID}/
func StoreLeaderWeightPath ¶
StoreLeaderWeightPath returns the store leader weight key path with the given store ID.
func StorePathPrefix ¶
func StorePathPrefix() string
StorePathPrefix returns the store meta info key path prefix.
func StoreRegionWeightPath ¶
StoreRegionWeightPath returns the store region weight key path with the given store ID.
func TSOSvcRootPath ¶
func TSOSvcRootPath() string
TSOSvcRootPath returns the root path of tso service. Path: /ms/{cluster_id}/tso
func TimestampPath ¶
TimestampPath returns the timestamp path for the given timestamp oracle path prefix.
Types ¶
This section is empty.