aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go6
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)