From ccb474e424e48f906f704a8a34de0d0e39ab59da Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 29 Dec 2015 17:43:48 +0200 Subject: [PATCH] StorageService: Support the update getLoadMap API The API was modify to return the load map as a map of string to double instead of formatted string. This patch change the code to support the udpated API. Signed-off-by: Amnon Heiman --- .../org/apache/cassandra/service/StorageService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/cassandra/service/StorageService.java b/src/main/java/org/apache/cassandra/service/StorageService.java index 9f84ffc..cfed575 100644 --- a/src/main/java/org/apache/cassandra/service/StorageService.java +++ b/src/main/java/org/apache/cassandra/service/StorageService.java @@ -366,15 +366,20 @@ public class StorageService extends NotificationBroadcasterSupport /** Human-readable load value. Keys are IP addresses. */ public Map getLoadMap() { log(" getLoadMap()"); - Map load = c.getMapStrValue("/storage_service/load_map"); + Map load = getLoadMapAsDouble(); Map map = new HashMap<>(); - for (Map.Entry entry : load.entrySet()) + for (Map.Entry entry : load.entrySet()) { - map.put(entry.getKey(), FileUtils.stringifyFileSize(Double.parseDouble(entry.getValue()))); + map.put(entry.getKey(), FileUtils.stringifyFileSize(entry.getValue())); } return map; } + public Map getLoadMapAsDouble() { + log(" getLoadMapAsDouble()"); + return c.getMapStringDouble("/storage_service/load_map"); + } + /** * Return the generation value for this node. *