Merge branch '1.8'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2f8c8e7a Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2f8c8e7a Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2f8c8e7a Branch: refs/heads/master Commit: 2f8c8e7a4ae79aafd0653c420c0a1f3d7f50279b Parents: faa92c5 c587a6f Author: Christopher Tubbs <ctubb...@apache.org> Authored: Thu Jul 21 22:58:44 2016 -0400 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Thu Jul 21 22:58:44 2016 -0400 ---------------------------------------------------------------------- .../core/file/blockfile/impl/CachableBlockFile.java | 2 +- .../minicluster/impl/MiniAccumuloClusterControl.java | 2 +- .../org/apache/accumulo/master/TabletGroupWatcher.java | 11 +++++------ .../apache/accumulo/shell/commands/TablesCommand.java | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f8c8e7a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java ---------------------------------------------------------------------- diff --cc server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java index fa8087f,76fda21..9d8a1d1 --- a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java +++ b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java @@@ -27,9 -27,9 +27,10 @@@ import java.util.Iterator import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; import java.util.Set; import java.util.SortedMap; + import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import java.util.concurrent.TimeUnit; @@@ -91,12 -93,9 +94,8 @@@ import org.apache.hadoop.fs.Path import org.apache.hadoop.io.Text; import org.apache.thrift.TException; -import com.google.common.base.Optional; + import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Iterators; - import org.apache.accumulo.core.conf.Property; - import org.apache.accumulo.server.conf.TableConfiguration; - import static java.lang.Math.min; - import java.util.SortedSet; - import static java.lang.Math.min; abstract class TabletGroupWatcher extends Daemon { // Constants used to make sure assignment logging isn't excessive in quantity or size http://git-wip-us.apache.org/repos/asf/accumulo/blob/2f8c8e7a/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java ---------------------------------------------------------------------- diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java index 0390c4e,397b450..8bf96e7 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java @@@ -51,20 -54,28 +51,20 @@@ public class TablesCommand extends Comm Map<String,String> tables = shellState.getConnector().tableOperations().tableIdMap(); // filter only specified namespace - tables = Maps.filterKeys(tables, new Predicate<String>() { - @Override - public boolean apply(String tableName) { - return namespace == null || Tables.qualify(tableName).getFirst().equals(namespace); - } - }); + tables = Maps.filterKeys(tables, tableName -> namespace == null || Tables.qualify(tableName).getFirst().equals(namespace)); final boolean sortByTableId = cl.hasOption(sortByTableIdOption.getOpt()); -- tables = new TreeMap<>((sortByTableId ? MapUtils.invertMap(tables) : tables)); ++ tables = new TreeMap<String,String>((sortByTableId ? MapUtils.invertMap(tables) : tables)); - Iterator<String> it = Iterators.transform(tables.entrySet().iterator(), new Function<Entry<String,String>,String>() { - @Override - public String apply(Map.Entry<String,String> entry) { - String tableName = String.valueOf(sortByTableId ? entry.getValue() : entry.getKey()); - String tableId = String.valueOf(sortByTableId ? entry.getKey() : entry.getValue()); - if (namespace != null) - tableName = Tables.qualify(tableName).getSecond(); - if (cl.hasOption(tableIdOption.getOpt())) - return String.format(NAME_AND_ID_FORMAT, tableName, tableId); - else - return tableName; - } + Iterator<String> it = Iterators.transform(tables.entrySet().iterator(), entry -> { + String tableName = String.valueOf(sortByTableId ? entry.getValue() : entry.getKey()); + String tableId = String.valueOf(sortByTableId ? entry.getKey() : entry.getValue()); + if (namespace != null) + tableName = Tables.qualify(tableName).getSecond(); + if (cl.hasOption(tableIdOption.getOpt())) + return String.format(NAME_AND_ID_FORMAT, tableName, tableId); + else + return tableName; }); shellState.printLines(it, !cl.hasOption(disablePaginationOpt.getOpt()));