cache metadata on startup

This commit is contained in:
Chris Lu
2020-04-21 22:00:34 -07:00
parent 9f9826e95a
commit a207285af7
3 changed files with 17 additions and 4 deletions

View File

@@ -20,10 +20,13 @@ func NewMetaCache(dbFolder string) *MetaCache {
func openMetaStore(dbFolder string) filer2.FilerStore {
os.RemoveAll(dbFolder)
os.MkdirAll(dbFolder, 0755)
store := &leveldb.LevelDBStore{}
config := &cacheConfig{}
config := &cacheConfig{
dir: dbFolder,
}
if err := store.Initialize(config, ""); err != nil {
glog.Fatalf("Failed to initialize metadata cache store for %s: %+v", store.GetName(), err)