diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-21 18:50:30 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-21 18:50:30 -0700 |
| commit | 4f02f7121d232507bbbba825fa241bc8d5e630ff (patch) | |
| tree | d9facd0b9188e459c0a483cb0891b97594ea1dd7 /weed/filesys/wfs.go | |
| parent | b8e4238ad29a60b37a3983a9968e325dd6849103 (diff) | |
| download | seaweedfs-4f02f7121d232507bbbba825fa241bc8d5e630ff.tar.xz seaweedfs-4f02f7121d232507bbbba825fa241bc8d5e630ff.zip | |
read from meta cache
meta cache is not initialized
Diffstat (limited to 'weed/filesys/wfs.go')
| -rw-r--r-- | weed/filesys/wfs.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 2013f3c03..b27ac440d 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -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) |
