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
fs.meta.load load any dirs with prefix "important" (#3747)
Konstantin Lebedevfaa6167b6b70
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.goindex 3bd10c1e95..0cbdddb498 100644--- a/weed/shell/command_fs_meta_load.go+++ b/weed/shell/command_fs_meta_load.go@@ -19,6 +19,7 @@ func init() {}type commandFsMetaLoad struct {+ dirPrefix *string}func (c *commandFsMetaLoad) Name() string {@@ -30,6 +31,7 @@ func (c *commandFsMetaLoad) Help() string {fs.meta.load <filer_host>-<port>-<time>.metafs.meta.load -v=false <filer_host>-<port>-<time>.meta // skip printing out the verbose output+ fs.meta.load -dirPrefix=/buckets/important* <filer_host>.meta // load any dirs with prefix "important"`}@@ -44,6 +46,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.fileName := args[len(args)-1]metaLoadCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)+ c.dirPrefix = metaLoadCommand.String("dirPrefix", "", "load entries only with directories matching prefix")verbose := metaLoadCommand.Bool("v", true, "verbose mode")if err = metaLoadCommand.Parse(args[0 : len(args)-1]); err != nil {return nil@@ -83,11 +86,22 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.return err}+ // check collection name pattern+ entryFullName := string(util.FullPath(fullEntry.Dir).Child(fullEntry.Entry.Name))+ if *c.dirPrefix != "" {+ if !strings.HasPrefix(fullEntry.Dir, *c.dirPrefix) {+ if *verbose {+ fmt.Fprintf(writer, "not match dir prefix %s\n", entryFullName)+ }+ continue+ }+ }+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))+ fmt.Fprintf(writer, "load %s\n", entryFullName)}fullEntry.Entry.Name = strings.ReplaceAll(fullEntry.Entry.Name, "/", "x")