accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/6] accumulo git commit: ACCUMULO-3965 Include scanId in `listscans` shell command output
Date Sat, 22 Aug 2015 03:51:54 GMT
ACCUMULO-3965 Include scanId in `listscans` shell command output


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/dcd27de5
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/dcd27de5
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/dcd27de5

Branch: refs/heads/master
Commit: dcd27de5f77e949d9828ad2a879d86a13e0504c1
Parents: a541e76
Author: Josh Elser <elserj@apache.org>
Authored: Wed Aug 19 17:04:04 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Aug 21 23:45:19 2015 -0400

----------------------------------------------------------------------
 .../core/util/shell/commands/ActiveScanIterator.java      | 10 +++++-----
 .../test/java/org/apache/accumulo/test/ShellServerIT.java |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/dcd27de5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java
b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java
index 7a2b0c7..b027739 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveScanIterator.java
@@ -43,10 +43,10 @@ class ActiveScanIterator implements Iterator<String> {
 
         for (ActiveScan as : asl) {
           scans
-              .add(String.format("%21s |%21s |%9s |%9s |%7s |%6s |%8s |%8s |%10s |%20s |%10s
|%10s | %s", tserver, as.getClient(),
+              .add(String.format("%21s |%21s |%9s |%9s |%7s |%6s |%8s |%8s |%10s |%20s |%10s
|%20s |%10s | %s", tserver, as.getClient(),
                   Duration.format(as.getAge(), "", "-"), Duration.format(as.getLastContactTime(),
"", "-"), as.getState(), as.getType(), as.getUser(),
-                  as.getTable(), as.getColumns(), as.getAuthorizations(), (as.getType() ==
ScanType.SINGLE ? as.getExtent() : "N/A"), as.getSsiList(),
-                  as.getSsio()));
+                  as.getTable(), as.getColumns(), as.getAuthorizations(), (as.getType() ==
ScanType.SINGLE ? as.getExtent() : "N/A"), as.getScanid(),
+                  as.getSsiList(), as.getSsio()));
         }
       } catch (Exception e) {
         scans.add(tserver + " ERROR " + e.getMessage());
@@ -64,8 +64,8 @@ class ActiveScanIterator implements Iterator<String> {
     this.instanceOps = instanceOps;
     this.tsIter = tservers.iterator();
 
-    final String header = String.format(" %-21s| %-21s| %-9s| %-9s| %-7s| %-6s| %-8s| %-8s|
%-10s| %-20s| %-10s| %-10s | %s", "TABLET SERVER", "CLIENT", "AGE",
-        "LAST", "STATE", "TYPE", "USER", "TABLE", "COLUMNS", "AUTHORIZATIONS", "TABLET",
"ITERATORS", "ITERATOR OPTIONS");
+    final String header = String.format(" %-21s| %-21s| %-9s| %-9s| %-7s| %-6s| %-8s| %-8s|
%-10s| %-20s| %-10s| %-10s | %-20s | %s", "TABLET SERVER",
+        "CLIENT", "AGE", "LAST", "STATE", "TYPE", "USER", "TABLE", "COLUMNS", "AUTHORIZATIONS",
"TABLET", "SCAN ID", "ITERATORS", "ITERATOR OPTIONS");
 
     scansIter = Collections.singletonList(header).iterator();
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/dcd27de5/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
index 914a914..4b233d4 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
@@ -1081,7 +1081,7 @@ public class ShellServerIT extends SharedMiniClusterIT {
         continue;
       }
       String parts[] = scan.split("\\|");
-      assertEquals("Expected 13 colums, but found " + parts.length + " instead for '" + Arrays.toString(parts)
+ "'", 13, parts.length);
+      assertEquals("Expected 14 colums, but found " + parts.length + " instead for '" + Arrays.toString(parts)
+ "'", 14, parts.length);
       String tserver = parts[0].trim();
       // TODO: any way to tell if the client address is accurate? could be local IP, host,
loopback...?
       String hostPortPattern = ".+:\\d+";
@@ -1089,6 +1089,8 @@ public class ShellServerIT extends SharedMiniClusterIT {
       assertTrue(getConnector().instanceOperations().getTabletServers().contains(tserver));
       String client = parts[1].trim();
       assertTrue(client.matches(hostPortPattern));
+      // Scan ID should be a long (throwing an exception if it fails to parse)
+      Long.parseLong(parts[11].trim());
     }
 
     ts.exec("deletetable -f " + table, true);


Mime
View raw message