mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 06:31:59 +08:00
add placeholder for cached meta data reading
This commit is contained in:
parent
27128c7875
commit
b8e4238ad2
@ -20,6 +20,7 @@ type MountOptions struct {
|
|||||||
umaskString *string
|
umaskString *string
|
||||||
nonempty *bool
|
nonempty *bool
|
||||||
outsideContainerClusterMode *bool
|
outsideContainerClusterMode *bool
|
||||||
|
asyncMetaDataCaching *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -47,6 +48,7 @@ func init() {
|
|||||||
mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
|
mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
|
||||||
mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
|
mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
|
||||||
mountOptions.outsideContainerClusterMode = cmdMount.Flag.Bool("outsideContainerClusterMode", false, "allows other users to access the file system")
|
mountOptions.outsideContainerClusterMode = cmdMount.Flag.Bool("outsideContainerClusterMode", false, "allows other users to access the file system")
|
||||||
|
mountOptions.asyncMetaDataCaching = cmdMount.Flag.Bool("asyncMetaDataCaching", false, "<wip> async meta data caching")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdMount = &Command{
|
var cmdMount = &Command{
|
||||||
|
@ -175,6 +175,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
MountMtime: time.Now(),
|
MountMtime: time.Now(),
|
||||||
Umask: umask,
|
Umask: umask,
|
||||||
OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode,
|
OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode,
|
||||||
|
AsyncMetaDataCaching: *mountOptions.asyncMetaDataCaching,
|
||||||
Cipher: cipher,
|
Cipher: cipher,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -205,6 +205,10 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.
|
|||||||
fullFilePath := util.NewFullPath(dir.FullPath(), req.Name)
|
fullFilePath := util.NewFullPath(dir.FullPath(), req.Name)
|
||||||
entry := dir.wfs.cacheGet(fullFilePath)
|
entry := dir.wfs.cacheGet(fullFilePath)
|
||||||
|
|
||||||
|
if dir.wfs.option.AsyncMetaDataCaching {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if entry == nil {
|
if entry == nil {
|
||||||
// glog.V(3).Infof("dir Lookup cache miss %s", fullFilePath)
|
// glog.V(3).Infof("dir Lookup cache miss %s", fullFilePath)
|
||||||
entry, err = filer_pb.GetEntry(dir.wfs, fullFilePath)
|
entry, err = filer_pb.GetEntry(dir.wfs, fullFilePath)
|
||||||
@ -244,6 +248,10 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) {
|
|||||||
|
|
||||||
glog.V(3).Infof("dir ReadDirAll %s", dir.FullPath())
|
glog.V(3).Infof("dir ReadDirAll %s", dir.FullPath())
|
||||||
|
|
||||||
|
if dir.wfs.option.AsyncMetaDataCaching {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
cacheTtl := 5 * time.Minute
|
cacheTtl := 5 * time.Minute
|
||||||
|
|
||||||
readErr := filer_pb.ReadDirAllEntries(dir.wfs, util.FullPath(dir.FullPath()), "", func(entry *filer_pb.Entry, isLast bool) {
|
readErr := filer_pb.ReadDirAllEntries(dir.wfs, util.FullPath(dir.FullPath()), "", func(entry *filer_pb.Entry, isLast bool) {
|
||||||
|
@ -44,6 +44,7 @@ type Option struct {
|
|||||||
|
|
||||||
OutsideContainerClusterMode bool // whether the mount runs outside SeaweedFS containers
|
OutsideContainerClusterMode bool // whether the mount runs outside SeaweedFS containers
|
||||||
Cipher bool // whether encrypt data on volume server
|
Cipher bool // whether encrypt data on volume server
|
||||||
|
AsyncMetaDataCaching bool // whether asynchronously cache meta data
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +114,10 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err
|
|||||||
}
|
}
|
||||||
// glog.V(3).Infof("read entry cache miss %s", fullpath)
|
// glog.V(3).Infof("read entry cache miss %s", fullpath)
|
||||||
|
|
||||||
|
if wfs.option.AsyncMetaDataCaching {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
err = wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
err = wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
request := &filer_pb.LookupDirectoryEntryRequest{
|
request := &filer_pb.LookupDirectoryEntryRequest{
|
||||||
|
Loading…
Reference in New Issue
Block a user