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
refactor: `Directory` readability (#3665)
Ryan Russelld54eb9966f35
diff --git a/weed/filer/filer.go b/weed/filer/filer.goindex ae5bc69bca..07d40acc89 100644--- a/weed/filer/filer.go+++ b/weed/filer/filer.go@@ -178,7 +178,7 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFrif !skipCreateParentDir {dirParts := strings.Split(string(entry.FullPath), "/")- if err := f.ensureParentDirecotryEntry(ctx, entry, dirParts, len(dirParts)-1, isFromOtherCluster); err != nil {+ if err := f.ensureParentDirectoryEntry(ctx, entry, dirParts, len(dirParts)-1, isFromOtherCluster); err != nil {return err}}@@ -209,7 +209,7 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFrreturn nil}-func (f *Filer) ensureParentDirecotryEntry(ctx context.Context, entry *Entry, dirParts []string, level int, isFromOtherCluster bool) (err error) {+func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, dirParts []string, level int, isFromOtherCluster bool) (err error) {if level == 0 {return nil@@ -226,7 +226,7 @@ func (f *Filer) ensureParentDirecotryEntry(ctx context.Context, entry *Entry, diif dirEntry == nil {// ensure parent directory- if err = f.ensureParentDirecotryEntry(ctx, entry, dirParts, level-1, isFromOtherCluster); err != nil {+ if err = f.ensureParentDirectoryEntry(ctx, entry, dirParts, level-1, isFromOtherCluster); err != nil {return err}diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.goindex 851f8264b0..d3eb329883 100644--- a/weed/filer/filer_conf.go+++ b/weed/filer/filer_conf.go@@ -21,7 +21,7 @@ const (DirectoryEtcSeaweedFS = "/etc/seaweedfs"DirectoryEtcRemote = "/etc/remote"FilerConfName = "filer.conf"- IamConfigDirecotry = "/etc/iam"+ IamConfigDirectory = "/etc/iam"IamIdentityFile = "identity.json"IamPoliciesFile = "policies.json")diff --git a/weed/iamapi/iamapi_server.go b/weed/iamapi/iamapi_server.goindex ab6de21dbf..8bc4c1bf32 100644--- a/weed/iamapi/iamapi_server.go+++ b/weed/iamapi/iamapi_server.go@@ -78,7 +78,7 @@ func (iama *IamApiServer) registerRouter(router *mux.Router) {func (iam IamS3ApiConfigure) GetS3ApiConfiguration(s3cfg *iam_pb.S3ApiConfiguration) (err error) {var buf bytes.Buffererr = pb.WithGrpcFilerClient(false, iam.option.Filer, iam.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {- if err = filer.ReadEntry(iam.masterClient, client, filer.IamConfigDirecotry, filer.IamIdentityFile, &buf); err != nil {+ if err = filer.ReadEntry(iam.masterClient, client, filer.IamConfigDirectory, filer.IamIdentityFile, &buf); err != nil {return err}return nil@@ -101,7 +101,7 @@ func (iam IamS3ApiConfigure) PutS3ApiConfiguration(s3cfg *iam_pb.S3ApiConfigurat}return pb.WithGrpcFilerClient(false, iam.option.Filer, iam.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {err = util.Retry("saveIamIdentity", func() error {- return filer.SaveInsideFiler(client, filer.IamConfigDirecotry, filer.IamIdentityFile, buf.Bytes())+ return filer.SaveInsideFiler(client, filer.IamConfigDirectory, filer.IamIdentityFile, buf.Bytes())})if err != nil {return err@@ -113,7 +113,7 @@ func (iam IamS3ApiConfigure) PutS3ApiConfiguration(s3cfg *iam_pb.S3ApiConfiguratfunc (iam IamS3ApiConfigure) GetPolicies(policies *Policies) (err error) {var buf bytes.Buffererr = pb.WithGrpcFilerClient(false, iam.option.Filer, iam.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {- if err = filer.ReadEntry(iam.masterClient, client, filer.IamConfigDirecotry, filer.IamPoliciesFile, &buf); err != nil {+ if err = filer.ReadEntry(iam.masterClient, client, filer.IamConfigDirectory, filer.IamPoliciesFile, &buf); err != nil {return err}return nil@@ -137,7 +137,7 @@ func (iam IamS3ApiConfigure) PutPolicies(policies *Policies) (err error) {return err}return pb.WithGrpcFilerClient(false, iam.option.Filer, iam.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {- if err := filer.SaveInsideFiler(client, filer.IamConfigDirecotry, filer.IamPoliciesFile, b); err != nil {+ if err := filer.SaveInsideFiler(client, filer.IamConfigDirectory, filer.IamPoliciesFile, b); err != nil {return err}return nildiff --git a/weed/replication/sink/localsink/local_sink.go b/weed/replication/sink/localsink/local_sink.goindex 5a953353b2..e69045336a 100644--- a/weed/replication/sink/localsink/local_sink.go+++ b/weed/replication/sink/localsink/local_sink.go@@ -80,7 +80,7 @@ func (localsink *LocalSink) CreateEntry(key string, entry *filer_pb.Entry, signadir := filepath.Dir(key)if _, err := os.Stat(dir); os.IsNotExist(err) {- glog.V(4).Infof("Create Direcotry key: %s", dir)+ glog.V(4).Infof("Create Directory key: %s", dir)if err = os.MkdirAll(dir, 0755); err != nil {return err}diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.goindex b83eb16ddf..a243d6222e 100644--- a/weed/s3api/auth_credentials.go+++ b/weed/s3api/auth_credentials.go@@ -85,7 +85,7 @@ func NewIdentityAccessManagement(option *S3ApiServerOption) *IdentityAccessManagfunc (iam *IdentityAccessManagement) loadS3ApiConfigurationFromFiler(option *S3ApiServerOption) (err error) {var content []byteerr = pb.WithFilerClient(false, option.Filer, option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {- content, err = filer.ReadInsideFiler(client, filer.IamConfigDirecotry, filer.IamIdentityFile)+ content, err = filer.ReadInsideFiler(client, filer.IamConfigDirectory, filer.IamIdentityFile)return err})if err != nil {diff --git a/weed/s3api/auth_credentials_subscribe.go b/weed/s3api/auth_credentials_subscribe.goindex cd1cdf8a32..37e5a90239 100644--- a/weed/s3api/auth_credentials_subscribe.go+++ b/weed/s3api/auth_credentials_subscribe.go@@ -44,7 +44,7 @@ func (s3a *S3ApiServer) subscribeMetaEvents(clientName string, prefix string, la//reload iam configfunc (s3a *S3ApiServer) onIamConfigUpdate(dir, filename string, content []byte) error {- if dir == filer.IamConfigDirecotry && filename == filer.IamIdentityFile {+ if dir == filer.IamConfigDirectory && filename == filer.IamIdentityFile {if err := s3a.iam.LoadS3ApiConfigurationFromBytes(content); err != nil {return err}diff --git a/weed/shell/command_s3_configure.go b/weed/shell/command_s3_configure.goindex 92bd69ce56..e7387a4a06 100644--- a/weed/shell/command_s3_configure.go+++ b/weed/shell/command_s3_configure.go@@ -49,7 +49,7 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer iovar buf bytes.Bufferif err = commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {- return filer.ReadEntry(commandEnv.MasterClient, client, filer.IamConfigDirecotry, filer.IamIdentityFile, &buf)+ return filer.ReadEntry(commandEnv.MasterClient, client, filer.IamConfigDirectory, filer.IamIdentityFile, &buf)}); err != nil && err != filer_pb.ErrNotFound {return err}@@ -178,7 +178,7 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer ioif *apply {if err := commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {- return filer.SaveInsideFiler(client, filer.IamConfigDirecotry, filer.IamIdentityFile, buf.Bytes())+ return filer.SaveInsideFiler(client, filer.IamConfigDirectory, filer.IamIdentityFile, buf.Bytes())}); err != nil {return err}