xl: Rename getOrderedDisks as shuffleDisks appropriately. (#3796)

This PR is for readability cleanup

- getOrderedDisks as shuffleDisks
- getOrderedPartsMetadata as shufflePartsMetadata

Distribution is now a second argument instead being the
primary input argument for brevity.

Also change the usage of type casted int64(0), instead
rely on direct type reference as `var variable int64` everywhere.
This commit is contained in:
Harshavardhana
2017-02-24 09:20:40 -08:00
committed by GitHub
parent 25b5a0534f
commit bcc5b6e1ef
15 changed files with 110 additions and 84 deletions

View File

@@ -653,14 +653,14 @@ func TestNsLockMapDeleteLockInfoEntryForOps(t *testing.T) {
} else {
t.Fatalf("Entry for <volume> %s, <path> %s should have existed. ", param.volume, param.path)
}
if globalNSMutex.counters.granted != int64(0) {
t.Errorf("Expected the count of total running locks to be %v, but got %v", int64(0), globalNSMutex.counters.granted)
if globalNSMutex.counters.granted != 0 {
t.Errorf("Expected the count of total running locks to be %v, but got %v", 0, globalNSMutex.counters.granted)
}
if globalNSMutex.counters.blocked != int64(0) {
t.Errorf("Expected the count of total blocked locks to be %v, but got %v", int64(0), globalNSMutex.counters.blocked)
if globalNSMutex.counters.blocked != 0 {
t.Errorf("Expected the count of total blocked locks to be %v, but got %v", 0, globalNSMutex.counters.blocked)
}
if globalNSMutex.counters.total != int64(0) {
t.Errorf("Expected the count of all locks to be %v, but got %v", int64(0), globalNSMutex.counters.total)
if globalNSMutex.counters.total != 0 {
t.Errorf("Expected the count of all locks to be %v, but got %v", 0, globalNSMutex.counters.total)
}
}
@@ -723,13 +723,13 @@ func TestNsLockMapDeleteLockInfoEntryForVolumePath(t *testing.T) {
t.Fatalf("Entry for <volume> %s, <path> %s should have been deleted. ", param.volume, param.path)
}
// The lock count values should be 0.
if globalNSMutex.counters.granted != int64(0) {
t.Errorf("Expected the count of total running locks to be %v, but got %v", int64(0), globalNSMutex.counters.granted)
if globalNSMutex.counters.granted != 0 {
t.Errorf("Expected the count of total running locks to be %v, but got %v", 0, globalNSMutex.counters.granted)
}
if globalNSMutex.counters.blocked != int64(0) {
t.Errorf("Expected the count of total blocked locks to be %v, but got %v", int64(0), globalNSMutex.counters.blocked)
if globalNSMutex.counters.blocked != 0 {
t.Errorf("Expected the count of total blocked locks to be %v, but got %v", 0, globalNSMutex.counters.blocked)
}
if globalNSMutex.counters.total != int64(0) {
t.Errorf("Expected the count of all locks to be %v, but got %v", int64(0), globalNSMutex.counters.total)
if globalNSMutex.counters.total != 0 {
t.Errorf("Expected the count of all locks to be %v, but got %v", 0, globalNSMutex.counters.total)
}
}