[1/6] accumulo git commit: ACCUMULO-3965 Include scanId in `listscans` shell command output
Repository: accumulo Updated Branches: refs/heads/1.6 a541e766e -> dcd27de5f refs/heads/1.7 071c32f5c -> da484a882 refs/heads/master 4dee3c174 -> b921411dc 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/1.6 Commit: dcd27de5f77e949d9828ad2a879d86a13e0504c1 Parents: a541e76 Author: Josh Elser Authored: Wed Aug 19 17:04:04 2015 -0400 Committer: Josh Elser 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 { 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 { 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
[6/6] accumulo git commit: Merge branch '1.7'
Merge branch '1.7' Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b921411d Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b921411d Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b921411d Branch: refs/heads/master Commit: b921411dc71e1e5c5e7e86bb11e78e586b9df98b Parents: 4dee3c1 da484a8 Author: Josh Elser Authored: Fri Aug 21 23:51:39 2015 -0400 Committer: Josh Elser Committed: Fri Aug 21 23:51:39 2015 -0400 -- .../accumulo/shell/commands/ActiveScanIterator.java | 10 +- .../main/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/b921411d/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java -- diff --cc test/src/main/java/org/apache/accumulo/test/ShellServerIT.java index 249d88f,000..fe169a0 mode 100644,00..100644 --- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java @@@ -1,1720 -1,0 +1,1722 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.test; + +import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import jline.console.ConsoleReader; + +import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.ClientConfiguration; +import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty; +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.IteratorSetting; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.client.TableNotFoundException; +import org.apache.accumulo.core.client.admin.TableOperations; +import org.apache.accumulo.core.client.impl.Namespaces; +import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; +import org.apache.accumulo.core.client.security.tokens.KerberosToken; +import org.apache.accumulo.core.client.security.tokens.PasswordToken; +import org.apache.accumulo.core.conf.AccumuloConfiguration; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.file.FileOperations; +import org.apache.accumulo.core.file.FileSKVWriter; +import org.apache.accumulo.core.metadata.MetadataTable; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.accumulo.core.util.format.Formatter; +import org.apache.accumulo.harness.SharedMiniClusterBase; +import org.apache.accumulo.shell.Shell; +import org.apache.accumulo.test.functional.SlowIterator; +import org.apache.accumulo.tracer.TraceServer; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.tools.DistCp; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.jun
[5/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Conflicts: shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/da484a88 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/da484a88 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/da484a88 Branch: refs/heads/1.7 Commit: da484a8824ea5c130e0749b5494d452de8e7ab20 Parents: 071c32f dcd27de Author: Josh Elser Authored: Fri Aug 21 23:51:15 2015 -0400 Committer: Josh Elser Committed: Fri Aug 21 23:51:15 2015 -0400 -- .../accumulo/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/da484a88/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java -- diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java index d446534,000..9f2e23b mode 100644,00..100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java @@@ -1,93 -1,0 +1,93 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.shell.commands; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.apache.accumulo.core.client.admin.ActiveScan; +import org.apache.accumulo.core.client.admin.InstanceOperations; +import org.apache.accumulo.core.client.admin.ScanType; +import org.apache.accumulo.core.util.Duration; + +class ActiveScanIterator implements Iterator { + + private InstanceOperations instanceOps; + private Iterator tsIter; + private Iterator scansIter; + + private void readNext() { +final List scans = new ArrayList(); + +while (tsIter.hasNext()) { + + final String tserver = tsIter.next(); + try { +final List asl = instanceOps.getActiveScans(tserver); + +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.getTablet() : "N/A"), as.getSsiList(), - as.getSsio())); ++ as.getTable(), as.getColumns(), as.getAuthorizations(), (as.getType() == ScanType.SINGLE ? as.getTablet() : "N/A"), as.getScanid(), ++ as.getSsiList(), as.getSsio())); +} + } catch (Exception e) { +scans.add(tserver + " ERROR " + e.getMessage()); + } + + if (scans.size() > 0) { +break; + } +} + +scansIter = scans.iterator(); + } + + ActiveScanIterator(List tservers, InstanceOperations instanceOps) { +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", "
[4/6] accumulo git commit: Merge branch '1.6' into 1.7
Merge branch '1.6' into 1.7 Conflicts: shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/da484a88 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/da484a88 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/da484a88 Branch: refs/heads/master Commit: da484a8824ea5c130e0749b5494d452de8e7ab20 Parents: 071c32f dcd27de Author: Josh Elser Authored: Fri Aug 21 23:51:15 2015 -0400 Committer: Josh Elser Committed: Fri Aug 21 23:51:15 2015 -0400 -- .../accumulo/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/da484a88/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java -- diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java index d446534,000..9f2e23b mode 100644,00..100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ActiveScanIterator.java @@@ -1,93 -1,0 +1,93 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.shell.commands; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.apache.accumulo.core.client.admin.ActiveScan; +import org.apache.accumulo.core.client.admin.InstanceOperations; +import org.apache.accumulo.core.client.admin.ScanType; +import org.apache.accumulo.core.util.Duration; + +class ActiveScanIterator implements Iterator { + + private InstanceOperations instanceOps; + private Iterator tsIter; + private Iterator scansIter; + + private void readNext() { +final List scans = new ArrayList(); + +while (tsIter.hasNext()) { + + final String tserver = tsIter.next(); + try { +final List asl = instanceOps.getActiveScans(tserver); + +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.getTablet() : "N/A"), as.getSsiList(), - as.getSsio())); ++ as.getTable(), as.getColumns(), as.getAuthorizations(), (as.getType() == ScanType.SINGLE ? as.getTablet() : "N/A"), as.getScanid(), ++ as.getSsiList(), as.getSsio())); +} + } catch (Exception e) { +scans.add(tserver + " ERROR " + e.getMessage()); + } + + if (scans.size() > 0) { +break; + } +} + +scansIter = scans.iterator(); + } + + ActiveScanIterator(List tservers, InstanceOperations instanceOps) { +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"
[2/6] accumulo git commit: ACCUMULO-3965 Include scanId in `listscans` shell command output
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/1.7 Commit: dcd27de5f77e949d9828ad2a879d86a13e0504c1 Parents: a541e76 Author: Josh Elser Authored: Wed Aug 19 17:04:04 2015 -0400 Committer: Josh Elser 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 { 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 { 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);
[3/6] accumulo git commit: ACCUMULO-3965 Include scanId in `listscans` shell command output
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 Authored: Wed Aug 19 17:04:04 2015 -0400 Committer: Josh Elser 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 { 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 { 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);