mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-07-06 00:04:02 +00:00
filer: default cassandra2 timeout and ydb prefix so env-var configs match the scaffold (#10234)
* cassandra2: default connection_timeout_millisecond so env-var configs keep the 600ms timeout The scaffold documents a 600ms default, but the value has no SetDefault. A config supplied purely through env vars (or a minimal toml) that omits the key read back 0, silently overriding the client timeout with no bound. * ydb: default the table path prefix so env-var configs keep the seaweedfs sub-path The scaffold documents prefix = "seaweedfs", but with no SetDefault a config that omits it lands tables at the database root instead of under seaweedfs/.
This commit is contained in:
@@ -31,6 +31,8 @@ func (store *Cassandra2Store) GetName() string {
|
||||
}
|
||||
|
||||
func (store *Cassandra2Store) Initialize(configuration util.Configuration, prefix string) (err error) {
|
||||
// Without this, an env-var config that omits the key drops cluster.Timeout to 0.
|
||||
configuration.SetDefault(prefix+"connection_timeout_millisecond", 600)
|
||||
enableHostVerification := true
|
||||
if val := configuration.GetString(prefix + "ssl_enable_host_verification"); val != "" {
|
||||
enableHostVerification = configuration.GetBool(prefix + "ssl_enable_host_verification")
|
||||
|
||||
@@ -33,6 +33,7 @@ const (
|
||||
defaultMinPartitionsCount = 5
|
||||
defaultMaxPartitionsCount = 1000
|
||||
defaultMaxListChunk = 2000
|
||||
defaultTablePathPrefix = "seaweedfs"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -64,6 +65,7 @@ func (store *YdbStore) GetName() string {
|
||||
}
|
||||
|
||||
func (store *YdbStore) Initialize(configuration util.Configuration, prefix string) (err error) {
|
||||
configuration.SetDefault(prefix+"prefix", defaultTablePathPrefix)
|
||||
configuration.SetDefault(prefix+"partitionBySizeEnabled", defaultPartitionBySizeEnabled)
|
||||
configuration.SetDefault(prefix+"partitionSizeMb", defaultPartitionSizeMb)
|
||||
configuration.SetDefault(prefix+"partitionByLoadEnabled", defaultPartitionByLoadEnabled)
|
||||
|
||||
Reference in New Issue
Block a user