opts

package
v0.0.0-...-db32783 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHealthCheckTickerInterval = uint(10)
	DefaultSOSNDBuffer               = 1024 * 1024
	DefaultSORCVBuffer               = 1024 * 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// region level configuration.
	DisklessMode           bool   `mapstructure:"diskless"  desc:"Enables badger diskless mode where data is stored entirely in memory. "`
	NodeName               string `mapstructure:"node-name" desc:"Node Name"`
	DbEngine               string `mapstructure:"db-engine" desc:"Underlying DB engine for storing data - badger|rocksdb"`
	DbEngineIni            string `` /* 143-byte string literal not displayed */
	DbRole                 string `mapstructure:"role" desc:"Role of the node - master|slave|standalone|discovery"`
	ReplPollIntervalString string `mapstructure:"repl-poll-interval" desc:"Interval used for polling changes from master. Eg., 10s, 5ms, 2h, etc."`
	BlockCacheSize         uint64 `` /* 143-byte string literal not displayed */
	DcID                   string `mapstructure:"dc-id" desc:"DC / Availability zone identifier"`
	Database               string `mapstructure:"database" desc:"Database identifier"`
	VBucket                string `mapstructure:"vbucket" desc:"vBucket identifier"`

	// Storage Configuration
	RootFolder string `mapstructure:"root-folder" desc:"Root Dir (optional)"` // used to derive other folders if not defined
	DbFolder   string `mapstructure:"db-folder" desc:"DB folder path for storing data files"`

	// Server Configuration
	ListenAddr     string `mapstructure:"listen-addr" desc:"Address on which the DKV service binds"`
	HttpListenAddr string `mapstructure:"http-listen-addr" desc:"Address on which the DKV service binds for http"`
	StatsdAddr     string `mapstructure:"statsd-addr" desc:"StatsD service address in host:port format"`

	//Service discovery related params
	DiscoveryConfig DiscoveryServiceConfiguration `mapstructure:"discovery-service" desc:"config for discovery server"`
	//Disable discovery client
	DisableDiscoveryClient bool `mapstructure:"disable-discovery-client" desc:"Disable registration to discovery-server"`

	// Temporary variables to be removed once https://github.com/flipkart-incubator/dkv/issues/82 is fixed
	// The above issue causes replication issues during master switch due to inconsistent change numbers
	// Thus enabling hardcoded masters to not degrade current behaviour
	ReplicationMasterAddr string `mapstructure:"repl-master-addr" desc:"Service address of DKV master node for replication"`

	// Logging vars
	AccessLog string `mapstructure:"access-log" desc:"File for logging DKV accesses eg., stdout, stderr, /tmp/access.log"`
	LogLevel  string `mapstructure:"log-level" desc:"Log level for logging info|warn|debug|error"`

	ReplPollInterval time.Duration

	//Nexus vars
	NexusClusterName            string `mapstructure:"nexus-cluster-name" desc:"Nexus Cluster Name"`
	NexusNodeUrl                string `mapstructure:"nexus-node-url" desc:"Nexus Node URL (format: http://<local_node>:<port_num>)"`
	NexusClusterUrl             string `mapstructure:"nexus-cluster-url" desc:"Comma separated list of Nexus URLs of other nodes in the cluster"`
	NexusLeaseBasedReads        bool   `mapstructure:"nexus-lease-based-reads" desc:"Perform reads using RAFT leader leases"`
	NexusReplTimeout            int    `mapstructure:"nexus-repl-timeout" desc:"Replication timeout in seconds"`
	NexusLogDir                 string `mapstructure:"nexus-log-dir" desc:"Dir for storing RAFT logs"`
	NexusSnapDir                string `mapstructure:"nexus-snap-dir" desc:"Dir for storing RAFT snapshots"`
	NexusEntryDir               string `mapstructure:"nexus-entry-dir" desc:"Dir for storing RAFT entries"`
	NexusEntryStoreEngine       string `mapstructure:"nexus-entry-store" desc:"Nexus Entry store engine memory|disk"`
	NexusMaxSnapshots           int    `mapstructure:"nexus-max-snapshots" desc:"Maximum number of snapshot files to retain (0 is unlimited)"`
	NexusMaxWals                int    `mapstructure:"nexus-max-wals" desc:"Maximum number of WAL files to retain (0 is unlimited)"`
	NexusSnapshotCatchupEntries int    `` /* 144-byte string literal not displayed */
	NexusSnapshotCount          int    `mapstructure:"nexus-snapshot-count" desc:"Number of committed transactions to trigger a snapshot to disk"`
}

func (*Config) Init

func (c *Config) Init(cfgFile string)

func (*Config) Print

func (c *Config) Print()

type DiscoveryClientConfig

type DiscoveryClientConfig struct {
	DiscoveryServiceAddr string `mapstructure:"discovery-service-addr"`
	// time in seconds to push status updates to discovery server
	PushStatusInterval time.Duration `mapstructure:"push-status-interval"`
	// time in seconds to poll cluster info from discovery server
	PollClusterInfoInterval time.Duration `mapstructure:"poll-cluster-info-interval"`
}

type DiscoveryServerConfig

type DiscoveryServerConfig struct {
	// time in seconds after which the status entry of the region & node combination can be purged
	StatusTTl int64 `mapstructure:"status-ttl"`
	// maximum time in seconds for the last status update to be considered valid
	// after exceeding this time the region & node combination can be marked invalid
	HeartbeatTimeout int64 `mapstructure:"heartbeat-timeout"`
}

type DiscoveryServiceConfiguration

type DiscoveryServiceConfiguration struct {
	//server side config for discovery service
	ServerConfig DiscoveryServerConfig `mapstructure:"server"`
	//client side config for discovery service
	ClientConfig DiscoveryClientConfig `mapstructure:"client"`
}

type ServerOpts

type ServerOpts struct {
	HealthCheckTickerInterval uint
	StatsCli                  stats.Client
	Logger                    *zap.Logger
	PrometheusRegistry        prometheus.Registerer
}

ServerOpts is a wrapper structure for all things related to cross-cutting concerns in DKV. All new configurations (e.g. health check interval), tools (e.g. logger, metric handler) should be wrapped in this struct.

Jump to

Keyboard shortcuts

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