Beispiel #1
0
func NewConfig() Config {
	return Config{
		MaxWALSize:             DefaultMaxWALSize,
		WALFlushInterval:       toml.Duration(DefaultWALFlushInterval),
		WALPartitionFlushDelay: toml.Duration(DefaultWALPartitionFlushDelay),
	}
}
Beispiel #2
0
func NewConfig() *Config {
	return &Config{
		Hostname:            DefaultHostname,
		BindAddress:         DefaultBindAddress,
		RetentionAutoCreate: true,
		ElectionTimeout:     toml.Duration(DefaultElectionTimeout),
		HeartbeatTimeout:    toml.Duration(DefaultHeartbeatTimeout),
		LeaderLeaseTimeout:  toml.Duration(DefaultLeaderLeaseTimeout),
		CommitTimeout:       toml.Duration(DefaultCommitTimeout),
	}
}
Beispiel #3
0
// NewConfig returns the default test configuration.
func NewConfig(path string) *meta.Config {
	return &meta.Config{
		Dir:                path,
		Hostname:           "localhost",
		BindAddress:        "127.0.0.1:0",
		HeartbeatTimeout:   toml.Duration(500 * time.Millisecond),
		ElectionTimeout:    toml.Duration(500 * time.Millisecond),
		LeaderLeaseTimeout: toml.Duration(500 * time.Millisecond),
		CommitTimeout:      toml.Duration(5 * time.Millisecond),
	}
}