SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
shell: fs.meta.load add quieter mode
chrislud3d52b1818ca
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.goindex b5a5a381a2..ced5f5b883 100644--- a/weed/shell/command_fs_meta_load.go+++ b/weed/shell/command_fs_meta_load.go@@ -1,10 +1,12 @@package shellimport (+ "flag""fmt""io""os""strings"+ "time""github.com/golang/protobuf/proto"@@ -27,6 +29,7 @@ func (c *commandFsMetaLoad) Help() string {return `load saved filer meta data to restore the directory and file structurefs.meta.load <filer_host>-<port>-<time>.meta+ fs.meta.load -v=false <filer_host>-<port>-<time>.meta // skip printing out the verbose output`}@@ -40,6 +43,12 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.fileName := args[len(args)-1]+ metaLoadCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)+ verbose := metaLoadCommand.Bool("v", true, "verbose mode")+ if err = metaLoadCommand.Parse(args[0 : len(args)-1]); err != nil {+ return nil+ }+dst, err := os.OpenFile(fileName, os.O_RDONLY, 0644)if err != nil {return nil@@ -47,6 +56,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.defer dst.Close()var dirCount, fileCount uint64+ lastLogTime := time.Now()err = commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {@@ -81,7 +91,12 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.return err}- fmt.Fprintf(writer, "load %s\n", util.FullPath(fullEntry.Dir).Child(fullEntry.Entry.Name))+ if *verbose || lastLogTime.Add(time.Second).Before(time.Now()) {+ if !*verbose {+ lastLogTime = time.Now()+ }+ fmt.Fprintf(writer, "load %s\n", util.FullPath(fullEntry.Dir).Child(fullEntry.Entry.Name))+ }if fullEntry.Entry.IsDirectory {dirCount++