read from meta cache

meta cache is not initialized
This commit is contained in:
Chris Lu
2020-04-21 18:50:30 -07:00
parent b8e4238ad2
commit 4f02f7121d
5 changed files with 101 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"math"
"os"
"path"
"strings"
"sync"
"time"
@@ -12,6 +13,7 @@ import (
"github.com/karlseguin/ccache"
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/filesys/meta_cache"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
@@ -67,6 +69,7 @@ type WFS struct {
fsNodeCache *FsCache
chunkCache *chunk_cache.ChunkCache
metaCache *meta_cache.MetaCache
}
type statsCache struct {
filer_pb.StatisticsResponse
@@ -90,6 +93,9 @@ func NewSeaweedFileSystem(option *Option) *WFS {
wfs.chunkCache.Shutdown()
})
}
if wfs.option.AsyncMetaDataCaching {
wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.CacheDir, "meta"))
}
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}
wfs.fsNodeCache = newFsCache(wfs.root)