Skip to content

Commit 21b0071

Browse files
author
Tim Middleton
committed
minor updates
1 parent 983eab6 commit 21b0071

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

pkg/cmd/cache.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const (
4242
back = "back"
4343
all = "all"
4444
partitionDisplayType = "partition"
45+
access = "access"
46+
storage = "storage"
4547
)
4648

4749
// getCachesCmd represents the get caches command.
@@ -452,7 +454,7 @@ You can specify '-o wide' to display addition information.`,
452454
return nil
453455
},
454456
RunE: func(cmd *cobra.Command, args []string) error {
455-
return getCacheDetails(cmd, args, "access")
457+
return getCacheDetails(cmd, args, access)
456458
},
457459
}
458460

@@ -470,7 +472,7 @@ You can specify '-o wide' to display addition information.`,
470472
return nil
471473
},
472474
RunE: func(cmd *cobra.Command, args []string) error {
473-
return getCacheDetails(cmd, args, "storage")
475+
return getCacheDetails(cmd, args, storage)
474476
},
475477
}
476478

@@ -660,11 +662,11 @@ func getCacheDetails(cmd *cobra.Command, args []string, displayType string) erro
660662
cmd.Printf("Cache: %s\n\n", args[0])
661663
}
662664

663-
if displayType == "access" {
665+
if displayType == access {
664666
cmd.Println(FormatCacheDetailsSizeAndAccess(cacheDetails.Details))
665667
} else if displayType == "index" {
666668
cmd.Println(FormatCacheIndexDetails(cacheDetails.Details))
667-
} else if displayType == "storage" {
669+
} else if displayType == storage {
668670
cmd.Println(FormatCacheDetailsStorage(cacheDetails.Details))
669671
} else if displayType == partitionDisplayType {
670672
cmd.Printf("Cache: %s\n", args[0])

pkg/cmd/formatting.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,9 @@ func FormatCacheDetailsStorage(cacheDetails []config.CacheDetail) string {
10171017
}
10181018

10191019
for _, value := range cacheDetails {
1020+
if value.Tier != "back" {
1021+
continue
1022+
}
10201023
var nodeID, _ = strconv.Atoi(value.NodeID)
10211024

10221025
table.AddRow(formatSmallInteger(int32(nodeID)), value.Tier,

pkg/cmd/monitor_cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,11 +959,11 @@ func getCacheContent(dataFetcher fetcher.Fetcher, displayType string) ([]string,
959959
return emptyStringArray, err
960960
}
961961

962-
if displayType == "access" {
962+
if displayType == access {
963963
sb.WriteString(FormatCacheDetailsSizeAndAccess(cacheDetails.Details))
964964
} else if displayType == "index" {
965965
sb.WriteString(FormatCacheIndexDetails(cacheDetails.Details))
966-
} else if displayType == "storage" {
966+
} else if displayType == storage {
967967
sb.WriteString(FormatCacheDetailsStorage(cacheDetails.Details))
968968
} else if displayType == partitionDisplayType {
969969
sb.WriteString(FormatCachePartitions(cachePartitionDetails.Details, cacheSummary))

0 commit comments

Comments
 (0)