From 57092d69ac1f72bd90f62811ac2542b054371fdc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 10 Jun 2019 21:33:32 -0700 Subject: [PATCH] go fmt --- weed/server/filer_server.go | 1 - weed/server/filer_server_handlers_read.go | 1 - weed/server/volume_server_handlers.go | 2 +- weed/shell/command_ec_balance.go | 2 +- weed/shell/commands.go | 1 - weed/storage/store_ec.go | 6 +++--- weed/topology/node.go | 6 +++--- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 5d2a54f4d..f65723b47 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -85,4 +85,3 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) return fs, nil } - diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 8477c3783..663bf4b58 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -234,4 +234,3 @@ func (fs *FilerServer) writeContent(w io.Writer, entry *filer2.Entry, offset int return filer2.StreamContent(fs.filer.MasterClient, w, entry.Chunks, offset, size) } - diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go index 4197582fd..14ad27d42 100644 --- a/weed/server/volume_server_handlers.go +++ b/weed/server/volume_server_handlers.go @@ -59,7 +59,7 @@ func (vs *VolumeServer) maybeCheckJwtAuthorization(r *http.Request, vid, fid str } else { signingKey = vs.guard.SigningKey } - }else { + } else { if len(vs.guard.ReadSigningKey) == 0 { return true } else { diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go index 2f292f11d..47ae7bad3 100644 --- a/weed/shell/command_ec_balance.go +++ b/weed/shell/command_ec_balance.go @@ -466,7 +466,7 @@ func pickOneEcNodeAndMoveOneShard(ctx context.Context, commandEnv *CommandEnv, e return nil } -func pickNEcShardsToMoveFrom(ecNodes []*EcNode, vid needle.VolumeId, n int) (map[erasure_coding.ShardId]*EcNode) { +func pickNEcShardsToMoveFrom(ecNodes []*EcNode, vid needle.VolumeId, n int) map[erasure_coding.ShardId]*EcNode { picked := make(map[erasure_coding.ShardId]*EcNode) var candidateEcNodes []*CandidateEcNode for _, ecNode := range ecNodes { diff --git a/weed/shell/commands.go b/weed/shell/commands.go index ade8acd89..b642ec253 100644 --- a/weed/shell/commands.go +++ b/weed/shell/commands.go @@ -40,7 +40,6 @@ var ( Commands = []command{} ) - func NewCommandEnv(options ShellOptions) *CommandEnv { return &CommandEnv{ env: make(map[string]string), diff --git a/weed/storage/store_ec.go b/weed/storage/store_ec.go index 408436376..fb7735263 100644 --- a/weed/storage/store_ec.go +++ b/weed/storage/store_ec.go @@ -222,11 +222,11 @@ func (s *Store) cachedLookupEcShardLocations(ctx context.Context, ecVolume *eras shardCount := len(ecVolume.ShardLocations) if shardCount < erasure_coding.DataShardsCount && - ecVolume.ShardLocationsRefreshTime.Add(11 * time.Second).After(time.Now()) || + ecVolume.ShardLocationsRefreshTime.Add(11*time.Second).After(time.Now()) || shardCount == erasure_coding.TotalShardsCount && - ecVolume.ShardLocationsRefreshTime.Add(37 * time.Minute).After(time.Now()) || + ecVolume.ShardLocationsRefreshTime.Add(37*time.Minute).After(time.Now()) || shardCount >= erasure_coding.DataShardsCount && - ecVolume.ShardLocationsRefreshTime.Add(7 * time.Minute).After(time.Now()) { + ecVolume.ShardLocationsRefreshTime.Add(7*time.Minute).After(time.Now()) { // still fresh return nil } diff --git a/weed/topology/node.go b/weed/topology/node.go index 9aee0749e..b2808f589 100644 --- a/weed/topology/node.go +++ b/weed/topology/node.go @@ -49,9 +49,9 @@ type NodeImpl struct { maxVolumeCount int64 id NodeId parent Node - sync.RWMutex // lock children - children map[NodeId]Node - maxVolumeId needle.VolumeId + sync.RWMutex // lock children + children map[NodeId]Node + maxVolumeId needle.VolumeId //for rack, data center, topology nodeType string