mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Create 'datadir' package responsible for paths.
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
"go.etcd.io/etcd/client/pkg/v3/transport"
|
||||
"go.etcd.io/etcd/client/pkg/v3/types"
|
||||
"go.etcd.io/etcd/pkg/v3/netutil"
|
||||
"go.etcd.io/etcd/server/v3/datadir"
|
||||
|
||||
bolt "go.etcd.io/bbolt"
|
||||
"go.uber.org/zap"
|
||||
@@ -274,13 +275,13 @@ func (c *ServerConfig) advertiseMatchesCluster() error {
|
||||
return fmt.Errorf("failed to resolve %s to match --initial-cluster=%s (%v)", apStr, umap.String(), err)
|
||||
}
|
||||
|
||||
func (c *ServerConfig) MemberDir() string { return filepath.Join(c.DataDir, "member") }
|
||||
func (c *ServerConfig) MemberDir() string { return datadir.ToMemberDir(c.DataDir) }
|
||||
|
||||
func (c *ServerConfig) WALDir() string {
|
||||
if c.DedicatedWALDir != "" {
|
||||
return c.DedicatedWALDir
|
||||
}
|
||||
return filepath.Join(c.MemberDir(), "wal")
|
||||
return datadir.ToWalDir(c.DataDir)
|
||||
}
|
||||
|
||||
func (c *ServerConfig) SnapDir() string { return filepath.Join(c.MemberDir(), "snap") }
|
||||
@@ -324,4 +325,4 @@ func (c *ServerConfig) BootstrapTimeoutEffective() time.Duration {
|
||||
return time.Second
|
||||
}
|
||||
|
||||
func (c *ServerConfig) BackendPath() string { return filepath.Join(c.SnapDir(), "db") }
|
||||
func (c *ServerConfig) BackendPath() string { return datadir.ToBackendFileName(c.DataDir) }
|
||||
|
||||
Reference in New Issue
Block a user