FUSE: add configurable in memory chunk cache size

This commit is contained in:
Chris Lu
2020-03-28 14:07:16 -07:00
parent 826bc0b7e3
commit a75d50bbb8
6 changed files with 24 additions and 15 deletions

View File

@@ -57,6 +57,7 @@ func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*
return
},
bufferOffset: -1,
chunkCache: chunkCache,
}
}

View File

@@ -22,17 +22,18 @@ import (
)
type Option struct {
FilerGrpcAddress string
GrpcDialOption grpc.DialOption
FilerMountRootPath string
Collection string
Replication string
TtlSec int32
ChunkSizeLimit int64
DataCenter string
DirListCacheLimit int64
EntryCacheTtl time.Duration
Umask os.FileMode
FilerGrpcAddress string
GrpcDialOption grpc.DialOption
FilerMountRootPath string
Collection string
Replication string
TtlSec int32
ChunkSizeLimit int64
ChunkCacheCountLimit int64
DataCenter string
DirListCacheLimit int64
EntryCacheTtl time.Duration
Umask os.FileMode
MountUid uint32
MountGid uint32
@@ -81,7 +82,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
return make([]byte, option.ChunkSizeLimit)
},
},
chunkCache: pb_cache.NewChunkCache(),
chunkCache: pb_cache.NewChunkCache(option.ChunkCacheCountLimit),
}
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}