Browse Source

go fmt

pull/991/head
Chris Lu 6 years ago
parent
commit
57092d69ac
  1. 1
      weed/server/filer_server.go
  2. 1
      weed/server/filer_server_handlers_read.go
  3. 2
      weed/server/volume_server_handlers.go
  4. 2
      weed/shell/command_ec_balance.go
  5. 1
      weed/shell/commands.go
  6. 6
      weed/storage/store_ec.go
  7. 6
      weed/topology/node.go

1
weed/server/filer_server.go

@ -85,4 +85,3 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
return fs, nil return fs, nil
} }

1
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) return filer2.StreamContent(fs.filer.MasterClient, w, entry.Chunks, offset, size)
} }

2
weed/server/volume_server_handlers.go

@ -59,7 +59,7 @@ func (vs *VolumeServer) maybeCheckJwtAuthorization(r *http.Request, vid, fid str
} else { } else {
signingKey = vs.guard.SigningKey signingKey = vs.guard.SigningKey
} }
}else {
} else {
if len(vs.guard.ReadSigningKey) == 0 { if len(vs.guard.ReadSigningKey) == 0 {
return true return true
} else { } else {

2
weed/shell/command_ec_balance.go

@ -466,7 +466,7 @@ func pickOneEcNodeAndMoveOneShard(ctx context.Context, commandEnv *CommandEnv, e
return nil 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) picked := make(map[erasure_coding.ShardId]*EcNode)
var candidateEcNodes []*CandidateEcNode var candidateEcNodes []*CandidateEcNode
for _, ecNode := range ecNodes { for _, ecNode := range ecNodes {

1
weed/shell/commands.go

@ -40,7 +40,6 @@ var (
Commands = []command{} Commands = []command{}
) )
func NewCommandEnv(options ShellOptions) *CommandEnv { func NewCommandEnv(options ShellOptions) *CommandEnv {
return &CommandEnv{ return &CommandEnv{
env: make(map[string]string), env: make(map[string]string),

6
weed/storage/store_ec.go

@ -222,11 +222,11 @@ func (s *Store) cachedLookupEcShardLocations(ctx context.Context, ecVolume *eras
shardCount := len(ecVolume.ShardLocations) shardCount := len(ecVolume.ShardLocations)
if shardCount < erasure_coding.DataShardsCount && 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 && 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 && shardCount >= erasure_coding.DataShardsCount &&
ecVolume.ShardLocationsRefreshTime.Add(7 * time.Minute).After(time.Now()) {
ecVolume.ShardLocationsRefreshTime.Add(7*time.Minute).After(time.Now()) {
// still fresh // still fresh
return nil return nil
} }

6
weed/topology/node.go

@ -49,9 +49,9 @@ type NodeImpl struct {
maxVolumeCount int64 maxVolumeCount int64
id NodeId id NodeId
parent Node 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 //for rack, data center, topology
nodeType string nodeType string

Loading…
Cancel
Save