diff --git a/weed/filer/leveldb/leveldb_store.go b/weed/filer/leveldb/leveldb_store.go index 08dc33f02..747d1104d 100644 --- a/weed/filer/leveldb/leveldb_store.go +++ b/weed/filer/leveldb/leveldb_store.go @@ -43,11 +43,6 @@ func (store *LevelDBStore) Initialize(configuration weed_util.Configuration, pre return store.initialize(dir) } -// For adhoc usage -func (store *LevelDBStore) CustomInitialize(dir string) (err error) { - return store.initialize(dir) -} - func (store *LevelDBStore) initialize(dir string) (err error) { glog.Infof("filer store dir: %s", dir) os.MkdirAll(dir, 0755) diff --git a/weed/shell/command_fs_meta_snapshots_create.go b/weed/shell/command_fs_meta_snapshots_create.go index ebe12b536..bccff2230 100644 --- a/weed/shell/command_fs_meta_snapshots_create.go +++ b/weed/shell/command_fs_meta_snapshots_create.go @@ -30,6 +30,30 @@ func (c *commandFsMetaSnapshotsCreate) Name() string { return "fs.meta.snapshots.create" } +type SnapshotConfig struct { + dir string +} + +func (c SnapshotConfig) GetString(key string) string { + return c.dir +} + +func (c SnapshotConfig) GetBool(key string) bool { + panic("implement me") +} + +func (c SnapshotConfig) GetInt(key string) int { + panic("implement me") +} + +func (c SnapshotConfig) GetStringSlice(key string) []string { + panic("implement me") +} + +func (c SnapshotConfig) SetDefault(key string, value interface{}) { + panic("implement me") +} + func (c *commandFsMetaSnapshotsCreate) Help() string { return `create snapshots of meta data from given time range. @@ -179,7 +203,10 @@ func (c *commandFsMetaSnapshotsCreate) Do(args []string, commandEnv *CommandEnv, return err } store := &filer_leveldb.LevelDBStore{} - store.CustomInitialize(levelDbPath) + config := SnapshotConfig{ + dir: levelDbPath, + } + store.Initialize(config, "") changeLogPath := filer.SystemLogDir var processEntry func(entry *filer_pb.Entry, isLast bool) error processEntry = func(entry *filer_pb.Entry, isLast bool) error {