config

package
v0.0.0-...-6576891 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 45

Documentation

Index

Constants

View Source
const MB = 1024 * 1024

MB represents the MB size.

Variables

View Source
var DefaultConf = Config{
	Config: config.DefaultConf,
	RaftStore: RaftStore{
		PdHeartbeatTickInterval:  "20s",
		RaftStoreMaxLeaderLease:  "9s",
		RaftBaseTickInterval:     "1s",
		RaftHeartbeatTicks:       2,
		RaftElectionTimeoutTicks: 10,
		CustomRaftLog:            true,
	},
}

DefaultConf returns the default configuration.

Functions

func ParseCompression

func ParseCompression(s string) options.CompressionType

ParseCompression parses the string s and returns a compression type.

func ParseDuration

func ParseDuration(durationStr string) time.Duration

ParseDuration parses duration argument string.

Types

type Config

type Config struct {
	config.Config
	RaftStore RaftStore `toml:"raftstore"` // RaftStore configs
}

Config contains configuration options.

type RaftStore

type RaftStore struct {
	PdHeartbeatTickInterval  string `toml:"pd-heartbeat-tick-interval"`  // pd-heartbeat-tick-interval in seconds
	RaftStoreMaxLeaderLease  string `toml:"raft-store-max-leader-lease"` // raft-store-max-leader-lease in milliseconds
	RaftBaseTickInterval     string `toml:"raft-base-tick-interval"`     // raft-base-tick-interval in milliseconds
	RaftHeartbeatTicks       int    `toml:"raft-heartbeat-ticks"`        // raft-heartbeat-ticks times
	RaftElectionTimeoutTicks int    `toml:"raft-election-timeout-ticks"` // raft-election-timeout-ticks times
	CustomRaftLog            bool   `toml:"custom-raft-log"`
}

RaftStore is the config for raft store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL