Documentation ¶
Index ¶
- Constants
- func IsSupportedTTLConfig(key string) bool
- func NormalizeReplicationMode(m string) string
- func ValidateURLWithScheme(rawURL string) error
- type AuditConfig
- type Config
- func (c *Config) Adjust(meta *toml.MetaData, reloading bool) error
- func (c *Config) Clone() *Config
- func (c *Config) GenEmbedEtcdConfig() (*embed.Config, error)
- func (c *Config) GetLeaderLease() int64
- func (c *Config) GetMaxConcurrentTSOProxyStreamings() int
- func (c *Config) GetTLSConfig() *grpcutil.TLSConfig
- func (c *Config) GetTSOProxyRecvFromClientTimeout() time.Duration
- func (c *Config) GetTSOSaveInterval() time.Duration
- func (c *Config) GetTSOUpdatePhysicalInterval() time.Duration
- func (c *Config) IsLocalTSOEnabled() bool
- func (c *Config) Parse(flagSet *pflag.FlagSet) error
- func (c *Config) String() string
- func (c *Config) Validate() error
- type DRAutoSyncReplicationConfig
- type DashboardConfig
- type GRPCRateLimitConfig
- type KeyspaceConfig
- func (c *KeyspaceConfig) Clone() *KeyspaceConfig
- func (c *KeyspaceConfig) GetCheckRegionSplitInterval() time.Duration
- func (c *KeyspaceConfig) GetPreAlloc() []string
- func (c *KeyspaceConfig) GetWaitRegionSplitTimeout() time.Duration
- func (c *KeyspaceConfig) ToWaitRegionSplit() bool
- func (c *KeyspaceConfig) Validate() error
- type LabelPropertyConfig
- type MicroServiceConfig
- type PDServerConfig
- type PersistOptions
- func (o *PersistOptions) AddSchedulerCfg(tp string, args []string)
- func (o *PersistOptions) CASClusterVersion(old, new *semver.Version) bool
- func (o *PersistOptions) CheckLabelProperty(typ string, labels []*metapb.StoreLabel) bool
- func (o *PersistOptions) CheckRegionKeys(keys, mergeKeys uint64) error
- func (o *PersistOptions) CheckRegionSize(size, mergeSize uint64) error
- func (o *PersistOptions) DeleteLabelProperty(typ, labelKey, labelValue string)
- func (o *PersistOptions) GetAllStoresLimit() map[uint64]sc.StoreLimitConfig
- func (o *PersistOptions) GetClusterVersion() *semver.Version
- func (o *PersistOptions) GetDashboardAddress() string
- func (o *PersistOptions) GetEnableGOGCTuner() bool
- func (o *PersistOptions) GetGCTunerThreshold() float64
- func (o *PersistOptions) GetHighSpaceRatio() float64
- func (o *PersistOptions) GetHotRegionCacheHitsThreshold() int
- func (o *PersistOptions) GetHotRegionScheduleLimit() uint64
- func (o *PersistOptions) GetHotRegionsReservedDays() uint64
- func (o *PersistOptions) GetHotRegionsWriteInterval() time.Duration
- func (o *PersistOptions) GetIsolationLevel() string
- func (o *PersistOptions) GetKeyType() constant.KeyType
- func (o *PersistOptions) GetKeyspaceConfig() *KeyspaceConfig
- func (o *PersistOptions) GetLabelPropertyConfig() LabelPropertyConfig
- func (o *PersistOptions) GetLeaderScheduleLimit() uint64
- func (o *PersistOptions) GetLeaderSchedulePolicy() constant.SchedulePolicy
- func (o *PersistOptions) GetLocationLabels() []string
- func (o *PersistOptions) GetLowSpaceRatio() float64
- func (o *PersistOptions) GetMaxMergeRegionKeys() uint64
- func (o *PersistOptions) GetMaxMergeRegionSize() uint64
- func (o *PersistOptions) GetMaxMovableHotPeerSize() int64
- func (o *PersistOptions) GetMaxPendingPeerCount() uint64
- func (o *PersistOptions) GetMaxReplicas() int
- func (o *PersistOptions) GetMaxResetTSGap() time.Duration
- func (o *PersistOptions) GetMaxSnapshotCount() uint64
- func (o *PersistOptions) GetMaxStoreDownTime() time.Duration
- func (o *PersistOptions) GetMaxStorePreparingTime() time.Duration
- func (o *PersistOptions) GetMergeScheduleLimit() uint64
- func (o *PersistOptions) GetMicroServiceConfig() *MicroServiceConfig
- func (o *PersistOptions) GetMinResolvedTSPersistenceInterval() time.Duration
- func (o *PersistOptions) GetPDServerConfig() *PDServerConfig
- func (o *PersistOptions) GetPatrolRegionInterval() time.Duration
- func (o *PersistOptions) GetRegionBucketSize() uint64
- func (o *PersistOptions) GetRegionMaxKeys() uint64
- func (o *PersistOptions) GetRegionMaxSize() uint64
- func (o *PersistOptions) GetRegionScheduleLimit() uint64
- func (o *PersistOptions) GetRegionScoreFormulaVersion() string
- func (o *PersistOptions) GetRegionSplitKeys() uint64
- func (o *PersistOptions) GetRegionSplitSize() uint64
- func (o *PersistOptions) GetReplicaScheduleLimit() uint64
- func (o *PersistOptions) GetReplicationConfig() *sc.ReplicationConfig
- func (o *PersistOptions) GetReplicationModeConfig() *ReplicationModeConfig
- func (o *PersistOptions) GetScheduleConfig() *sc.ScheduleConfig
- func (o *PersistOptions) GetSchedulerMaxWaitingOperator() uint64
- func (o *PersistOptions) GetSchedulers() sc.SchedulerConfigs
- func (o *PersistOptions) GetServerMemoryLimit() float64
- func (o *PersistOptions) GetServerMemoryLimitGCTrigger() float64
- func (o *PersistOptions) GetSlowStoreEvictingAffectedStoreRatioThreshold() float64
- func (o *PersistOptions) GetSplitMergeInterval() time.Duration
- func (o *PersistOptions) GetStoreConfig() *sc.StoreConfig
- func (o *PersistOptions) GetStoreLimit(storeID uint64) (returnSC sc.StoreLimitConfig)
- func (o *PersistOptions) GetStoreLimitByType(storeID uint64, typ storelimit.Type) (returned float64)
- func (o *PersistOptions) GetStoreLimitVersion() string
- func (o *PersistOptions) GetStoresLimit() map[uint64]sc.StoreLimitConfig
- func (o *PersistOptions) GetStrictlyMatchLabel() bool
- func (o *PersistOptions) GetSwitchWitnessInterval() time.Duration
- func (o *PersistOptions) GetTTLData(key string) (string, bool)
- func (o *PersistOptions) GetTolerantSizeRatio() float64
- func (o *PersistOptions) GetWitnessScheduleLimit() uint64
- func (o *PersistOptions) IsCrossTableMergeEnabled() bool
- func (o *PersistOptions) IsDebugMetricsEnabled() bool
- func (o *PersistOptions) IsDiagnosticAllowed() bool
- func (o *PersistOptions) IsEnableRegionBucket() bool
- func (o *PersistOptions) IsLocationReplacementEnabled() bool
- func (o *PersistOptions) IsMakeUpReplicaEnabled() bool
- func (o *PersistOptions) IsOneWayMergeEnabled() bool
- func (o *PersistOptions) IsPlacementRulesCacheEnabled() bool
- func (o *PersistOptions) IsPlacementRulesEnabled() bool
- func (o *PersistOptions) IsRaftKV2() bool
- func (o *PersistOptions) IsRemoveDownReplicaEnabled() bool
- func (o *PersistOptions) IsRemoveExtraReplicaEnabled() bool
- func (o *PersistOptions) IsReplaceOfflineReplicaEnabled() bool
- func (o *PersistOptions) IsSchedulerDisabled(t string) bool
- func (o *PersistOptions) IsSchedulingHalted() bool
- func (o *PersistOptions) IsTikvRegionSplitEnabled() bool
- func (o *PersistOptions) IsTraceRegionFlow() bool
- func (o *PersistOptions) IsUseJointConsensus() bool
- func (o *PersistOptions) IsUseRegionStorage() bool
- func (o *PersistOptions) IsWitnessAllowed() bool
- func (o *PersistOptions) LoadTTLFromEtcd(ctx context.Context, client *clientv3.Client) error
- func (o *PersistOptions) Persist(storage endpoint.ConfigStorage) error
- func (o *PersistOptions) Reload(storage endpoint.ConfigStorage) error
- func (o *PersistOptions) RemoveSchedulerCfg(tp string)
- func (o *PersistOptions) SetAllStoresLimit(typ storelimit.Type, ratePerMin float64)
- func (o *PersistOptions) SetAllStoresLimitTTL(ctx context.Context, client *clientv3.Client, typ storelimit.Type, ...) error
- func (o *PersistOptions) SetClusterVersion(v *semver.Version)
- func (o *PersistOptions) SetEnableDiagnostic(enable bool)
- func (o *PersistOptions) SetEnableUseJointConsensus(enable bool)
- func (o *PersistOptions) SetEnableWitness(enable bool)
- func (o *PersistOptions) SetHaltScheduling(halt bool, source string)
- func (o *PersistOptions) SetKeyspaceConfig(cfg *KeyspaceConfig)
- func (o *PersistOptions) SetLabelProperty(typ, labelKey, labelValue string)
- func (o *PersistOptions) SetLabelPropertyConfig(cfg LabelPropertyConfig)
- func (o *PersistOptions) SetLocationLabels(labels []string)
- func (o *PersistOptions) SetMaxMergeRegionKeys(maxMergeRegionKeys uint64)
- func (o *PersistOptions) SetMaxMergeRegionSize(maxMergeRegionSize uint64)
- func (o *PersistOptions) SetMaxReplicas(replicas int)
- func (o *PersistOptions) SetMaxStoreDownTime(time time.Duration)
- func (o *PersistOptions) SetMicroServiceConfig(cfg *MicroServiceConfig)
- func (o *PersistOptions) SetPDServerConfig(cfg *PDServerConfig)
- func (o *PersistOptions) SetPlacementRuleEnabled(enabled bool)
- func (o *PersistOptions) SetPlacementRulesCacheEnabled(enabled bool)
- func (o *PersistOptions) SetRegionBucketEnabled(enabled bool)
- func (o *PersistOptions) SetReplicationConfig(cfg *sc.ReplicationConfig)
- func (o *PersistOptions) SetReplicationModeConfig(cfg *ReplicationModeConfig)
- func (o *PersistOptions) SetScheduleConfig(cfg *sc.ScheduleConfig)
- func (*PersistOptions) SetSchedulingAllowanceStatus(halt bool, source string)
- func (o *PersistOptions) SetSplitMergeInterval(splitMergeInterval time.Duration)
- func (o *PersistOptions) SetStoreConfig(cfg *sc.StoreConfig)
- func (o *PersistOptions) SetStoreLimit(storeID uint64, typ storelimit.Type, ratePerMin float64)
- func (o *PersistOptions) SetTTLData(parCtx context.Context, client *clientv3.Client, key string, value string, ...) error
- func (o *PersistOptions) SwitchRaftV2(storage endpoint.ConfigStorage) error
- type RateLimitConfig
- type ReplicationModeConfig
- type ServiceMiddlewareConfig
- type ServiceMiddlewarePersistOptions
- func (o *ServiceMiddlewarePersistOptions) GetAuditConfig() *AuditConfig
- func (o *ServiceMiddlewarePersistOptions) GetGRPCRateLimitConfig() *GRPCRateLimitConfig
- func (o *ServiceMiddlewarePersistOptions) GetRateLimitConfig() *RateLimitConfig
- func (o *ServiceMiddlewarePersistOptions) IsAuditEnabled() bool
- func (o *ServiceMiddlewarePersistOptions) IsGRPCRateLimitEnabled() bool
- func (o *ServiceMiddlewarePersistOptions) IsRateLimitEnabled() bool
- func (o *ServiceMiddlewarePersistOptions) Persist(storage endpoint.ServiceMiddlewareStorage) error
- func (o *ServiceMiddlewarePersistOptions) Reload(storage endpoint.ServiceMiddlewareStorage) error
- func (o *ServiceMiddlewarePersistOptions) SetAuditConfig(cfg *AuditConfig)
- func (o *ServiceMiddlewarePersistOptions) SetGRPCRateLimitConfig(cfg *GRPCRateLimitConfig)
- func (o *ServiceMiddlewarePersistOptions) SetRateLimitConfig(cfg *RateLimitConfig)
- type StoreLabel
Constants ¶
const ( // DefaultMinResolvedTSPersistenceInterval is the default value of min resolved ts persistent interval. DefaultMinResolvedTSPersistenceInterval = time.Second )
const (
// ZoneLabel is the name of the key which indicates DC location of this PD server.
ZoneLabel = "zone"
)
Special keys for Labels
Variables ¶
This section is empty.
Functions ¶
func IsSupportedTTLConfig ¶
IsSupportedTTLConfig checks whether a key is a supported config item with ttl
func NormalizeReplicationMode ¶
NormalizeReplicationMode converts user's input mode to internal use. It returns "" if failed to convert.
func ValidateURLWithScheme ¶
ValidateURLWithScheme checks the format of the URL.
Types ¶
type AuditConfig ¶
type AuditConfig struct { // EnableAudit controls the switch of the audit middleware EnableAudit bool `json:"enable-audit,string"` }
AuditConfig is the configuration for audit
func (*AuditConfig) Clone ¶
func (c *AuditConfig) Clone() *AuditConfig
Clone returns a cloned audit config.
type Config ¶
type Config struct { ClientUrls string `toml:"client-urls" json:"client-urls"` PeerUrls string `toml:"peer-urls" json:"peer-urls"` AdvertiseClientUrls string `toml:"advertise-client-urls" json:"advertise-client-urls"` AdvertisePeerUrls string `toml:"advertise-peer-urls" json:"advertise-peer-urls"` Name string `toml:"name" json:"name"` DataDir string `toml:"data-dir" json:"data-dir"` ForceNewCluster bool `json:"force-new-cluster"` EnableGRPCGateway bool `json:"enable-grpc-gateway"` InitialCluster string `toml:"initial-cluster" json:"initial-cluster"` InitialClusterState string `toml:"initial-cluster-state" json:"initial-cluster-state"` InitialClusterToken string `toml:"initial-cluster-token" json:"initial-cluster-token"` // Join to an existing pd cluster, a string of endpoints. Join string `toml:"join" json:"join"` // LeaderLease time, if leader doesn't update its TTL // in etcd after lease time, etcd will expire the leader key // and other servers can campaign the leader again. // Etcd only supports seconds TTL, so here is second too. LeaderLease int64 `toml:"lease" json:"lease"` // Log related config. Log log.Config `toml:"log" json:"log"` // Backward compatibility. LogFileDeprecated string `toml:"log-file" json:"log-file,omitempty"` LogLevelDeprecated string `toml:"log-level" json:"log-level,omitempty"` // MaxConcurrentTSOProxyStreamings is the maximum number of concurrent TSO proxy streaming process routines allowed. // Exceeding this limit will result in an error being returned to the client when a new client starts a TSO streaming. // Set this to 0 will disable TSO Proxy. // Set this to the negative value to disable the limit. MaxConcurrentTSOProxyStreamings int `toml:"max-concurrent-tso-proxy-streamings" json:"max-concurrent-tso-proxy-streamings"` // TSOProxyRecvFromClientTimeout is the timeout for the TSO proxy to receive a tso request from a client via grpc TSO stream. // After the timeout, the TSO proxy will close the grpc TSO stream. TSOProxyRecvFromClientTimeout typeutil.Duration `toml:"tso-proxy-recv-from-client-timeout" json:"tso-proxy-recv-from-client-timeout"` // TSOSaveInterval is the interval to save timestamp. TSOSaveInterval typeutil.Duration `toml:"tso-save-interval" json:"tso-save-interval"` // The interval to update physical part of timestamp. Usually, this config should not be set. // At most 1<<18 (262144) TSOs can be generated in the interval. The smaller the value, the // more TSOs provided, and at the same time consuming more CPU time. // This config is only valid in 1ms to 10s. If it's configured too long or too short, it will // be automatically clamped to the range. TSOUpdatePhysicalInterval typeutil.Duration `toml:"tso-update-physical-interval" json:"tso-update-physical-interval"` // EnableLocalTSO is used to enable the Local TSO Allocator feature, // which allows the PD server to generate Local TSO for certain DC-level transactions. // To make this feature meaningful, user has to set the "zone" label for the PD server // to indicate which DC this PD belongs to. EnableLocalTSO bool `toml:"enable-local-tso" json:"enable-local-tso"` Metric metricutil.MetricConfig `toml:"metric" json:"metric"` Schedule sc.ScheduleConfig `toml:"schedule" json:"schedule"` Replication sc.ReplicationConfig `toml:"replication" json:"replication"` PDServerCfg PDServerConfig `toml:"pd-server" json:"pd-server"` ClusterVersion semver.Version `toml:"cluster-version" json:"cluster-version"` // Labels indicates the labels set for **this** PD server. The labels describe some specific properties // like `zone`/`rack`/`host`. Currently, labels won't affect the PD server except for some special // label keys. Now we have following special keys: // 1. 'zone' is a special key that indicates the DC location of this PD server. If it is set, the value for this // will be used to determine which DC's Local TSO service this PD will provide with if EnableLocalTSO is true. Labels map[string]string `toml:"labels" json:"labels"` // QuotaBackendBytes Raise alarms when backend size exceeds the given quota. 0 means use the default quota. // the default size is 2GB, the maximum is 8GB. QuotaBackendBytes typeutil.ByteSize `toml:"quota-backend-bytes" json:"quota-backend-bytes"` // AutoCompactionMode is either 'periodic' or 'revision'. The default value is 'periodic'. AutoCompactionMode string `toml:"auto-compaction-mode" json:"auto-compaction-mode"` // AutoCompactionRetention is either duration string with time unit // (e.g. '5m' for 5-minute), or revision unit (e.g. '5000'). // If no time unit is provided and compaction mode is 'periodic', // the unit defaults to hour. For example, '5' translates into 5-hour. // The default retention is 1 hour. // Before etcd v3.3.x, the type of retention is int. We add 'v2' suffix to make it backward compatible. AutoCompactionRetention string `toml:"auto-compaction-retention" json:"auto-compaction-retention-v2"` // TickInterval is the interval for etcd Raft tick. TickInterval typeutil.Duration `toml:"tick-interval"` // ElectionInterval is the interval for etcd Raft election. ElectionInterval typeutil.Duration `toml:"election-interval"` // Prevote is true to enable Raft Pre-Vote. // If enabled, Raft runs an additional election phase // to check whether it would get enough votes to win // an election, thus minimizing disruptions. PreVote bool `toml:"enable-prevote"` MaxRequestBytes uint `toml:"max-request-bytes" json:"max-request-bytes"` Security configutil.SecurityConfig `toml:"security" json:"security"` LabelProperty LabelPropertyConfig `toml:"label-property" json:"label-property"` // For all warnings during parsing. WarningMsgs []string DisableStrictReconfigCheck bool HeartbeatStreamBindInterval typeutil.Duration LeaderPriorityCheckInterval typeutil.Duration Logger *zap.Logger `json:"-"` LogProps *log.ZapProperties `json:"-"` Dashboard DashboardConfig `toml:"dashboard" json:"dashboard"` ReplicationMode ReplicationModeConfig `toml:"replication-mode" json:"replication-mode"` Keyspace KeyspaceConfig `toml:"keyspace" json:"keyspace"` MicroService MicroServiceConfig `toml:"micro-service" json:"micro-service"` Controller rm.ControllerConfig `toml:"controller" json:"controller"` }
Config is the pd server configuration. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
func (*Config) GenEmbedEtcdConfig ¶
GenEmbedEtcdConfig generates a configuration for embedded etcd.
func (*Config) GetLeaderLease ¶
GetLeaderLease returns the leader lease.
func (*Config) GetMaxConcurrentTSOProxyStreamings ¶
GetMaxConcurrentTSOProxyStreamings returns the max concurrent TSO proxy streamings. If the value is negative, there is no limit.
func (*Config) GetTLSConfig ¶
GetTLSConfig returns the TLS config.
func (*Config) GetTSOProxyRecvFromClientTimeout ¶
GetTSOProxyRecvFromClientTimeout returns timeout value for TSO proxy receiving from the client.
func (*Config) GetTSOSaveInterval ¶
GetTSOSaveInterval returns TSO save interval.
func (*Config) GetTSOUpdatePhysicalInterval ¶
GetTSOUpdatePhysicalInterval returns TSO update physical interval.
func (*Config) IsLocalTSOEnabled ¶
IsLocalTSOEnabled returns if the local TSO is enabled.
type DRAutoSyncReplicationConfig ¶
type DRAutoSyncReplicationConfig struct { LabelKey string `toml:"label-key" json:"label-key"` Primary string `toml:"primary" json:"primary"` DR string `toml:"dr" json:"dr"` PrimaryReplicas int `toml:"primary-replicas" json:"primary-replicas"` DRReplicas int `toml:"dr-replicas" json:"dr-replicas"` WaitStoreTimeout typeutil.Duration `toml:"wait-store-timeout" json:"wait-store-timeout"` WaitRecoverTimeout typeutil.Duration `toml:"wait-recover-timeout" json:"wait-recover-timeout"` PauseRegionSplit bool `toml:"pause-region-split" json:"pause-region-split,string"` }
DRAutoSyncReplicationConfig is the configuration for auto sync mode between 2 data centers.
type DashboardConfig ¶
type DashboardConfig struct { TiDBCAPath string `toml:"tidb-cacert-path" json:"tidb-cacert-path"` TiDBCertPath string `toml:"tidb-cert-path" json:"tidb-cert-path"` TiDBKeyPath string `toml:"tidb-key-path" json:"tidb-key-path"` PublicPathPrefix string `toml:"public-path-prefix" json:"public-path-prefix"` InternalProxy bool `toml:"internal-proxy" json:"internal-proxy"` EnableTelemetry bool `toml:"enable-telemetry" json:"enable-telemetry"` EnableExperimental bool `toml:"enable-experimental" json:"enable-experimental"` }
DashboardConfig is the configuration for tidb-dashboard.
func (*DashboardConfig) ToTiDBTLSConfig ¶
func (c *DashboardConfig) ToTiDBTLSConfig() (*tls.Config, error)
ToTiDBTLSConfig generates tls config for connecting to TiDB, used by tidb-dashboard.
type GRPCRateLimitConfig ¶
type GRPCRateLimitConfig struct { // EnableRateLimit controls the switch of the rate limit middleware EnableRateLimit bool `json:"enable-grpc-rate-limit,string"` // RateLimitConfig is the config of rate limit middleware LimiterConfig map[string]ratelimit.DimensionConfig `json:"grpc-limiter-config"` }
GRPCRateLimitConfig is the configuration for gRPC rate limit
func (*GRPCRateLimitConfig) Clone ¶
func (c *GRPCRateLimitConfig) Clone() *GRPCRateLimitConfig
Clone returns a cloned rate limit config.
type KeyspaceConfig ¶
type KeyspaceConfig struct { // PreAlloc contains the keyspace to be allocated during keyspace manager initialization. PreAlloc []string `toml:"pre-alloc" json:"pre-alloc"` // WaitRegionSplit indicates whether to wait for the region split to complete WaitRegionSplit bool `toml:"wait-region-split" json:"wait-region-split"` // WaitRegionSplitTimeout indicates the max duration to wait region split. WaitRegionSplitTimeout typeutil.Duration `toml:"wait-region-split-timeout" json:"wait-region-split-timeout"` // CheckRegionSplitInterval indicates the interval to check whether the region split is complete CheckRegionSplitInterval typeutil.Duration `toml:"check-region-split-interval" json:"check-region-split-interval"` }
KeyspaceConfig is the configuration for keyspace management.
func (*KeyspaceConfig) Clone ¶
func (c *KeyspaceConfig) Clone() *KeyspaceConfig
Clone makes a deep copy of the keyspace config.
func (*KeyspaceConfig) GetCheckRegionSplitInterval ¶
func (c *KeyspaceConfig) GetCheckRegionSplitInterval() time.Duration
GetCheckRegionSplitInterval returns the interval to check whether the region split is complete.
func (*KeyspaceConfig) GetPreAlloc ¶
func (c *KeyspaceConfig) GetPreAlloc() []string
GetPreAlloc returns the keyspace to be allocated during keyspace manager initialization.
func (*KeyspaceConfig) GetWaitRegionSplitTimeout ¶
func (c *KeyspaceConfig) GetWaitRegionSplitTimeout() time.Duration
GetWaitRegionSplitTimeout returns the max duration to wait region split.
func (*KeyspaceConfig) ToWaitRegionSplit ¶
func (c *KeyspaceConfig) ToWaitRegionSplit() bool
ToWaitRegionSplit returns whether to wait for the region split to complete.
func (*KeyspaceConfig) Validate ¶
func (c *KeyspaceConfig) Validate() error
Validate checks if keyspace config falls within acceptable range.
type LabelPropertyConfig ¶
type LabelPropertyConfig map[string][]StoreLabel
LabelPropertyConfig is the config section to set properties to store labels. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
func (LabelPropertyConfig) Clone ¶
func (c LabelPropertyConfig) Clone() LabelPropertyConfig
Clone returns a cloned label property configuration.
type MicroServiceConfig ¶
type MicroServiceConfig struct {
EnableSchedulingFallback bool `toml:"enable-scheduling-fallback" json:"enable-scheduling-fallback,string"`
}
MicroServiceConfig is the configuration for micro service.
func (*MicroServiceConfig) Clone ¶
func (c *MicroServiceConfig) Clone() *MicroServiceConfig
Clone returns a copy of micro service config.
func (*MicroServiceConfig) IsSchedulingFallbackEnabled ¶
func (c *MicroServiceConfig) IsSchedulingFallbackEnabled() bool
IsSchedulingFallbackEnabled returns whether to enable scheduling service fallback to api service.
type PDServerConfig ¶
type PDServerConfig struct { // UseRegionStorage enables the independent region storage. UseRegionStorage bool `toml:"use-region-storage" json:"use-region-storage,string"` // MaxResetTSGap is the max gap to reset the TSO. MaxResetTSGap typeutil.Duration `toml:"max-gap-reset-ts" json:"max-gap-reset-ts"` // KeyType is option to specify the type of keys. // There are some types supported: ["table", "raw", "txn"], default: "table" KeyType string `toml:"key-type" json:"key-type"` // RuntimeServices is the running extension services. RuntimeServices typeutil.StringSlice `toml:"runtime-services" json:"runtime-services"` // MetricStorage is the cluster metric storage. // Currently, we use prometheus as metric storage, we may use PD/TiKV as metric storage later. MetricStorage string `toml:"metric-storage" json:"metric-storage"` // There are some values supported: "auto", "none", or a specific address, default: "auto" DashboardAddress string `toml:"dashboard-address" json:"dashboard-address"` // TraceRegionFlow the option to update flow information of regions. // WARN: TraceRegionFlow is deprecated. TraceRegionFlow bool `toml:"trace-region-flow" json:"trace-region-flow,string,omitempty"` // FlowRoundByDigit used to discretization processing flow information. FlowRoundByDigit int `toml:"flow-round-by-digit" json:"flow-round-by-digit"` // MinResolvedTSPersistenceInterval is the interval to save the min resolved ts. MinResolvedTSPersistenceInterval typeutil.Duration `toml:"min-resolved-ts-persistence-interval" json:"min-resolved-ts-persistence-interval"` // ServerMemoryLimit indicates the memory limit of current process. ServerMemoryLimit float64 `toml:"server-memory-limit" json:"server-memory-limit"` // ServerMemoryLimitGCTrigger indicates the gc percentage of the ServerMemoryLimit. ServerMemoryLimitGCTrigger float64 `toml:"server-memory-limit-gc-trigger" json:"server-memory-limit-gc-trigger"` // EnableGOGCTuner is to enable GOGC tuner. it can tuner GOGC. EnableGOGCTuner bool `toml:"enable-gogc-tuner" json:"enable-gogc-tuner,string"` // GCTunerThreshold is the threshold of GC tuner. GCTunerThreshold float64 `toml:"gc-tuner-threshold" json:"gc-tuner-threshold"` // BlockSafePointV1 is used to control gc safe point v1 and service safe point v1 can not be updated. BlockSafePointV1 bool `toml:"block-safe-point-v1" json:"block-safe-point-v1,string"` }
PDServerConfig is the configuration for pd server. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
func (*PDServerConfig) Clone ¶
func (c *PDServerConfig) Clone() *PDServerConfig
Clone returns a cloned PD server config.
func (*PDServerConfig) MigrateDeprecatedFlags ¶
func (c *PDServerConfig) MigrateDeprecatedFlags()
MigrateDeprecatedFlags updates new flags according to deprecated flags.
func (*PDServerConfig) Validate ¶
func (c *PDServerConfig) Validate() error
Validate is used to validate if some pd-server configurations are right.
type PersistOptions ¶
type PersistOptions struct {
// contains filtered or unexported fields
}
PersistOptions wraps all configurations that need to persist to storage and allows to access them safely.
func NewPersistOptions ¶
func NewPersistOptions(cfg *Config) *PersistOptions
NewPersistOptions creates a new PersistOptions instance.
func (*PersistOptions) AddSchedulerCfg ¶
func (o *PersistOptions) AddSchedulerCfg(tp string, args []string)
AddSchedulerCfg adds the scheduler configurations.
func (*PersistOptions) CASClusterVersion ¶
func (o *PersistOptions) CASClusterVersion(old, new *semver.Version) bool
CASClusterVersion sets the cluster version.
func (*PersistOptions) CheckLabelProperty ¶
func (o *PersistOptions) CheckLabelProperty(typ string, labels []*metapb.StoreLabel) bool
CheckLabelProperty checks the label property.
func (*PersistOptions) CheckRegionKeys ¶
func (o *PersistOptions) CheckRegionKeys(keys, mergeKeys uint64) error
CheckRegionKeys return error if the smallest region's keys is less than mergeKeys
func (*PersistOptions) CheckRegionSize ¶
func (o *PersistOptions) CheckRegionSize(size, mergeSize uint64) error
CheckRegionSize return error if the smallest region's size is less than mergeSize
func (*PersistOptions) DeleteLabelProperty ¶
func (o *PersistOptions) DeleteLabelProperty(typ, labelKey, labelValue string)
DeleteLabelProperty deletes the label property.
func (*PersistOptions) GetAllStoresLimit ¶
func (o *PersistOptions) GetAllStoresLimit() map[uint64]sc.StoreLimitConfig
GetAllStoresLimit returns the limit of all stores.
func (*PersistOptions) GetClusterVersion ¶
func (o *PersistOptions) GetClusterVersion() *semver.Version
GetClusterVersion returns the cluster version.
func (*PersistOptions) GetDashboardAddress ¶
func (o *PersistOptions) GetDashboardAddress() string
GetDashboardAddress gets dashboard address.
func (*PersistOptions) GetEnableGOGCTuner ¶
func (o *PersistOptions) GetEnableGOGCTuner() bool
GetEnableGOGCTuner gets the EnableGOGCTuner config.
func (*PersistOptions) GetGCTunerThreshold ¶
func (o *PersistOptions) GetGCTunerThreshold() float64
GetGCTunerThreshold gets the GC tuner threshold.
func (*PersistOptions) GetHighSpaceRatio ¶
func (o *PersistOptions) GetHighSpaceRatio() float64
GetHighSpaceRatio returns the high space ratio.
func (*PersistOptions) GetHotRegionCacheHitsThreshold ¶
func (o *PersistOptions) GetHotRegionCacheHitsThreshold() int
GetHotRegionCacheHitsThreshold is a threshold to decide if a region is hot.
func (*PersistOptions) GetHotRegionScheduleLimit ¶
func (o *PersistOptions) GetHotRegionScheduleLimit() uint64
GetHotRegionScheduleLimit returns the limit for hot region schedule.
func (*PersistOptions) GetHotRegionsReservedDays ¶
func (o *PersistOptions) GetHotRegionsReservedDays() uint64
GetHotRegionsReservedDays gets days hot region information is kept.
func (*PersistOptions) GetHotRegionsWriteInterval ¶
func (o *PersistOptions) GetHotRegionsWriteInterval() time.Duration
GetHotRegionsWriteInterval gets interval for PD to store Hot Region information.
func (*PersistOptions) GetIsolationLevel ¶
func (o *PersistOptions) GetIsolationLevel() string
GetIsolationLevel returns the isolation label for each region.
func (*PersistOptions) GetKeyType ¶
func (o *PersistOptions) GetKeyType() constant.KeyType
GetKeyType is to get key type.
func (*PersistOptions) GetKeyspaceConfig ¶
func (o *PersistOptions) GetKeyspaceConfig() *KeyspaceConfig
GetKeyspaceConfig returns the keyspace config.
func (*PersistOptions) GetLabelPropertyConfig ¶
func (o *PersistOptions) GetLabelPropertyConfig() LabelPropertyConfig
GetLabelPropertyConfig returns the label property.
func (*PersistOptions) GetLeaderScheduleLimit ¶
func (o *PersistOptions) GetLeaderScheduleLimit() uint64
GetLeaderScheduleLimit returns the limit for leader schedule.
func (*PersistOptions) GetLeaderSchedulePolicy ¶
func (o *PersistOptions) GetLeaderSchedulePolicy() constant.SchedulePolicy
GetLeaderSchedulePolicy is to get leader schedule policy.
func (*PersistOptions) GetLocationLabels ¶
func (o *PersistOptions) GetLocationLabels() []string
GetLocationLabels returns the location labels for each region.
func (*PersistOptions) GetLowSpaceRatio ¶
func (o *PersistOptions) GetLowSpaceRatio() float64
GetLowSpaceRatio returns the low space ratio.
func (*PersistOptions) GetMaxMergeRegionKeys ¶
func (o *PersistOptions) GetMaxMergeRegionKeys() uint64
GetMaxMergeRegionKeys returns the max number of keys. It returns size * 10000 if the key of max-merge-region-Keys doesn't exist.
func (*PersistOptions) GetMaxMergeRegionSize ¶
func (o *PersistOptions) GetMaxMergeRegionSize() uint64
GetMaxMergeRegionSize returns the max region size.
func (*PersistOptions) GetMaxMovableHotPeerSize ¶
func (o *PersistOptions) GetMaxMovableHotPeerSize() int64
GetMaxMovableHotPeerSize returns the max movable hot peer size.
func (*PersistOptions) GetMaxPendingPeerCount ¶
func (o *PersistOptions) GetMaxPendingPeerCount() uint64
GetMaxPendingPeerCount returns the number of the max pending peers.
func (*PersistOptions) GetMaxReplicas ¶
func (o *PersistOptions) GetMaxReplicas() int
GetMaxReplicas returns the number of replicas for each region.
func (*PersistOptions) GetMaxResetTSGap ¶
func (o *PersistOptions) GetMaxResetTSGap() time.Duration
GetMaxResetTSGap gets the max gap to reset the tso.
func (*PersistOptions) GetMaxSnapshotCount ¶
func (o *PersistOptions) GetMaxSnapshotCount() uint64
GetMaxSnapshotCount returns the number of the max snapshot which is allowed to send.
func (*PersistOptions) GetMaxStoreDownTime ¶
func (o *PersistOptions) GetMaxStoreDownTime() time.Duration
GetMaxStoreDownTime returns the max down time of a store.
func (*PersistOptions) GetMaxStorePreparingTime ¶
func (o *PersistOptions) GetMaxStorePreparingTime() time.Duration
GetMaxStorePreparingTime returns the max preparing time of a store.
func (*PersistOptions) GetMergeScheduleLimit ¶
func (o *PersistOptions) GetMergeScheduleLimit() uint64
GetMergeScheduleLimit returns the limit for merge schedule.
func (*PersistOptions) GetMicroServiceConfig ¶
func (o *PersistOptions) GetMicroServiceConfig() *MicroServiceConfig
GetMicroServiceConfig returns the micro service configuration.
func (*PersistOptions) GetMinResolvedTSPersistenceInterval ¶
func (o *PersistOptions) GetMinResolvedTSPersistenceInterval() time.Duration
GetMinResolvedTSPersistenceInterval gets the interval for PD to save min resolved ts.
func (*PersistOptions) GetPDServerConfig ¶
func (o *PersistOptions) GetPDServerConfig() *PDServerConfig
GetPDServerConfig returns pd server configurations.
func (*PersistOptions) GetPatrolRegionInterval ¶
func (o *PersistOptions) GetPatrolRegionInterval() time.Duration
GetPatrolRegionInterval returns the interval of patrolling region.
func (*PersistOptions) GetRegionBucketSize ¶
func (o *PersistOptions) GetRegionBucketSize() uint64
GetRegionBucketSize returns the region bucket size.
func (*PersistOptions) GetRegionMaxKeys ¶
func (o *PersistOptions) GetRegionMaxKeys() uint64
GetRegionMaxKeys returns the max region keys
func (*PersistOptions) GetRegionMaxSize ¶
func (o *PersistOptions) GetRegionMaxSize() uint64
GetRegionMaxSize returns the max region size in MB
func (*PersistOptions) GetRegionScheduleLimit ¶
func (o *PersistOptions) GetRegionScheduleLimit() uint64
GetRegionScheduleLimit returns the limit for region schedule.
func (*PersistOptions) GetRegionScoreFormulaVersion ¶
func (o *PersistOptions) GetRegionScoreFormulaVersion() string
GetRegionScoreFormulaVersion returns the formula version config.
func (*PersistOptions) GetRegionSplitKeys ¶
func (o *PersistOptions) GetRegionSplitKeys() uint64
GetRegionSplitKeys returns the region split keys
func (*PersistOptions) GetRegionSplitSize ¶
func (o *PersistOptions) GetRegionSplitSize() uint64
GetRegionSplitSize returns the region split size in MB
func (*PersistOptions) GetReplicaScheduleLimit ¶
func (o *PersistOptions) GetReplicaScheduleLimit() uint64
GetReplicaScheduleLimit returns the limit for replica schedule.
func (*PersistOptions) GetReplicationConfig ¶
func (o *PersistOptions) GetReplicationConfig() *sc.ReplicationConfig
GetReplicationConfig returns replication configurations.
func (*PersistOptions) GetReplicationModeConfig ¶
func (o *PersistOptions) GetReplicationModeConfig() *ReplicationModeConfig
GetReplicationModeConfig returns the replication mode config.
func (*PersistOptions) GetScheduleConfig ¶
func (o *PersistOptions) GetScheduleConfig() *sc.ScheduleConfig
GetScheduleConfig returns scheduling configurations.
func (*PersistOptions) GetSchedulerMaxWaitingOperator ¶
func (o *PersistOptions) GetSchedulerMaxWaitingOperator() uint64
GetSchedulerMaxWaitingOperator returns the number of the max waiting operators.
func (*PersistOptions) GetSchedulers ¶
func (o *PersistOptions) GetSchedulers() sc.SchedulerConfigs
GetSchedulers gets the scheduler configurations.
func (*PersistOptions) GetServerMemoryLimit ¶
func (o *PersistOptions) GetServerMemoryLimit() float64
GetServerMemoryLimit gets ServerMemoryLimit config.
func (*PersistOptions) GetServerMemoryLimitGCTrigger ¶
func (o *PersistOptions) GetServerMemoryLimitGCTrigger() float64
GetServerMemoryLimitGCTrigger gets the ServerMemoryLimitGCTrigger config.
func (*PersistOptions) GetSlowStoreEvictingAffectedStoreRatioThreshold ¶
func (o *PersistOptions) GetSlowStoreEvictingAffectedStoreRatioThreshold() float64
GetSlowStoreEvictingAffectedStoreRatioThreshold returns the affected ratio threshold when judging a store is slow.
func (*PersistOptions) GetSplitMergeInterval ¶
func (o *PersistOptions) GetSplitMergeInterval() time.Duration
GetSplitMergeInterval returns the interval between finishing split and starting to merge.
func (*PersistOptions) GetStoreConfig ¶
func (o *PersistOptions) GetStoreConfig() *sc.StoreConfig
GetStoreConfig returns the store config.
func (*PersistOptions) GetStoreLimit ¶
func (o *PersistOptions) GetStoreLimit(storeID uint64) (returnSC sc.StoreLimitConfig)
GetStoreLimit returns the limit of a store.
func (*PersistOptions) GetStoreLimitByType ¶
func (o *PersistOptions) GetStoreLimitByType(storeID uint64, typ storelimit.Type) (returned float64)
GetStoreLimitByType returns the limit of a store with a given type.
func (*PersistOptions) GetStoreLimitVersion ¶
func (o *PersistOptions) GetStoreLimitVersion() string
GetStoreLimitVersion returns the limit version of store.
func (*PersistOptions) GetStoresLimit ¶
func (o *PersistOptions) GetStoresLimit() map[uint64]sc.StoreLimitConfig
GetStoresLimit gets the stores' limit.
func (*PersistOptions) GetStrictlyMatchLabel ¶
func (o *PersistOptions) GetStrictlyMatchLabel() bool
GetStrictlyMatchLabel returns whether check label strict.
func (*PersistOptions) GetSwitchWitnessInterval ¶
func (o *PersistOptions) GetSwitchWitnessInterval() time.Duration
GetSwitchWitnessInterval returns the interval between promote to non-witness and starting to switch to witness.
func (*PersistOptions) GetTTLData ¶
func (o *PersistOptions) GetTTLData(key string) (string, bool)
GetTTLData returns if there is a TTL data for a given key.
func (*PersistOptions) GetTolerantSizeRatio ¶
func (o *PersistOptions) GetTolerantSizeRatio() float64
GetTolerantSizeRatio gets the tolerant size ratio.
func (*PersistOptions) GetWitnessScheduleLimit ¶
func (o *PersistOptions) GetWitnessScheduleLimit() uint64
GetWitnessScheduleLimit returns the limit for region schedule.
func (*PersistOptions) IsCrossTableMergeEnabled ¶
func (o *PersistOptions) IsCrossTableMergeEnabled() bool
IsCrossTableMergeEnabled returns if across table merge is enabled.
func (*PersistOptions) IsDebugMetricsEnabled ¶
func (o *PersistOptions) IsDebugMetricsEnabled() bool
IsDebugMetricsEnabled returns if debug metrics is enabled.
func (*PersistOptions) IsDiagnosticAllowed ¶
func (o *PersistOptions) IsDiagnosticAllowed() bool
IsDiagnosticAllowed returns whether is enable to use diagnostic.
func (*PersistOptions) IsEnableRegionBucket ¶
func (o *PersistOptions) IsEnableRegionBucket() bool
IsEnableRegionBucket return true if the region bucket is enabled.
func (*PersistOptions) IsLocationReplacementEnabled ¶
func (o *PersistOptions) IsLocationReplacementEnabled() bool
IsLocationReplacementEnabled returns if location replace is enabled.
func (*PersistOptions) IsMakeUpReplicaEnabled ¶
func (o *PersistOptions) IsMakeUpReplicaEnabled() bool
IsMakeUpReplicaEnabled returns if make up replica is enabled.
func (*PersistOptions) IsOneWayMergeEnabled ¶
func (o *PersistOptions) IsOneWayMergeEnabled() bool
IsOneWayMergeEnabled returns if a region can only be merged into the next region of it.
func (*PersistOptions) IsPlacementRulesCacheEnabled ¶
func (o *PersistOptions) IsPlacementRulesCacheEnabled() bool
IsPlacementRulesCacheEnabled returns if the placement rules cache is enabled
func (*PersistOptions) IsPlacementRulesEnabled ¶
func (o *PersistOptions) IsPlacementRulesEnabled() bool
IsPlacementRulesEnabled returns if the placement rules is enabled.
func (*PersistOptions) IsRaftKV2 ¶
func (o *PersistOptions) IsRaftKV2() bool
IsRaftKV2 returns true if the raft kv is v2.
func (*PersistOptions) IsRemoveDownReplicaEnabled ¶
func (o *PersistOptions) IsRemoveDownReplicaEnabled() bool
IsRemoveDownReplicaEnabled returns if remove down replica is enabled.
func (*PersistOptions) IsRemoveExtraReplicaEnabled ¶
func (o *PersistOptions) IsRemoveExtraReplicaEnabled() bool
IsRemoveExtraReplicaEnabled returns if remove extra replica is enabled.
func (*PersistOptions) IsReplaceOfflineReplicaEnabled ¶
func (o *PersistOptions) IsReplaceOfflineReplicaEnabled() bool
IsReplaceOfflineReplicaEnabled returns if replace offline replica is enabled.
func (*PersistOptions) IsSchedulerDisabled ¶
func (o *PersistOptions) IsSchedulerDisabled(t string) bool
IsSchedulerDisabled returns if the scheduler is disabled.
func (*PersistOptions) IsSchedulingHalted ¶
func (o *PersistOptions) IsSchedulingHalted() bool
IsSchedulingHalted returns if PD scheduling is halted.
func (*PersistOptions) IsTikvRegionSplitEnabled ¶
func (o *PersistOptions) IsTikvRegionSplitEnabled() bool
IsTikvRegionSplitEnabled returns whether tikv split region is enabled.
func (*PersistOptions) IsTraceRegionFlow ¶
func (o *PersistOptions) IsTraceRegionFlow() bool
IsTraceRegionFlow returns if the region flow is tracing. If the accuracy cannot reach 0.1 MB, it is considered not.
func (*PersistOptions) IsUseJointConsensus ¶
func (o *PersistOptions) IsUseJointConsensus() bool
IsUseJointConsensus returns if using joint consensus as an operator step is enabled.
func (*PersistOptions) IsUseRegionStorage ¶
func (o *PersistOptions) IsUseRegionStorage() bool
IsUseRegionStorage returns if the independent region storage is enabled.
func (*PersistOptions) IsWitnessAllowed ¶
func (o *PersistOptions) IsWitnessAllowed() bool
IsWitnessAllowed returns whether is enable to use witness.
func (*PersistOptions) LoadTTLFromEtcd ¶
LoadTTLFromEtcd loads temporary configuration which was persisted into etcd
func (*PersistOptions) Persist ¶
func (o *PersistOptions) Persist(storage endpoint.ConfigStorage) error
Persist saves the configuration to the storage.
func (*PersistOptions) Reload ¶
func (o *PersistOptions) Reload(storage endpoint.ConfigStorage) error
Reload reloads the configuration from the storage.
func (*PersistOptions) RemoveSchedulerCfg ¶
func (o *PersistOptions) RemoveSchedulerCfg(tp string)
RemoveSchedulerCfg removes the scheduler configurations.
func (*PersistOptions) SetAllStoresLimit ¶
func (o *PersistOptions) SetAllStoresLimit(typ storelimit.Type, ratePerMin float64)
SetAllStoresLimit sets all store limit for a given type and rate.
func (*PersistOptions) SetAllStoresLimitTTL ¶
func (o *PersistOptions) SetAllStoresLimitTTL(ctx context.Context, client *clientv3.Client, typ storelimit.Type, ratePerMin float64, ttl time.Duration) error
SetAllStoresLimitTTL sets all store limit for a given type and rate with ttl.
func (*PersistOptions) SetClusterVersion ¶
func (o *PersistOptions) SetClusterVersion(v *semver.Version)
SetClusterVersion sets the cluster version.
func (*PersistOptions) SetEnableDiagnostic ¶
func (o *PersistOptions) SetEnableDiagnostic(enable bool)
SetEnableDiagnostic to set the option for diagnose. It's only used to test.
func (*PersistOptions) SetEnableUseJointConsensus ¶
func (o *PersistOptions) SetEnableUseJointConsensus(enable bool)
SetEnableUseJointConsensus to set the option for using joint consensus. It's only used to test.
func (*PersistOptions) SetEnableWitness ¶
func (o *PersistOptions) SetEnableWitness(enable bool)
SetEnableWitness to set the option for witness. It's only used to test.
func (*PersistOptions) SetHaltScheduling ¶
func (o *PersistOptions) SetHaltScheduling(halt bool, source string)
SetHaltScheduling set HaltScheduling.
func (*PersistOptions) SetKeyspaceConfig ¶
func (o *PersistOptions) SetKeyspaceConfig(cfg *KeyspaceConfig)
SetKeyspaceConfig sets the keyspace configuration.
func (*PersistOptions) SetLabelProperty ¶
func (o *PersistOptions) SetLabelProperty(typ, labelKey, labelValue string)
SetLabelProperty sets the label property.
func (*PersistOptions) SetLabelPropertyConfig ¶
func (o *PersistOptions) SetLabelPropertyConfig(cfg LabelPropertyConfig)
SetLabelPropertyConfig sets the label property configuration.
func (*PersistOptions) SetLocationLabels ¶
func (o *PersistOptions) SetLocationLabels(labels []string)
SetLocationLabels sets the location labels.
func (*PersistOptions) SetMaxMergeRegionKeys ¶
func (o *PersistOptions) SetMaxMergeRegionKeys(maxMergeRegionKeys uint64)
SetMaxMergeRegionKeys sets the max merge region keys.
func (*PersistOptions) SetMaxMergeRegionSize ¶
func (o *PersistOptions) SetMaxMergeRegionSize(maxMergeRegionSize uint64)
SetMaxMergeRegionSize sets the max merge region size.
func (*PersistOptions) SetMaxReplicas ¶
func (o *PersistOptions) SetMaxReplicas(replicas int)
SetMaxReplicas sets the number of replicas for each region.
func (*PersistOptions) SetMaxStoreDownTime ¶
func (o *PersistOptions) SetMaxStoreDownTime(time time.Duration)
SetMaxStoreDownTime to set the max store down time. It's only used to test.
func (*PersistOptions) SetMicroServiceConfig ¶
func (o *PersistOptions) SetMicroServiceConfig(cfg *MicroServiceConfig)
SetMicroServiceConfig sets the micro service configuration.
func (*PersistOptions) SetPDServerConfig ¶
func (o *PersistOptions) SetPDServerConfig(cfg *PDServerConfig)
SetPDServerConfig sets the PD configuration.
func (*PersistOptions) SetPlacementRuleEnabled ¶
func (o *PersistOptions) SetPlacementRuleEnabled(enabled bool)
SetPlacementRuleEnabled set PlacementRuleEnabled
func (*PersistOptions) SetPlacementRulesCacheEnabled ¶
func (o *PersistOptions) SetPlacementRulesCacheEnabled(enabled bool)
SetPlacementRulesCacheEnabled set EnablePlacementRulesCache
func (*PersistOptions) SetRegionBucketEnabled ¶
func (o *PersistOptions) SetRegionBucketEnabled(enabled bool)
SetRegionBucketEnabled sets if the region bucket is enabled. only used for test.
func (*PersistOptions) SetReplicationConfig ¶
func (o *PersistOptions) SetReplicationConfig(cfg *sc.ReplicationConfig)
SetReplicationConfig sets the PD replication configuration.
func (*PersistOptions) SetReplicationModeConfig ¶
func (o *PersistOptions) SetReplicationModeConfig(cfg *ReplicationModeConfig)
SetReplicationModeConfig sets the replication mode config.
func (*PersistOptions) SetScheduleConfig ¶
func (o *PersistOptions) SetScheduleConfig(cfg *sc.ScheduleConfig)
SetScheduleConfig sets the PD scheduling configuration.
func (*PersistOptions) SetSchedulingAllowanceStatus ¶
func (*PersistOptions) SetSchedulingAllowanceStatus(halt bool, source string)
SetSchedulingAllowanceStatus sets the scheduling allowance status to help distinguish the source of the halt.
func (*PersistOptions) SetSplitMergeInterval ¶
func (o *PersistOptions) SetSplitMergeInterval(splitMergeInterval time.Duration)
SetSplitMergeInterval to set the interval between finishing split and starting to merge. It's only used to test.
func (*PersistOptions) SetStoreConfig ¶
func (o *PersistOptions) SetStoreConfig(cfg *sc.StoreConfig)
SetStoreConfig sets the store configuration.
func (*PersistOptions) SetStoreLimit ¶
func (o *PersistOptions) SetStoreLimit(storeID uint64, typ storelimit.Type, ratePerMin float64)
SetStoreLimit sets a store limit for a given type and rate.
func (*PersistOptions) SetTTLData ¶
func (o *PersistOptions) SetTTLData(parCtx context.Context, client *clientv3.Client, key string, value string, ttl time.Duration) error
SetTTLData set temporary configuration
func (*PersistOptions) SwitchRaftV2 ¶
func (o *PersistOptions) SwitchRaftV2(storage endpoint.ConfigStorage) error
SwitchRaftV2 update some config if tikv raft engine switch into partition raft v2
type RateLimitConfig ¶
type RateLimitConfig struct { // EnableRateLimit controls the switch of the rate limit middleware EnableRateLimit bool `json:"enable-rate-limit,string"` // RateLimitConfig is the config of rate limit middleware LimiterConfig map[string]ratelimit.DimensionConfig `json:"limiter-config"` }
RateLimitConfig is the configuration for rate limit
func (*RateLimitConfig) Clone ¶
func (c *RateLimitConfig) Clone() *RateLimitConfig
Clone returns a cloned rate limit config.
type ReplicationModeConfig ¶
type ReplicationModeConfig struct { ReplicationMode string `toml:"replication-mode" json:"replication-mode"` // can be 'dr-auto-sync' or 'majority', default value is 'majority' DRAutoSync DRAutoSyncReplicationConfig `toml:"dr-auto-sync" json:"dr-auto-sync"` // used when ReplicationMode is 'dr-auto-sync' }
ReplicationModeConfig is the configuration for the replication policy. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
func (*ReplicationModeConfig) Clone ¶
func (c *ReplicationModeConfig) Clone() *ReplicationModeConfig
Clone returns a copy of replication mode config.
type ServiceMiddlewareConfig ¶
type ServiceMiddlewareConfig struct { AuditConfig `json:"audit"` RateLimitConfig `json:"rate-limit"` GRPCRateLimitConfig `json:"grpc-rate-limit"` }
ServiceMiddlewareConfig is the configuration for PD Service middleware.
func NewServiceMiddlewareConfig ¶
func NewServiceMiddlewareConfig() *ServiceMiddlewareConfig
NewServiceMiddlewareConfig returns a new service middleware config
func (*ServiceMiddlewareConfig) Clone ¶
func (c *ServiceMiddlewareConfig) Clone() *ServiceMiddlewareConfig
Clone returns a cloned service middleware configuration.
type ServiceMiddlewarePersistOptions ¶
type ServiceMiddlewarePersistOptions struct {
// contains filtered or unexported fields
}
ServiceMiddlewarePersistOptions wraps all service middleware configurations that need to persist to storage and allows to access them safely.
func NewServiceMiddlewarePersistOptions ¶
func NewServiceMiddlewarePersistOptions(cfg *ServiceMiddlewareConfig) *ServiceMiddlewarePersistOptions
NewServiceMiddlewarePersistOptions creates a new ServiceMiddlewarePersistOptions instance.
func (*ServiceMiddlewarePersistOptions) GetAuditConfig ¶
func (o *ServiceMiddlewarePersistOptions) GetAuditConfig() *AuditConfig
GetAuditConfig returns pd service middleware configurations.
func (*ServiceMiddlewarePersistOptions) GetGRPCRateLimitConfig ¶
func (o *ServiceMiddlewarePersistOptions) GetGRPCRateLimitConfig() *GRPCRateLimitConfig
GetGRPCRateLimitConfig returns pd service middleware configurations.
func (*ServiceMiddlewarePersistOptions) GetRateLimitConfig ¶
func (o *ServiceMiddlewarePersistOptions) GetRateLimitConfig() *RateLimitConfig
GetRateLimitConfig returns pd service middleware configurations.
func (*ServiceMiddlewarePersistOptions) IsAuditEnabled ¶
func (o *ServiceMiddlewarePersistOptions) IsAuditEnabled() bool
IsAuditEnabled returns whether audit middleware is enabled
func (*ServiceMiddlewarePersistOptions) IsGRPCRateLimitEnabled ¶
func (o *ServiceMiddlewarePersistOptions) IsGRPCRateLimitEnabled() bool
IsGRPCRateLimitEnabled returns whether rate limit middleware is enabled
func (*ServiceMiddlewarePersistOptions) IsRateLimitEnabled ¶
func (o *ServiceMiddlewarePersistOptions) IsRateLimitEnabled() bool
IsRateLimitEnabled returns whether rate limit middleware is enabled
func (*ServiceMiddlewarePersistOptions) Persist ¶
func (o *ServiceMiddlewarePersistOptions) Persist(storage endpoint.ServiceMiddlewareStorage) error
Persist saves the configuration to the storage.
func (*ServiceMiddlewarePersistOptions) Reload ¶
func (o *ServiceMiddlewarePersistOptions) Reload(storage endpoint.ServiceMiddlewareStorage) error
Reload reloads the configuration from the storage.
func (*ServiceMiddlewarePersistOptions) SetAuditConfig ¶
func (o *ServiceMiddlewarePersistOptions) SetAuditConfig(cfg *AuditConfig)
SetAuditConfig sets the PD service middleware configuration.
func (*ServiceMiddlewarePersistOptions) SetGRPCRateLimitConfig ¶
func (o *ServiceMiddlewarePersistOptions) SetGRPCRateLimitConfig(cfg *GRPCRateLimitConfig)
SetGRPCRateLimitConfig sets the PD service middleware configuration.
func (*ServiceMiddlewarePersistOptions) SetRateLimitConfig ¶
func (o *ServiceMiddlewarePersistOptions) SetRateLimitConfig(cfg *RateLimitConfig)
SetRateLimitConfig sets the PD service middleware configuration.
type StoreLabel ¶
type StoreLabel struct { Key string `toml:"key" json:"key"` Value string `toml:"value" json:"value"` }
StoreLabel is the config item of LabelPropertyConfig.