incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Fixing a bug in top that does not should tables, index, and segments online if the cluster is anything other than default.
Date Fri, 14 Mar 2014 01:21:39 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/apache-blur-0.2 b32b1854b -> e45ea89d7


Fixing a bug in top that does not should tables, index, and segments online if the cluster
is anything other than default.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/9bec655a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/9bec655a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/9bec655a

Branch: refs/heads/apache-blur-0.2
Commit: 9bec655a6061b39cb8e773a8d30da9586e39c930
Parents: b32b185
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Thu Mar 13 21:19:16 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Thu Mar 13 21:19:16 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/blur/shell/TopCommand.java  | 15 ++++++++-------
 .../resources/org/apache/blur/shell/top.properties   |  6 +++---
 2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9bec655a/blur-shell/src/main/java/org/apache/blur/shell/TopCommand.java
----------------------------------------------------------------------
diff --git a/blur-shell/src/main/java/org/apache/blur/shell/TopCommand.java b/blur-shell/src/main/java/org/apache/blur/shell/TopCommand.java
index 0c7bb10..f2ebe90 100644
--- a/blur-shell/src/main/java/org/apache/blur/shell/TopCommand.java
+++ b/blur-shell/src/main/java/org/apache/blur/shell/TopCommand.java
@@ -98,6 +98,13 @@ public class TopCommand extends Command {
       throw new CommandException(e.getMessage());
     }
 
+    String cluster;
+    if (args.length != 2) {
+      cluster = Main.getCluster(client, "Invalid args: " + help());
+    } else {
+      cluster = args[1];
+    }
+
     Map<String, String> metricNames = new HashMap<String, String>();
     Map<String, String> helpMap = new HashMap<String, String>();
     Set<Object> keySet = properties.keySet();
@@ -106,6 +113,7 @@ public class TopCommand extends Command {
       if (isShortName(key)) {
         String shortName = getShortName(key, properties);
         String longName = getLongName(getLongNameKey(key), properties);
+        longName = longName.replace("<CLUSTER_NAME>", cluster);
         metricNames.put(shortName, longName);
       } else if (isHelpName(key)) {
         int indexOf = key.indexOf(HELP);
@@ -125,13 +133,6 @@ public class TopCommand extends Command {
     Set<String> sizes = new HashSet<String>(Arrays.asList(resolveShortNames(sizesStr.split(","),
properties)));
     Set<String> keys = new HashSet<String>(metricNames.values());
 
-    String cluster;
-    if (args.length != 2) {
-      cluster = Main.getCluster(client, "Invalid args: " + help());
-    } else {
-      cluster = args[1];
-    }
-
     ConsoleReader reader = this.getConsoleReader();
     if (reader != null) {
       Terminal terminal = reader.getTerminal();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9bec655a/blur-shell/src/main/resources/org/apache/blur/shell/top.properties
----------------------------------------------------------------------
diff --git a/blur-shell/src/main/resources/org/apache/blur/shell/top.properties b/blur-shell/src/main/resources/org/apache/blur/shell/top.properties
index 3fba05d..562feae 100644
--- a/blur-shell/src/main/resources/org/apache/blur/shell/top.properties
+++ b/blur-shell/src/main/resources/org/apache/blur/shell/top.properties
@@ -47,9 +47,9 @@ top.WE.longname="org.apache.blur":type="Blur",name="Write Records/s"
 top.RO.longname="org.apache.blur":type="Blur",name="Read Row/s"
 top.WO.longname="org.apache.blur":type="Blur",name="Write Row/s"
 top.GC.longname="org.apache.blur":type="JVM",name="GC Times (ms)"
-top.TC.longname="org.apache.blur":type="Blur",scope="default",name="Table Count"
-top.IC.longname="org.apache.blur":type="Blur",scope="default",name="Index Count"
-top.SC.longname="org.apache.blur":type="Blur",scope="default",name="Segment Count"
+top.TC.longname="org.apache.blur":type="Blur",scope="<CLUSTER_NAME>",name="Table Count"
+top.IC.longname="org.apache.blur":type="Blur",scope="<CLUSTER_NAME>",name="Index Count"
+top.SC.longname="org.apache.blur":type="Blur",scope="<CLUSTER_NAME>",name="Segment
Count"
 top.SL.longname="org.apache.blur":type="System",name="Load Average"
 top.HU.longname="org.apache.blur":type="JVM",name="Heap Used"
 top.CP.longname="org.apache.blur":type="JVM",name="Cpu Used"


Mime
View raw message