aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Russell <ryanrussell@users.noreply.github.com>2022-09-14 14:06:48 -0500
committerGitHub <noreply@github.com>2022-09-14 12:06:48 -0700
commitbd2dc6d641a40895ef1675405212ca5e6e297fd4 (patch)
tree9dd3f25960525bb29511faf223f9d7d2eba8e45e
parentdfbd8efd26891d6ef07928b1bab2ec65809c585e (diff)
downloadseaweedfs-bd2dc6d641a40895ef1675405212ca5e6e297fd4.tar.xz
seaweedfs-bd2dc6d641a40895ef1675405212ca5e6e297fd4.zip
refactor(shell): `Decending` -> `Descending` (#3675)
Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
-rw-r--r--weed/shell/command_ec_balance.go2
-rw-r--r--weed/shell/command_ec_common.go4
-rw-r--r--weed/shell/command_ec_encode_test.go2
-rw-r--r--weed/shell/command_ec_rebuild.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index 2267f8cf0..bc322f8fe 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -453,7 +453,7 @@ func doBalanceEcRack(commandEnv *CommandEnv, ecRack *EcRack, applyBalancing bool
func pickOneEcNodeAndMoveOneShard(commandEnv *CommandEnv, averageShardsPerEcNode int, existingLocation *EcNode, collection string, vid needle.VolumeId, shardId erasure_coding.ShardId, possibleDestinationEcNodes []*EcNode, applyBalancing bool) error {
- sortEcNodesByFreeslotsDecending(possibleDestinationEcNodes)
+ sortEcNodesByFreeslotsDescending(possibleDestinationEcNodes)
for _, destEcNode := range possibleDestinationEcNodes {
if destEcNode.info.Id == existingLocation.info.Id {
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go
index 0335e7e26..325e504c4 100644
--- a/weed/shell/command_ec_common.go
+++ b/weed/shell/command_ec_common.go
@@ -118,7 +118,7 @@ func eachDataNode(topo *master_pb.TopologyInfo, fn func(dc string, rack RackId,
}
}
-func sortEcNodesByFreeslotsDecending(ecNodes []*EcNode) {
+func sortEcNodesByFreeslotsDescending(ecNodes []*EcNode) {
slices.SortFunc(ecNodes, func(a, b *EcNode) bool {
return a.freeEcSlot > b.freeEcSlot
})
@@ -217,7 +217,7 @@ func collectEcNodes(commandEnv *CommandEnv, selectedDataCenter string) (ecNodes
// find out all volume servers with one slot left.
ecNodes, totalFreeEcSlots = collectEcVolumeServersByDc(topologyInfo, selectedDataCenter)
- sortEcNodesByFreeslotsDecending(ecNodes)
+ sortEcNodesByFreeslotsDescending(ecNodes)
return
}
diff --git a/weed/shell/command_ec_encode_test.go b/weed/shell/command_ec_encode_test.go
index f906bbf27..346e2af14 100644
--- a/weed/shell/command_ec_encode_test.go
+++ b/weed/shell/command_ec_encode_test.go
@@ -13,7 +13,7 @@ func TestEcDistribution(t *testing.T) {
// find out all volume servers with one slot left.
ecNodes, totalFreeEcSlots := collectEcVolumeServersByDc(topologyInfo, "")
- sortEcNodesByFreeslotsDecending(ecNodes)
+ sortEcNodesByFreeslotsDescending(ecNodes)
if totalFreeEcSlots < erasure_coding.TotalShardsCount {
println("not enough free ec shard slots", totalFreeEcSlots)
diff --git a/weed/shell/command_ec_rebuild.go b/weed/shell/command_ec_rebuild.go
index 4b2952793..e638d3eed 100644
--- a/weed/shell/command_ec_rebuild.go
+++ b/weed/shell/command_ec_rebuild.go
@@ -115,7 +115,7 @@ func rebuildEcVolumes(commandEnv *CommandEnv, allEcNodes []*EcNode, collection s
return fmt.Errorf("ec volume %d is unrepairable with %d shards\n", vid, shardCount)
}
- sortEcNodesByFreeslotsDecending(allEcNodes)
+ sortEcNodesByFreeslotsDescending(allEcNodes)
if allEcNodes[0].freeEcSlot < erasure_coding.TotalShardsCount {
return fmt.Errorf("disk space is not enough")