diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-22 02:34:08 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-22 02:34:08 -0800 |
| commit | 4f31c1bb9496bddd55dc4586769d1834599c975e (patch) | |
| tree | c4e0f286db2582c310f3ae4e429df233519f47da /weed/filer | |
| parent | 6c4f32d1735d247fbf598663f8fe6ecc286dc099 (diff) | |
| download | seaweedfs-4f31c1bb9496bddd55dc4586769d1834599c975e.tar.xz seaweedfs-4f31c1bb9496bddd55dc4586769d1834599c975e.zip | |
go fmt
Diffstat (limited to 'weed/filer')
| -rw-r--r-- | weed/filer/abstract_sql/abstract_sql_store_kv.go | 2 | ||||
| -rw-r--r-- | weed/filer/configuration.go | 2 | ||||
| -rw-r--r-- | weed/filer/filer_deletion.go | 1 | ||||
| -rw-r--r-- | weed/filer/filerstore_translate_path.go | 4 | ||||
| -rw-r--r-- | weed/filer/filerstore_wrapper.go | 8 | ||||
| -rw-r--r-- | weed/filer/read_write.go | 12 | ||||
| -rw-r--r-- | weed/filer/redis2/universal_redis_store.go | 2 |
7 files changed, 15 insertions, 16 deletions
diff --git a/weed/filer/abstract_sql/abstract_sql_store_kv.go b/weed/filer/abstract_sql/abstract_sql_store_kv.go index 81d105134..792a45ff4 100644 --- a/weed/filer/abstract_sql/abstract_sql_store_kv.go +++ b/weed/filer/abstract_sql/abstract_sql_store_kv.go @@ -34,7 +34,7 @@ func (store *AbstractSqlStore) KvPut(ctx context.Context, key []byte, value []by } _, err = res.RowsAffected() - if err != nil { + if err != nil { return fmt.Errorf("kv upsert no rows affected: %s", err) } return nil diff --git a/weed/filer/configuration.go b/weed/filer/configuration.go index af9c75962..5793e2b78 100644 --- a/weed/filer/configuration.go +++ b/weed/filer/configuration.go @@ -68,7 +68,7 @@ func (f *Filer) LoadConfiguration(config *viper.Viper) { if err := store.Initialize(config, key+"."); err != nil { glog.Fatalf("Failed to initialize store for %s: %+v", key, err) } - location := config.GetString(key+".location") + location := config.GetString(key + ".location") if location == "" { glog.Errorf("path-specific filer store needs %s", key+".location") os.Exit(-1) diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go index 09af80b42..9eee38277 100644 --- a/weed/filer/filer_deletion.go +++ b/weed/filer/filer_deletion.go @@ -151,4 +151,3 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) { } f.DeleteChunks(toDelete) } - diff --git a/weed/filer/filerstore_translate_path.go b/weed/filer/filerstore_translate_path.go index 4ea69ea8d..ea0f9db77 100644 --- a/weed/filer/filerstore_translate_path.go +++ b/weed/filer/filerstore_translate_path.go @@ -30,7 +30,7 @@ func NewFilerStorePathTranlator(storeRoot string, store FilerStore) *FilerStoreP } } -func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util.FullPath){ +func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util.FullPath) { newPath = fp if t.storeRoot == "/" { return @@ -41,7 +41,7 @@ func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util. } return } -func (t *FilerStorePathTranlator) changeEntryPath(entry *Entry) (previousPath util.FullPath){ +func (t *FilerStorePathTranlator) changeEntryPath(entry *Entry) (previousPath util.FullPath) { previousPath = entry.FullPath if t.storeRoot == "/" { return diff --git a/weed/filer/filerstore_wrapper.go b/weed/filer/filerstore_wrapper.go index 011bab963..3206d5ba4 100644 --- a/weed/filer/filerstore_wrapper.go +++ b/weed/filer/filerstore_wrapper.go @@ -183,7 +183,7 @@ func (fsw *FilerStoreWrapper) DeleteOneEntry(ctx context.Context, existingEntry } func (fsw *FilerStoreWrapper) DeleteFolderChildren(ctx context.Context, fp util.FullPath) (err error) { - actualStore := fsw.getActualStore(fp+"/") + actualStore := fsw.getActualStore(fp + "/") stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "deleteFolderChildren").Inc() start := time.Now() defer func() { @@ -195,7 +195,7 @@ func (fsw *FilerStoreWrapper) DeleteFolderChildren(ctx context.Context, fp util. } func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error) { - actualStore := fsw.getActualStore(dirPath+"/") + actualStore := fsw.getActualStore(dirPath + "/") stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "list").Inc() start := time.Now() defer func() { @@ -215,7 +215,7 @@ func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath } func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) ([]*Entry, error) { - actualStore := fsw.getActualStore(dirPath+"/") + actualStore := fsw.getActualStore(dirPath + "/") stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "prefixList").Inc() start := time.Now() defer func() { @@ -237,7 +237,7 @@ func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context, } func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) (entries []*Entry, err error) { - actualStore := fsw.getActualStore(dirPath+"/") + actualStore := fsw.getActualStore(dirPath + "/") entries, err = actualStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit) if err != nil { return nil, err diff --git a/weed/filer/read_write.go b/weed/filer/read_write.go index 548473116..1f78057ef 100644 --- a/weed/filer/read_write.go +++ b/weed/filer/read_write.go @@ -82,8 +82,8 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conte if err == filer_pb.ErrNotFound { err = filer_pb.CreateEntry(client, &filer_pb.CreateEntryRequest{ - Directory: dir, - Entry: &filer_pb.Entry{ + Directory: dir, + Entry: &filer_pb.Entry{ Name: name, IsDirectory: false, Attributes: &filer_pb.FuseAttributes{ @@ -92,7 +92,7 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conte FileMode: uint32(0644), Collection: "", Replication: "", - FileSize: uint64(len(content)), + FileSize: uint64(len(content)), }, Content: content, }, @@ -103,10 +103,10 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conte entry.Attributes.Mtime = time.Now().Unix() entry.Attributes.FileSize = uint64(len(content)) err = filer_pb.UpdateEntry(client, &filer_pb.UpdateEntryRequest{ - Directory: dir, - Entry: entry, + Directory: dir, + Entry: entry, }) } return err -}
\ No newline at end of file +} diff --git a/weed/filer/redis2/universal_redis_store.go b/weed/filer/redis2/universal_redis_store.go index 6db5541c6..00d02ea14 100644 --- a/weed/filer/redis2/universal_redis_store.go +++ b/weed/filer/redis2/universal_redis_store.go @@ -18,7 +18,7 @@ const ( ) type UniversalRedis2Store struct { - Client redis.UniversalClient + Client redis.UniversalClient superLargeDirectoryHash map[string]bool } |
