accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [24/24] accumulo git commit: Merge branch '1.8'
Date Tue, 25 Jul 2017 23:03:12 GMT
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/3fcc76f8
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3fcc76f8
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3fcc76f8

Branch: refs/heads/master
Commit: 3fcc76f8b8b618bc0a873a0145836babde729ece
Parents: ff55fab 018c7fe
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Tue Jul 25 18:54:00 2017 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Tue Jul 25 18:54:00 2017 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/BatchScanner.java      |  4 +--
 .../accumulo/core/client/IsolatedScanner.java   |  4 +--
 .../accumulo/core/client/impl/MasterClient.java |  2 +-
 .../client/impl/NamespaceOperationsImpl.java    |  4 +--
 .../accumulo/core/client/impl/Namespaces.java   |  2 +-
 .../core/client/impl/RootTabletLocator.java     |  4 +--
 .../accumulo/core/client/impl/ServerClient.java |  3 +-
 .../core/client/impl/SyncingTabletLocator.java  |  2 +-
 .../accumulo/core/client/impl/Tables.java       |  2 +-
 .../core/client/impl/TabletLocatorImpl.java     |  4 +--
 .../client/impl/TabletServerBatchWriter.java    |  2 +-
 .../core/client/impl/TimeoutTabletLocator.java  |  6 ++--
 .../core/client/mapred/AbstractInputFormat.java |  4 +--
 .../client/mapreduce/AbstractInputFormat.java   |  4 +--
 .../core/client/mapreduce/RangeInputSplit.java  |  2 +-
 .../core/client/mock/MockTableOperations.java   |  3 +-
 .../client/rfile/RFileSummariesRetriever.java   |  2 +-
 .../java/org/apache/accumulo/core/data/Key.java | 15 ++++----
 .../apache/accumulo/core/data/KeyBuilder.java   |  6 ++--
 .../accumulo/core/file/rfile/bcfile/BCFile.java |  8 ++---
 .../core/file/streams/PositionedOutputs.java    |  1 +
 .../file/streams/RateLimitedInputStream.java    |  1 +
 .../file/streams/RateLimitedOutputStream.java   |  1 +
 .../file/streams/SeekableDataInputStream.java   |  1 +
 .../core/iterators/FirstEntryInRowIterator.java |  2 +-
 .../iterators/system/LocalityGroupIterator.java |  3 +-
 .../core/iterators/user/CfCqSliceOpts.java      |  6 ++--
 .../iterators/user/CfCqSliceSeekingFilter.java  |  6 ++--
 .../core/iterators/user/SeekingFilter.java      | 10 +++---
 .../accumulo/core/summary/SummaryWriter.java    |  2 +-
 .../accumulo/core/trace/CountSampler.java       |  4 +--
 .../accumulo/core/trace/ProbabilitySampler.java |  4 +--
 .../org/apache/accumulo/core/trace/Span.java    |  4 +--
 .../accumulo/core/util/LocalityGroupUtil.java   |  4 +--
 .../core/util/format/BinaryFormatter.java       |  1 +
 .../core/util/format/DateStringFormatter.java   |  1 +
 .../core/util/format/DefaultFormatter.java      |  1 +
 .../ratelimit/SharedRateLimiterFactory.java     |  4 ++-
 .../org/apache/accumulo/core/cli/TestHelp.java  |  3 +-
 .../accumulo/core/client/TestThrift1474.java    |  3 +-
 .../lexicoder/BigIntegerLexicoderTest.java      |  4 +--
 .../client/lexicoder/DateLexicoderTest.java     |  4 +--
 .../client/lexicoder/DoubleLexicoderTest.java   |  4 +--
 .../client/lexicoder/FloatLexicoderTest.java    |  4 +--
 .../client/lexicoder/IntegerLexicoderTest.java  |  4 +--
 .../core/client/lexicoder/LexicoderTest.java    |  9 ++---
 .../client/lexicoder/LongLexicoderTest.java     |  4 +--
 .../client/lexicoder/PairLexicoderTest.java     |  4 +--
 .../client/lexicoder/ReverseLexicoderTest.java  |  6 ++--
 .../client/lexicoder/ULongLexicoderTest.java    |  4 +--
 .../client/lexicoder/UUIDLexicoderTest.java     |  4 +--
 .../accumulo/core/data/KeyBuilderTest.java      | 12 +++----
 .../apache/accumulo/core/data/RangeTest.java    |  4 +--
 .../core/file/rfile/MultiLevelIndexTest.java    |  3 +-
 .../core/file/rfile/MultiThreadedRFileTest.java |  8 ++---
 .../core/file/streams/MockRateLimiter.java      |  1 +
 .../streams/RateLimitedInputStreamTest.java     |  1 +
 .../streams/RateLimitedOutputStreamTest.java    |  6 ++--
 .../ColumnFamilySkippingIteratorTest.java       |  4 +--
 .../core/iterators/system/ColumnFilterTest.java |  4 +--
 .../iterators/system/DeletingIteratorTest.java  |  4 +--
 .../system/SourceSwitchingIteratorTest.java     |  4 +--
 .../system/TimeSettingIteratorTest.java         |  8 ++---
 .../iterators/system/VisibilityFilterTest.java  |  4 +--
 .../iterators/user/IndexedDocIteratorTest.java  |  4 +--
 .../core/iterators/user/LargeRowFilterTest.java |  4 +--
 .../user/WholeColumnFamilyIteratorTest.java     |  4 +--
 .../core/rpc/TTimeoutTransportTest.java         | 14 ++++----
 .../core/security/VisibilityConstraintTest.java |  2 +-
 .../apache/accumulo/core/util/TextUtilTest.java |  4 +--
 .../util/format/DateFormatSupplierTest.java     |  1 +
 .../util/format/DateStringFormatterTest.java    |  1 +
 .../core/util/format/DefaultFormatterTest.java  |  1 +
 .../core/util/format/FormatterConfigTest.java   |  1 +
 .../accumulo/fate/util/AddressUtilTest.java     |  4 +--
 .../testcases/YieldingTestCase.java             |  6 ++--
 .../impl/MiniAccumuloClusterControl.java        |  4 +--
 .../StandaloneClusterControlTest.java           |  2 +-
 pom.xml                                         | 36 ++++++++++++++++++++
 .../org/apache/accumulo/server/Accumulo.java    |  1 +
 .../accumulo/server/AccumuloServerContext.java  |  1 +
 .../server/fs/VolumeChooserEnvironment.java     |  1 +
 .../accumulo/server/master/LiveTServerSet.java  |  2 +-
 .../balancer/HostRegexTableLoadBalancer.java    |  7 ++--
 .../server/master/state/SuspendingTServer.java  |  7 ++--
 .../server/master/state/TabletStateStore.java   |  2 +-
 .../server/replication/StatusFormatter.java     |  1 +
 ...HighlyAvailableServiceInvocationHandler.java |  1 -
 .../org/apache/accumulo/server/util/Halt.java   |  4 +--
 .../org/apache/accumulo/server/util/ZooZap.java |  2 +-
 .../server/AccumuloServerContextTest.java       |  1 +
 .../server/master/LiveTServerSetTest.java       |  1 +
 .../BaseHostRegexTableLoadBalancerTest.java     |  3 +-
 .../master/balancer/TableLoadBalancerTest.java  |  6 ++--
 .../security/handler/ZKAuthenticatorTest.java   |  4 +--
 .../org/apache/accumulo/master/MasterTime.java  |  8 +++--
 .../DistributedWorkQueueWorkAssigner.java       |  3 +-
 .../replication/UnorderedWorkAssigner.java      |  4 +--
 .../accumulo/master/replication/WorkDriver.java |  4 +--
 .../accumulo/master/tableOps/CloneInfo.java     |  6 ++--
 .../accumulo/master/tableOps/ExportInfo.java    |  4 +--
 .../master/tableOps/ImportedTableInfo.java      |  4 +--
 .../accumulo/master/tableOps/NamespaceInfo.java |  4 +--
 .../accumulo/master/tableOps/TableInfo.java     |  6 ++--
 .../accumulo/monitor/ZooKeeperStatus.java       |  2 +-
 .../apache/accumulo/tracer/TraceFormatter.java  |  1 +
 .../org/apache/accumulo/tracer/TraceServer.java |  3 +-
 .../apache/accumulo/tracer/TraceTableStats.java | 14 ++++----
 .../org/apache/accumulo/tserver/MemKey.java     |  3 +-
 .../compaction/MajorCompactionRequest.java      |  2 +-
 .../apache/accumulo/shell/ShellCompletor.java   |  4 +--
 .../shell/commands/ClasspathCommand.java        |  4 +--
 .../accumulo/shell/commands/ConfigCommand.java  |  4 +--
 .../accumulo/shell/commands/GrepCommand.java    |  1 +
 .../accumulo/shell/commands/TableOperation.java |  2 +-
 .../accumulo/shell/commands/TraceCommand.java   |  4 +--
 .../accumulo/shell/format/DeleterFormatter.java |  2 +-
 .../apache/accumulo/shell/mock/MockShell.java   |  4 +--
 .../apache/accumulo/shell/ShellConfigTest.java  |  4 +--
 .../accumulo/shell/ShellSetInstanceTest.java    |  4 +--
 .../shell/commands/CompactCommandTest.java      |  1 +
 .../shell/commands/DeleteAuthsCommandTest.java  |  4 +--
 .../shell/commands/DeleteManyCommandTest.java   |  1 +
 .../shell/commands/DeleteRowsCommandTest.java   |  1 +
 .../shell/commands/DropUserCommandTest.java     |  4 +--
 .../shell/commands/FlushCommandTest.java        |  1 +
 .../shell/commands/HistoryCommandTest.java      |  8 ++---
 .../shell/commands/MergeCommandTest.java        |  1 +
 .../shell/commands/ScanCommandTest.java         |  1 +
 .../test/BadDeleteMarkersCreatedIT.java         |  4 +--
 .../test/BatchWriterInTabletServerIT.java       |  5 +--
 .../org/apache/accumulo/test/CleanWalIT.java    |  2 +-
 .../accumulo/test/CompactionRateLimitingIT.java |  1 +
 .../accumulo/test/ConditionalWriterIT.java      |  2 +-
 .../apache/accumulo/test/HardListIterator.java  | 14 ++++----
 .../apache/accumulo/test/IMMLGBenchmark.java    |  3 +-
 .../apache/accumulo/test/MetaGetsReadersIT.java |  2 +-
 .../accumulo/test/MultiTableRecoveryIT.java     |  2 +-
 .../org/apache/accumulo/test/NamespacesIT.java  |  5 ++-
 .../accumulo/test/NativeMapPerformanceTest.java |  3 +-
 .../accumulo/test/SplitCancelsMajCIT.java       |  3 +-
 .../apache/accumulo/test/SplitRecoveryIT.java   |  2 +-
 .../apache/accumulo/test/TableOperationsIT.java |  2 +-
 .../accumulo/test/TabletServerGivesUpIT.java    |  3 +-
 .../org/apache/accumulo/test/TotalQueuedIT.java |  2 +-
 .../test/TracerRecoversAfterOfflineTableIT.java |  3 +-
 .../apache/accumulo/test/YieldScannersIT.java   |  8 ++---
 .../accumulo/test/functional/AddSplitIT.java    |  3 +-
 .../test/functional/BadIteratorMincIT.java      |  2 +-
 .../test/functional/BatchScanSplitIT.java       |  3 +-
 .../functional/BulkSplitOptimizationIT.java     |  3 +-
 .../test/functional/CacheTestReader.java        |  3 +-
 .../test/functional/CacheTestWriter.java        |  3 +-
 .../accumulo/test/functional/ClassLoaderIT.java |  5 ++-
 .../accumulo/test/functional/ConcurrencyIT.java |  2 +-
 .../accumulo/test/functional/ConstraintIT.java  |  5 ++-
 .../test/functional/DeleteRowsSplitIT.java      |  3 +-
 .../test/functional/GarbageCollectorIT.java     |  2 +-
 .../test/functional/HalfDeadTServerIT.java      |  3 +-
 .../accumulo/test/functional/LargeRowIT.java    |  3 +-
 .../accumulo/test/functional/MapReduceIT.java   |  2 +-
 .../accumulo/test/functional/MetadataIT.java    |  2 +-
 .../test/functional/MetadataMaxFilesIT.java     |  3 +-
 .../test/functional/MetadataSplitIT.java        |  3 +-
 .../accumulo/test/functional/ScanIdIT.java      |  3 +-
 .../test/functional/ScanIteratorIT.java         |  2 +-
 .../test/functional/ServerSideErrorIT.java      |  4 +--
 .../accumulo/test/functional/ShutdownIT.java    |  3 +-
 .../test/functional/SlowConstraint.java         |  4 +--
 .../accumulo/test/functional/SlowIterator.java  |  4 +--
 .../accumulo/test/functional/SummaryIT.java     |  8 ++---
 .../test/functional/TableChangeStateIT.java     | 26 +++++++-------
 .../accumulo/test/functional/TableIT.java       |  4 +--
 .../accumulo/test/functional/TimeoutIT.java     |  3 +-
 .../accumulo/test/functional/WALSunnyDayIT.java |  2 +-
 .../test/functional/YieldingIterator.java       |  9 +++--
 .../test/functional/ZookeeperRestartIT.java     |  3 +-
 .../CloseWriteAheadLogReferencesIT.java         |  3 +-
 .../accumulo/test/proxy/ProxyDurabilityIT.java  |  2 +-
 .../accumulo/test/proxy/SimpleProxyBase.java    |  4 +--
 .../test/replication/FinishedWorkUpdaterIT.java |  3 +-
 .../replication/MultiInstanceReplicationIT.java |  3 +-
 .../UnorderedWorkAssignerReplicationIT.java     |  3 +-
 .../scan/CollectTabletStatsTest.java            |  5 ++-
 184 files changed, 392 insertions(+), 336 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
index 3612865,7bd97a6..960fa6f
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
@@@ -28,11 -28,9 +28,11 @@@ import java.util.List
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.SortedSet;
 +import java.util.TreeMap;
  import java.util.TreeSet;
  import java.util.concurrent.TimeUnit;
- 
 +import java.util.stream.Collectors;
+ 
  import org.apache.accumulo.core.client.AccumuloException;
  import org.apache.accumulo.core.client.AccumuloSecurityException;
  import org.apache.accumulo.core.client.IteratorSetting;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java
index e4a6730,39d5822..ee19ac5
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Namespaces.java
@@@ -24,8 -24,7 +24,8 @@@ import java.util.List
  import java.util.Map.Entry;
  import java.util.SortedMap;
  import java.util.TreeMap;
- 
 +import java.util.function.BiConsumer;
+ 
  import org.apache.accumulo.core.Constants;
  import org.apache.accumulo.core.client.Instance;
  import org.apache.accumulo.core.client.NamespaceNotFoundException;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/SyncingTabletLocator.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
index b1d1cad,fcf838f..5beec3a
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
@@@ -26,8 -26,7 +26,8 @@@ import java.util.Map
  import java.util.SortedMap;
  import java.util.TreeMap;
  import java.util.concurrent.atomic.AtomicLong;
- 
 +import java.util.function.BiConsumer;
+ 
  import org.apache.accumulo.core.Constants;
  import org.apache.accumulo.core.client.Instance;
  import org.apache.accumulo.core.client.NamespaceNotFoundException;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileSummariesRetriever.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/rfile/RFileSummariesRetriever.java
index b1f8954,0000000..1e47f00
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileSummariesRetriever.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileSummariesRetriever.java
@@@ -1,123 -1,0 +1,123 @@@
 +/*
 + * 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.core.client.rfile;
 +
 +import java.io.IOException;
 +import java.util.Collection;
 +import java.util.Collections;
 +import java.util.Objects;
 +import java.util.function.Predicate;
 +
 +import org.apache.accumulo.core.client.rfile.RFile.SummaryFSOptions;
 +import org.apache.accumulo.core.client.rfile.RFile.SummaryInputArguments;
 +import org.apache.accumulo.core.client.rfile.RFile.SummaryOptions;
 +import org.apache.accumulo.core.client.rfile.RFileScannerBuilder.InputArgs;
 +import org.apache.accumulo.core.client.summary.SummarizerConfiguration;
 +import org.apache.accumulo.core.client.summary.Summary;
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.DefaultConfiguration;
- import org.apache.accumulo.core.summary.SummaryReader;
 +import org.apache.accumulo.core.summary.Gatherer;
 +import org.apache.accumulo.core.summary.SummarizerFactory;
 +import org.apache.accumulo.core.summary.SummaryCollection;
++import org.apache.accumulo.core.summary.SummaryReader;
 +import org.apache.hadoop.conf.Configuration;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.io.Text;
 +
 +class RFileSummariesRetriever implements SummaryInputArguments, SummaryFSOptions, SummaryOptions {
 +
 +  private Predicate<SummarizerConfiguration> summarySelector = sc -> true;
 +  private Text startRow;
 +  private InputArgs in;
 +  private Text endRow;
 +
 +  @Override
 +  public SummaryOptions selectSummaries(Predicate<SummarizerConfiguration> summarySelector) {
 +    Objects.requireNonNull(summarySelector);
 +    this.summarySelector = summarySelector;
 +    return this;
 +  }
 +
 +  @Override
 +  public SummaryOptions startRow(CharSequence startRow) {
 +    return startRow(new Text(startRow.toString()));
 +  }
 +
 +  @Override
 +  public SummaryOptions startRow(Text startRow) {
 +    Objects.requireNonNull(startRow);
 +    this.startRow = startRow;
 +    return this;
 +  }
 +
 +  @Override
 +  public SummaryOptions endRow(CharSequence endRow) {
 +    return endRow(new Text(endRow.toString()));
 +  }
 +
 +  @Override
 +  public SummaryOptions endRow(Text endRow) {
 +    Objects.requireNonNull(endRow);
 +    this.endRow = endRow;
 +    return this;
 +  }
 +
 +  @Override
 +  public Collection<Summary> read() throws IOException {
 +    SummarizerFactory factory = new SummarizerFactory();
 +    AccumuloConfiguration acuconf = DefaultConfiguration.getInstance();
 +    Configuration conf = in.getFileSystem().getConf();
 +
 +    RFileSource[] sources = in.getSources();
 +    try {
 +      SummaryCollection all = new SummaryCollection();
 +      for (RFileSource source : in.getSources()) {
 +        SummaryReader fileSummary = SummaryReader.load(conf, acuconf, source.getInputStream(), source.getLength(), summarySelector, factory);
 +        SummaryCollection sc = fileSummary.getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow)));
 +        all.merge(sc, factory);
 +      }
 +
 +      return all.getSummaries();
 +    } finally {
 +      for (RFileSource source : sources) {
 +        source.getInputStream().close();
 +      }
 +    }
 +  }
 +
 +  @Override
 +  public SummaryOptions withFileSystem(FileSystem fs) {
 +    Objects.requireNonNull(fs);
 +    this.in.fs = fs;
 +    return this;
 +  }
 +
 +  @Override
 +  public SummaryOptions from(RFileSource... inputs) {
 +    Objects.requireNonNull(inputs);
 +    in = new InputArgs(inputs);
 +    return this;
 +  }
 +
 +  @Override
 +  public SummaryFSOptions from(String... files) {
 +    Objects.requireNonNull(files);
 +    in = new InputArgs(files);
 +    return this;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/data/Key.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/data/KeyBuilder.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/data/KeyBuilder.java
index 870a584,0000000..de484a2
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/data/KeyBuilder.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/KeyBuilder.java
@@@ -1,439 -1,0 +1,439 @@@
 +/*
 + * 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.core.data;
 +
- import org.apache.accumulo.core.security.ColumnVisibility;
- import org.apache.hadoop.io.Text;
- 
 +import java.nio.CharBuffer;
 +import java.nio.charset.CharacterCodingException;
 +import java.nio.charset.Charset;
 +import java.nio.charset.CharsetEncoder;
 +import java.nio.charset.CodingErrorAction;
 +
++import org.apache.accumulo.core.security.ColumnVisibility;
++import org.apache.hadoop.io.Text;
++
 +/**
 + * A builder used to build {@link Key}s by defining their components.
 + *
 + * The rules are:
 + * <ul>
 + * <li>All components of the {@link Key} are optional except the row</li>
 + * <li>Components not explicitly set default to empty byte array except the timestamp which defaults to <code>Long.MAX_VALUE</code></li>
 + * <li>The column qualifier can only be set if the column family has been set first</li>
 + * <li>The column visibility can only be set if at least the column family has been set first</li>
 + * </ul>
 + *
 + * The builder supports three types of components: <code>byte[]</code>, <code>Text</code> and <code>CharSequence</code>. <code>CharSequence</code>s must be
 + * UTF-8 encoded.
 + *
 + * The builder is mutable and not thread safe.
 + *
 + * @see org.apache.accumulo.core.data.Key
 + * @since 2.0
 + */
 +public class KeyBuilder {
 +
 +  /**
 +   * Base Builder interface which can be used to set the {@link Key} timestamp and delete marker and to build the {@link Key}.
 +   *
 +   * @since 2.0
 +   */
 +  public interface Build {
 +
 +    /**
 +     * Build a {@link Key} from this builder.
 +     *
 +     * @return the {@link Key} built from this builder
 +     */
 +    Key build();
 +
 +    /**
 +     * Change the timestamp of the {@link Key} created.
 +     *
 +     * @param timestamp
 +     *          the timestamp to use for the {@link Key}
 +     * @return this builder
 +     */
 +    Build timestamp(long timestamp);
 +
 +    /**
 +     * Set the deleted marker of the {@link Key} to the parameter.
 +     *
 +     * @param deleted
 +     *          if the {@link Key} should be marked as deleted or not
 +     * @return this builder
 +     */
 +    Build deleted(boolean deleted);
 +  }
 +
 +  /**
 +   * Builder step used to set the row part of the {@link Key}.
 +   *
 +   * @since 2.0
 +   */
 +  public interface RowStep extends Build {
 +
 +    /**
 +     * Set the row of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param row
 +     *          the row to use for the key
 +     * @return this builder
 +     */
 +    ColumnFamilyStep row(final Text row);
 +
 +    /**
 +     * Set the row of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param row
 +     *          the row to use for the key
 +     * @return this builder
 +     */
 +    ColumnFamilyStep row(final byte[] row);
 +
 +    /**
 +     * Set the row of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param row
 +     *          the row to use for the key
 +     * @param offset
 +     *          the offset within the array of the first byte to be read; must be non-negative and no larger than row.length
 +     * @param length
 +     *          the number of bytes to be read from the given array; must be non-negative and no larger than row.length - offset
 +     * @return this builder
 +     */
 +    ColumnFamilyStep row(final byte[] row, int offset, int length);
 +
 +    /**
 +     * Set the row of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param row
 +     *          the row to use for the key. The encoding must be UTF-8
 +     * @return this builder
 +     */
 +    ColumnFamilyStep row(final CharSequence row);
 +  }
 +
 +  /**
 +   * Builder step used to set the columnFamily part of the {@link Key}.
 +   *
 +   * @since 2.0
 +   */
 +  public interface ColumnFamilyStep extends ColumnVisibilityStep {
 +
 +    /**
 +     * Set the column family of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnFamily
 +     *          the column family to use for the {@link Key}
 +     * @return this builder
 +     */
 +    ColumnQualifierStep family(final byte[] columnFamily);
 +
 +    /**
 +     * Set the column family of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnFamily
 +     *          the column family to use for the {@link Key}
 +     * @param offset
 +     *          the offset within the array of the first byte to be read; must be non-negative and no larger than row.length
 +     * @param length
 +     *          the number of bytes to be read from the given array; must be non-negative and no larger than row.length - offset
 +     * @return this builder
 +     */
 +    ColumnQualifierStep family(final byte[] columnFamily, int offset, int length);
 +
 +    /**
 +     * Set the column family of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnFamily
 +     *          the column family to use for the {@link Key}
 +     * @return this builder
 +     */
 +    ColumnQualifierStep family(final Text columnFamily);
 +
 +    /**
 +     * Set the column family of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnFamily
 +     *          the column family to use for the {@link Key}. The encoding must be UTF-8
 +     * @return this builder
 +     */
 +    ColumnQualifierStep family(final CharSequence columnFamily);
 +  }
 +
 +  /**
 +   * Builder step used to set the column qualifier part of the {@link Key}.
 +   *
 +   * @since 2.0
 +   */
 +  public interface ColumnQualifierStep extends ColumnVisibilityStep {
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnQualifier
 +     *          the column qualifier to use for the {@link Key}
 +     * @return this builder
 +     */
 +    ColumnVisibilityStep qualifier(final byte[] columnQualifier);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnQualifier
 +     *          the column qualifier to use for the {@link Key}
 +     * @param offset
 +     *          the offset within the array of the first byte to be read; must be non-negative and no larger than row.length
 +     * @param length
 +     *          the number of bytes to be read from the given array; must be non-negative and no larger than row.length - offset
 +     * @return this builder
 +     */
 +    ColumnVisibilityStep qualifier(final byte[] columnQualifier, int offset, int length);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnQualifier
 +     *          the column qualifier to use for the {@link Key}
 +     * @return this builder
 +     */
 +    ColumnVisibilityStep qualifier(final Text columnQualifier);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnQualifier
 +     *          the column qualifier to use for the {@link Key}. The encoding must be UTF-8
 +     * @return this builder
 +     */
 +    ColumnVisibilityStep qualifier(final CharSequence columnQualifier);
 +  }
 +
 +  /**
 +   * Builder step used to set the column visibility part of the {@link Key}.
 +   *
 +   * @since 2.0
 +   */
 +  public interface ColumnVisibilityStep extends Build {
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnVisibility
 +     *          the column visibility to use for the {@link Key}
 +     * @return this builder
 +     */
 +    Build visibility(final byte[] columnVisibility);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnVisibility
 +     *          the column visibility to use for the {@link Key}
 +     * @param offset
 +     *          the offset within the array of the first byte to be read; must be non-negative and no larger than row.length
 +     * @param length
 +     *          the number of bytes to be read from the given array; must be non-negative and no larger than row.length - offset
 +     * @return this builder
 +     */
 +    Build visibility(final byte[] columnVisibility, int offset, int length);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnVisibility
 +     *          the column visibility to use for the {@link Key}
 +     * @return this builder
 +     */
 +    Build visibility(final Text columnVisibility);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnVisibility
 +     *          the column visibility to use for the {@link Key}. The encoding must be UTF-8
 +     * @return this builder
 +     */
 +    Build visibility(final CharSequence columnVisibility);
 +
 +    /**
 +     * Set the column qualifier of the {@link Key} that this builder will build to the parameter.
 +     *
 +     * @param columnVisibility
 +     *          the column visibility to use for the {@link Key}
 +     * @return this builder
 +     */
 +    Build visibility(final ColumnVisibility columnVisibility);
 +  }
 +
 +  /**
 +   * @since 2.0
 +   */
 +  static class KeyBuilderImpl implements RowStep, ColumnFamilyStep, ColumnQualifierStep, ColumnVisibilityStep {
 +
 +    protected static final byte EMPTY_BYTES[] = new byte[0];
 +
 +    private final boolean copyBytes;
 +    private byte[] row = EMPTY_BYTES;
 +    private int rowOffset = 0;
 +    private int rowLength = 0;
 +    private byte[] family = EMPTY_BYTES;
 +    private int familyOffset = 0;
 +    private int familyLength = 0;
 +    private byte[] qualifier = EMPTY_BYTES;
 +    private int qualifierOffset = 0;
 +    private int qualifierLength = 0;
 +    private byte[] visibility = EMPTY_BYTES;
 +    private int visibilityOffset = 0;
 +    private int visibilityLength = 0;
 +    private long timestamp = Long.MAX_VALUE;
 +    private boolean deleted = false;
 +
 +    KeyBuilderImpl(boolean copyBytes) {
 +      this.copyBytes = copyBytes;
 +    }
 +
 +    private byte[] copyBytesIfNeeded(final byte[] bytes, int offset, int length) {
 +      return Key.copyIfNeeded(bytes, offset, length, this.copyBytes);
 +    }
 +
 +    private byte[] encodeCharSequence(CharSequence chars) {
 +      CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder().onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);
 +      try {
 +        return encoder.encode(CharBuffer.wrap(chars)).array();
 +      } catch (CharacterCodingException ex) {
 +        throw new RuntimeException("KeyBuilder supports only CharSequences encoded in UTF-8", ex);
 +      }
 +    }
 +
 +    @Override
 +    public ColumnFamilyStep row(final byte[] row, int offset, int length) {
 +      this.row = copyBytesIfNeeded(row, offset, length);
 +      this.rowOffset = this.copyBytes ? 0 : offset;
 +      this.rowLength = this.copyBytes ? this.row.length : length;
 +      return this;
 +    }
 +
 +    @Override
 +    public ColumnFamilyStep row(final byte[] row) {
 +      return row(row, 0, row.length);
 +    }
 +
 +    @Override
 +    public ColumnFamilyStep row(final Text row) {
 +      return row(row.getBytes(), 0, row.getLength());
 +    }
 +
 +    @Override
 +    public ColumnFamilyStep row(final CharSequence row) {
 +      return row(encodeCharSequence(row));
 +    }
 +
 +    @Override
 +    public ColumnQualifierStep family(final byte[] family, int offset, int length) {
 +      this.family = copyBytesIfNeeded(family, offset, length);
 +      this.familyOffset = this.copyBytes ? 0 : offset;
 +      this.familyLength = this.copyBytes ? this.family.length : length;
 +      return this;
 +    }
 +
 +    @Override
 +    public ColumnQualifierStep family(final byte[] family) {
 +      return family(family, 0, family.length);
 +    }
 +
 +    @Override
 +    public ColumnQualifierStep family(Text family) {
 +      return family(family.getBytes(), 0, family.getLength());
 +    }
 +
 +    @Override
 +    public ColumnQualifierStep family(CharSequence family) {
 +      return family(encodeCharSequence(family));
 +    }
 +
 +    @Override
 +    public ColumnVisibilityStep qualifier(final byte[] qualifier, int offset, int length) {
 +      this.qualifier = copyBytesIfNeeded(qualifier, offset, length);
 +      this.qualifierOffset = this.copyBytes ? 0 : offset;
 +      this.qualifierLength = this.copyBytes ? this.qualifier.length : length;
 +      return this;
 +    }
 +
 +    @Override
 +    public ColumnVisibilityStep qualifier(final byte[] qualifier) {
 +      return qualifier(qualifier, 0, qualifier.length);
 +    }
 +
 +    @Override
 +    public ColumnVisibilityStep qualifier(Text qualifier) {
 +      return qualifier(qualifier.getBytes(), 0, qualifier.getLength());
 +    }
 +
 +    @Override
 +    public ColumnVisibilityStep qualifier(CharSequence qualifier) {
 +      return qualifier(encodeCharSequence(qualifier));
 +    }
 +
 +    @Override
 +    public Build visibility(final byte[] visibility, int offset, int length) {
 +      this.visibility = copyBytesIfNeeded(visibility, offset, length);
 +      this.visibilityOffset = this.copyBytes ? 0 : offset;
 +      this.visibilityLength = this.copyBytes ? this.visibility.length : length;
 +      return this;
 +    }
 +
 +    @Override
 +    public Build visibility(final byte[] visibility) {
 +      return visibility(visibility, 0, visibility.length);
 +    }
 +
 +    @Override
 +    public Build visibility(Text visibility) {
 +      return visibility(visibility.getBytes(), 0, visibility.getLength());
 +    }
 +
 +    @Override
 +    public Build visibility(CharSequence visibility) {
 +      return visibility(encodeCharSequence(visibility));
 +    }
 +
 +    @Override
 +    public Build visibility(ColumnVisibility visibility) {
 +      byte[] expr = visibility.getExpression();
 +      return visibility(expr, 0, expr.length);
 +    }
 +
 +    @Override
 +    final public Build timestamp(long timestamp) {
 +      this.timestamp = timestamp;
 +      return this;
 +    }
 +
 +    @Override
 +    public Build deleted(boolean deleted) {
 +      this.deleted = deleted;
 +      return this;
 +    }
 +
 +    @Override
 +    public Key build() {
 +      return new Key(this.row, this.rowOffset, this.rowLength, this.family, this.familyOffset, this.familyLength, this.qualifier, this.qualifierOffset,
 +          this.qualifierLength, this.visibility, this.visibilityOffset, this.visibilityLength, this.timestamp, this.deleted, false);
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
index e43b4f7,8892d66..3feeb6d
--- a/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
@@@ -27,8 -27,7 +27,8 @@@ import org.apache.accumulo.core.data.Ke
  import org.apache.accumulo.core.data.PartialKey;
  import org.apache.accumulo.core.data.Range;
  import org.apache.accumulo.core.data.Value;
- import org.apache.hadoop.io.Text;
 +import org.apache.commons.lang.math.NumberUtils;
+ import org.apache.hadoop.io.Text;
  
  public class FirstEntryInRowIterator extends SkippingIterator implements OptionDescriber {
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/summary/SummaryWriter.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/summary/SummaryWriter.java
index f9aa054,0000000..727d272
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummaryWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummaryWriter.java
@@@ -1,157 -1,0 +1,157 @@@
 +/*
 + * 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.core.summary;
 +
 +import java.io.DataOutputStream;
 +import java.io.IOException;
 +import java.util.List;
- import java.util.Set;
 +import java.util.Map.Entry;
++import java.util.Set;
 +
 +import org.apache.accumulo.core.client.summary.SummarizerConfiguration;
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.Property;
 +import org.apache.accumulo.core.data.ByteSequence;
 +import org.apache.accumulo.core.data.Key;
 +import org.apache.accumulo.core.data.Value;
 +import org.apache.accumulo.core.file.FileSKVWriter;
 +import org.apache.hadoop.io.WritableUtils;
 +
 +public class SummaryWriter implements FileSKVWriter {
 +
 +  static final String METASTORE_PREFIX = "accumulo.summaries";
 +  static final String METASTORE_INDEX = "accumulo.summaries.index";
 +
 +  // echo "accumulo summarize" | sha1sum | head -c 8
 +  static long MAGIC = 0x15ea283ec03e4c49L;
 +  static byte VER = 1;
 +
 +  private FileSKVWriter writer;
 +  private SummarySerializer.Builder[] summaryStores;
 +
 +  private SummaryWriter(FileSKVWriter writer, SummarizerFactory factory, List<SummarizerConfiguration> configs, long maxSize) {
 +    this.writer = writer;
 +    int i = 0;
 +    summaryStores = new SummarySerializer.Builder[configs.size()];
 +    for (SummarizerConfiguration sconf : configs) {
 +      summaryStores[i++] = SummarySerializer.builder(sconf, factory, maxSize);
 +    }
 +  }
 +
 +  @Override
 +  public boolean supportsLocalityGroups() {
 +    return true;
 +  }
 +
 +  @Override
 +  public void startNewLocalityGroup(String name, Set<ByteSequence> columnFamilies) throws IOException {
 +    for (SummarySerializer.Builder ssb : summaryStores) {
 +      ssb.startNewLocalityGroup(name, columnFamilies);
 +    }
 +
 +    writer.startNewLocalityGroup(name, columnFamilies);
 +  }
 +
 +  @Override
 +  public void startDefaultLocalityGroup() throws IOException {
 +    for (SummarySerializer.Builder ssb : summaryStores) {
 +      ssb.startDefaultLocalityGroup();
 +    }
 +    writer.startDefaultLocalityGroup();
 +  }
 +
 +  @Override
 +  public void append(Key key, Value value) throws IOException {
 +    writer.append(key, value);
 +    for (SummarySerializer.Builder ssb : summaryStores) {
 +      ssb.put(key, value);
 +    }
 +  }
 +
 +  @Override
 +  public DataOutputStream createMetaStore(String name) throws IOException {
 +    return writer.createMetaStore(name);
 +  }
 +
 +  public void writeConfig(SummarizerConfiguration conf, DataOutputStream dos) throws IOException {
 +    // save class (and its config) used to generate summaries
 +    dos.writeUTF(conf.getClassName());
 +    dos.writeUTF(conf.getPropertyId());
 +    WritableUtils.writeVInt(dos, conf.getOptions().size());
 +    for (Entry<String,String> entry : conf.getOptions().entrySet()) {
 +      dos.writeUTF(entry.getKey());
 +      dos.writeUTF(entry.getValue());
 +    }
 +  }
 +
 +  @Override
 +  public void close() throws IOException {
 +
 +    DataOutputStream out = writer.createMetaStore(METASTORE_INDEX);
 +    out.writeLong(MAGIC);
 +    out.write(VER);
 +    WritableUtils.writeVInt(out, summaryStores.length);
 +
 +    // Could possibly inline small summaries in the future. Breaking summaries into multiple block is better for caching a subset of summaries. Also, keeping
 +    // the index small is good for the case where summaries that do not exist are requested. However multiple blocks cause more random I/O in the case when its
 +    // not yet in the cache.
 +
 +    for (int i = 0; i < summaryStores.length; i++) {
 +      writeConfig(summaryStores[i].getSummarizerConfiguration(), out);
 +      // write if summary is inlined in index... support for possible future optimizations.
 +      out.writeBoolean(false);
 +      // write pointer to block that will contain summary data
 +      WritableUtils.writeVInt(out, i);
 +      // write offset of summary data within block. This is not currently used, but it supports storing multiple summaries in an external block in the
 +      // future without changing the code.
 +      WritableUtils.writeVInt(out, 0);
 +    }
 +    out.close();
 +
 +    for (int i = 0; i < summaryStores.length; i++) {
 +      DataOutputStream summaryOut = writer.createMetaStore(METASTORE_PREFIX + "." + i);
 +      summaryStores[i].save(summaryOut);
 +      summaryOut.close();
 +    }
 +
 +    writer.close();
 +  }
 +
 +  @Override
 +  public long getLength() throws IOException {
 +    return writer.getLength();
 +  }
 +
 +  public static FileSKVWriter wrap(FileSKVWriter writer, AccumuloConfiguration tableConfig, boolean useAccumuloStart) {
 +    List<SummarizerConfiguration> configs = SummarizerConfigurationUtil.getSummarizerConfigs(tableConfig);
 +
 +    if (configs.size() == 0) {
 +      return writer;
 +    }
 +
 +    SummarizerFactory factory;
 +    if (useAccumuloStart) {
 +      factory = new SummarizerFactory(tableConfig);
 +    } else {
 +      factory = new SummarizerFactory();
 +    }
 +
 +    long maxSize = tableConfig.getAsBytes(Property.TABLE_FILE_SUMMARY_MAX_SIZE);
 +    return new SummaryWriter(writer, factory, configs, maxSize);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
index 5fc4e60,0000000..cf79fa9
mode 100644,000000..100644
--- a/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
@@@ -1,292 -1,0 +1,292 @@@
 +/*
 + * 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.core.data;
 +
- import org.apache.accumulo.core.security.ColumnVisibility;
- import org.apache.hadoop.io.Text;
- import org.junit.Test;
- 
- import java.nio.charset.StandardCharsets;
- 
 +import static org.junit.Assert.assertEquals;
 +import static org.junit.Assert.assertNotEquals;
 +import static org.junit.Assert.assertSame;
 +
++import java.nio.charset.StandardCharsets;
++
++import org.apache.accumulo.core.security.ColumnVisibility;
++import org.apache.hadoop.io.Text;
++import org.junit.Test;
++
 +public class KeyBuilderTest {
 +
 +  private static final byte EMPTY_BYTES[] = new byte[0];
 +  byte[] rowBytes = "row".getBytes(StandardCharsets.UTF_8);
 +  byte[] familyBytes = "family".getBytes(StandardCharsets.UTF_8);
 +  byte[] qualifierBytes = "qualifier".getBytes(StandardCharsets.UTF_8);
 +  byte[] visibilityBytes = "visibility".getBytes(StandardCharsets.UTF_8);
 +  Text rowText = new Text(rowBytes);
 +  Text familyText = new Text(familyBytes);
 +  Text qualifierText = new Text(qualifierBytes);
 +  Text visibilityText = new Text(visibilityBytes);
 +  ColumnVisibility visibilityVisibility = new ColumnVisibility(visibilityBytes);
 +
 +  @Test
 +  public void testKeyBuildingFromRow() {
 +    Key keyBuilt = Key.builder().row("foo").build();
 +    Key keyExpected = new Key("foo");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamily() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").build();
 +    Key keyExpected = new Key("foo", "bar");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifier() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").qualifier("baz").build();
 +    Key keyExpected = new Key("foo", "bar", "baz");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibility() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").qualifier("baz").visibility("v").build();
 +    Key keyExpected = new Key("foo", "bar", "baz", "v");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestamp() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").qualifier("baz").visibility("v").timestamp(1L).build();
 +    Key keyExpected = new Key("foo", "bar", "baz", "v", 1L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestampDeleted() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").qualifier("baz").visibility("v").timestamp(10L).deleted(true).build();
 +    Key keyExpected = new Key("foo", "bar", "baz", "v", 10L);
 +    keyExpected.setDeleted(true);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowVisibility() {
 +    Key keyBuilt = Key.builder().row("foo").visibility("v").build();
 +    Key keyExpected = new Key("foo", "", "", "v");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyVisibility() {
 +    Key keyBuilt = Key.builder().row("foo").family("bar").visibility("v").build();
 +    Key keyExpected = new Key("foo", "bar", "", "v");
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void textKeyBuildingFromRowTimestamp() {
 +    Key keyBuilt = Key.builder().row("foo").timestamp(3L).build();
 +    Key keyExpected = new Key("foo");
 +    keyExpected.setTimestamp(3L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).build();
 +    Key keyExpected = new Key(rowBytes, EMPTY_BYTES, EMPTY_BYTES, EMPTY_BYTES, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, EMPTY_BYTES, EMPTY_BYTES, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).qualifier(qualifierBytes).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, qualifierBytes, EMPTY_BYTES, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).qualifier(qualifierBytes).visibility(visibilityBytes).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, qualifierBytes, visibilityBytes, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestampBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).qualifier(qualifierBytes).visibility(visibilityBytes).timestamp(1L).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, qualifierBytes, visibilityBytes, 1L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestampDeletedBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).qualifier(qualifierBytes).visibility(visibilityBytes).timestamp(10L).deleted(true).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, qualifierBytes, visibilityBytes, 10L);
 +    keyExpected.setDeleted(true);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowVisibilityBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).visibility(visibilityBytes).build();
 +    Key keyExpected = new Key(rowBytes, EMPTY_BYTES, EMPTY_BYTES, visibilityBytes, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyVisibilityBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).family(familyBytes).visibility(visibilityBytes).build();
 +    Key keyExpected = new Key(rowBytes, familyBytes, EMPTY_BYTES, visibilityBytes, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void textKeyBuildingFromRowTimestampBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes).timestamp(3L).build();
 +    Key keyExpected = new Key(rowBytes, EMPTY_BYTES, EMPTY_BYTES, EMPTY_BYTES, Long.MAX_VALUE);
 +    keyExpected.setTimestamp(3L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowText() {
 +    Key keyBuilt = Key.builder().row(rowText).build();
 +    Key keyExpected = new Key(rowText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).build();
 +    Key keyExpected = new Key(rowText, familyText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).qualifier(qualifierText).build();
 +    Key keyExpected = new Key(rowText, familyText, qualifierText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).qualifier(qualifierText).visibility(visibilityText).build();
 +    Key keyExpected = new Key(rowText, familyText, qualifierText, visibilityText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestampText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).qualifier(qualifierText).visibility(visibilityText).timestamp(1L).build();
 +    Key keyExpected = new Key(rowText, familyText, qualifierText, visibilityText, 1L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyQualifierVisibilityTimestampDeletedText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).qualifier(qualifierText).visibility(visibilityText).timestamp(10L).deleted(true).build();
 +    Key keyExpected = new Key(rowText, familyText, qualifierText, visibilityText, 10L);
 +    keyExpected.setDeleted(true);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowVisibilityText() {
 +    Key keyBuilt = Key.builder().row(rowText).visibility(visibilityText).build();
 +    Key keyExpected = new Key(rowText, new Text(), new Text(), visibilityText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyVisibilityText() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).visibility(visibilityText).build();
 +    Key keyExpected = new Key(rowText, familyText, new Text(), visibilityText);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowFamilyVisibilityVisibility() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyText).visibility(visibilityVisibility).build();
 +    Key keyExpected = new Key(rowText, familyText, new Text(), visibilityVisibility, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingFromRowTimestampText() {
 +    Key keyBuilt = Key.builder().row(rowText).timestamp(3L).build();
 +    Key keyExpected = new Key(rowText);
 +    keyExpected.setTimestamp(3L);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingReusingBytes() {
 +    byte[] reuse = new byte[] {1, 2, 3};
 +    KeyBuilder.Build keyBuilder = Key.builder(false).row(reuse);
 +    Key keyBuilt = keyBuilder.build();
 +    assertSame(reuse, keyBuilt.getRowBytes());
 +  }
 +
 +  @Test
 +  public void testKeyBuildingCopyBytes() {
 +    byte[] reuse = new byte[] {1, 2, 3};
 +    KeyBuilder.Build keyBuilder = Key.builder(true).row(reuse);
 +    Key keyBuilt = keyBuilder.build();
 +    assertNotEquals(reuse, keyBuilt.getRowBytes());
 +    Key keyBuilt2 = keyBuilder.build();
 +    assertNotEquals(reuse, keyBuilt2.getRowBytes());
 +  }
 +
 +  @Test
 +  public void testKeyHeterogeneous() {
 +    Key keyBuilt = Key.builder().row(rowText).family(familyBytes).qualifier("foo").build();
 +    Text fooText = new Text("foo");
 +    Key keyExpected = new Key(rowText.getBytes(), 0, rowText.getLength(), familyBytes, 0, familyBytes.length, fooText.getBytes(), 0, fooText.getLength(),
 +        EMPTY_BYTES, 0, 0, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyUsingSubsetOfBytes() {
 +    Key keyBuilt = Key.builder().row(rowBytes, 0, rowBytes.length - 1).build();
 +    Key keyExpected = new Key(rowBytes, 0, rowBytes.length - 1, EMPTY_BYTES, 0, 0, EMPTY_BYTES, 0, 0, EMPTY_BYTES, 0, 0, Long.MAX_VALUE);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingWithMultipleTimestamps() {
 +    Key keyBuilt = Key.builder().row("r").timestamp(44).timestamp(99).build();
 +    Key keyExpected = new Key("r", "", "", 99);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +
 +  @Test
 +  public void testKeyBuildingWithMultipleDeleted() {
 +    Key keyBuilt = Key.builder().row("r").deleted(true).deleted(false).build();
 +    Key keyExpected = new Key("r");
 +    keyExpected.setDeleted(false);
 +    assertEquals(keyExpected, keyBuilt);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/data/RangeTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/data/RangeTest.java
index 388c883,ec28d47..57b92cc
--- a/core/src/test/java/org/apache/accumulo/core/data/RangeTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/RangeTest.java
@@@ -25,9 -25,6 +25,7 @@@ import java.util.Arrays
  import java.util.HashSet;
  import java.util.List;
  
- import junit.framework.TestCase;
- 
 +import org.apache.accumulo.core.client.impl.Table;
  import org.apache.accumulo.core.data.impl.KeyExtent;
  import org.apache.accumulo.core.data.thrift.TRange;
  import org.apache.hadoop.io.Text;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiLevelIndexTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/file/rfile/MultiLevelIndexTest.java
index 1585baf,08889c0..1c61162
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiLevelIndexTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiLevelIndexTest.java
@@@ -20,9 -20,7 +20,8 @@@ import java.io.ByteArrayOutputStream
  import java.io.IOException;
  import java.util.Random;
  
- import junit.framework.TestCase;
  import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.DefaultConfiguration;
  import org.apache.accumulo.core.data.Key;
  import org.apache.accumulo.core.file.blockfile.ABlockWriter;
  import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
index 4d9d3ab,15e0743..ab9c975
--- a/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
@@@ -20,8 -20,7 +20,6 @@@ import java.util.Collections
  import java.util.HashSet;
  import java.util.TreeMap;
  
- import junit.framework.TestCase;
- 
 -import org.apache.accumulo.core.data.ByteSequence;
  import org.apache.accumulo.core.data.Column;
  import org.apache.accumulo.core.data.Key;
  import org.apache.accumulo.core.data.Range;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
index c455772,9328490..261441c
--- a/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
@@@ -40,6 -37,11 +38,8 @@@ import org.apache.accumulo.core.iterato
  import org.apache.accumulo.core.iterators.system.SourceSwitchingIterator.DataSource;
  import org.apache.hadoop.io.Text;
  
 -import com.google.common.base.Optional;
 -
+ import junit.framework.TestCase;
+ 
  public class SourceSwitchingIteratorTest extends TestCase {
  
    Key newKey(String row, String cf, String cq, long time) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
index 2ac1581,1acf5d8..a820afd
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
@@@ -24,10 -24,8 +24,8 @@@ import java.util.Map.Entry
  import java.util.Random;
  import java.util.TreeMap;
  
- import junit.framework.TestCase;
- 
  import org.apache.accumulo.core.client.IteratorSetting;
 -import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.DefaultConfiguration;
  import org.apache.accumulo.core.data.ByteSequence;
  import org.apache.accumulo.core.data.Key;
  import org.apache.accumulo.core.data.Range;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/core/src/test/java/org/apache/accumulo/core/rpc/TTimeoutTransportTest.java
----------------------------------------------------------------------
diff --cc core/src/test/java/org/apache/accumulo/core/rpc/TTimeoutTransportTest.java
index cedac9c,0000000..2732844
mode 100644,000000..100644
--- a/core/src/test/java/org/apache/accumulo/core/rpc/TTimeoutTransportTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/rpc/TTimeoutTransportTest.java
@@@ -1,151 -1,0 +1,151 @@@
 +/*
 + * 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.core.rpc;
 +
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.Socket;
- import java.net.SocketAddress;
- 
- import org.junit.Test;
- 
 +import static org.easymock.EasyMock.createMock;
 +import static org.easymock.EasyMock.createMockBuilder;
 +import static org.easymock.EasyMock.expect;
 +import static org.easymock.EasyMock.expectLastCall;
 +import static org.easymock.EasyMock.replay;
 +import static org.easymock.EasyMock.verify;
 +import static org.junit.Assert.fail;
 +
++import java.io.IOException;
++import java.io.InputStream;
++import java.net.Socket;
++import java.net.SocketAddress;
++
++import org.junit.Test;
++
 +/**
 + * Tests for {@link TTimeoutTransport}.
 + */
 +public class TTimeoutTransportTest {
 +
 +  void expectedSocketSetup(Socket s) throws IOException {
 +    s.setSoLinger(false, 0);
 +    expectLastCall().once();
 +    s.setTcpNoDelay(true);
 +    expectLastCall().once();
 +  }
 +
 +  @Test
 +  public void testFailedSocketOpenIsClosed() throws IOException {
 +    SocketAddress addr = createMock(SocketAddress.class);
 +    Socket s = createMock(Socket.class);
 +    TTimeoutTransport timeoutTransport = createMockBuilder(TTimeoutTransport.class).addMockedMethod("openSocketChannel").createMock();
 +
 +    // Return out mocked socket
 +    expect(timeoutTransport.openSocketChannel()).andReturn(s).once();
 +
 +    // tcpnodelay and solinger
 +    expectedSocketSetup(s);
 +
 +    // Connect to the addr
 +    s.connect(addr);
 +    expectLastCall().andThrow(new IOException());
 +
 +    // The socket should be closed after the above IOException
 +    s.close();
 +
 +    replay(addr, s, timeoutTransport);
 +
 +    try {
 +      timeoutTransport.openSocket(addr);
 +      fail("Expected to catch IOException but got none");
 +    } catch (IOException e) {
 +      // Expected
 +    }
 +
 +    verify(addr, s, timeoutTransport);
 +  }
 +
 +  @Test
 +  public void testFailedInputStreamClosesSocket() throws IOException {
 +    long timeout = 2 * 60 * 1000; // 2 mins
 +    SocketAddress addr = createMock(SocketAddress.class);
 +    Socket s = createMock(Socket.class);
 +    TTimeoutTransport timeoutTransport = createMockBuilder(TTimeoutTransport.class).addMockedMethod("openSocketChannel").addMockedMethod("wrapInputStream")
 +        .createMock();
 +
 +    // Return out mocked socket
 +    expect(timeoutTransport.openSocketChannel()).andReturn(s).once();
 +
 +    // tcpnodelay and solinger
 +    expectedSocketSetup(s);
 +
 +    // Connect to the addr
 +    s.connect(addr);
 +    expectLastCall().once();
 +
 +    expect(timeoutTransport.wrapInputStream(s, timeout)).andThrow(new IOException());
 +
 +    // The socket should be closed after the above IOException
 +    s.close();
 +
 +    replay(addr, s, timeoutTransport);
 +
 +    try {
 +      timeoutTransport.createInternal(addr, timeout);
 +      fail("Expected to catch IOException but got none");
 +    } catch (IOException e) {
 +      // Expected
 +    }
 +
 +    verify(addr, s, timeoutTransport);
 +  }
 +
 +  @Test
 +  public void testFailedOutputStreamClosesSocket() throws IOException {
 +    long timeout = 2 * 60 * 1000; // 2 mins
 +    SocketAddress addr = createMock(SocketAddress.class);
 +    Socket s = createMock(Socket.class);
 +    InputStream is = createMock(InputStream.class);
 +    TTimeoutTransport timeoutTransport = createMockBuilder(TTimeoutTransport.class).addMockedMethod("openSocketChannel").addMockedMethod("wrapInputStream")
 +        .addMockedMethod("wrapOutputStream").createMock();
 +
 +    // Return out mocked socket
 +    expect(timeoutTransport.openSocketChannel()).andReturn(s).once();
 +
 +    // tcpnodelay and solinger
 +    expectedSocketSetup(s);
 +
 +    // Connect to the addr
 +    s.connect(addr);
 +    expectLastCall().once();
 +
 +    // Input stream is set up
 +    expect(timeoutTransport.wrapInputStream(s, timeout)).andReturn(is);
 +    // Output stream fails to be set up
 +    expect(timeoutTransport.wrapOutputStream(s, timeout)).andThrow(new IOException());
 +
 +    // The socket should be closed after the above IOException
 +    s.close();
 +
 +    replay(addr, s, timeoutTransport);
 +
 +    try {
 +      timeoutTransport.createInternal(addr, timeout);
 +      fail("Expected to catch IOException but got none");
 +    } catch (IOException e) {
 +      // Expected
 +    }
 +
 +    verify(addr, s, timeoutTransport);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/YieldingTestCase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 6f5a10c,7e4e591..5f5c2c9
--- a/pom.xml
+++ b/pom.xml
@@@ -991,9 -844,15 +991,20 @@@
          </plugin>
          <plugin>
            <groupId>net.revelc.code</groupId>
 +          <artifactId>warbucks-maven-plugin</artifactId>
 +          <version>1.0.0</version>
 +        </plugin>
++        <plugin>
++          <groupId>net.revelc.code</groupId>
+           <artifactId>impsort-maven-plugin</artifactId>
+           <version>1.0.0</version>
+           <configuration>
+             <groups>java.,javax.,org.,com.</groups>
+             <excludes>
+               <exclude>**/thrift/*.java</exclude>
+             </excludes>
+           </configuration>
+         </plugin>
        </plugins>
      </pluginManagement>
      <plugins>
@@@ -1570,11 -1378,94 +1594,23 @@@
              </executions>
            </plugin>
            <plugin>
 -            <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
 -            <artifactId>maven-java-formatter-plugin</artifactId>
 -            <configuration>
 -              <configFile>${eclipseFormatterStyle}</configFile>
 -            </configuration>
 -          </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -    <profile>
 -      <!-- Minimal testing profile. (a.k.a. SunnyDay) -->
 -      <id>sunny</id>
 -      <properties>
 -        <failsafe.groups>org.apache.accumulo.test.categories.SunnyDayTests</failsafe.groups>
 -      </properties>
 -    </profile>
 -    <profile>
 -      <id>autoformat-with-jdk8</id>
 -      <activation>
 -        <jdk>[1.8,1.9)</jdk>
 -        <property>
 -          <name>!skipFormat</name>
 -        </property>
 -      </activation>
 -      <build>
 -        <plugins>
 -          <plugin>
+             <groupId>net.revelc.code</groupId>
+             <artifactId>impsort-maven-plugin</artifactId>
+             <executions>
+               <execution>
+                 <id>sort-imports</id>
+                 <goals>
+                   <goal>sort</goal>
+                 </goals>
+               </execution>
+             </executions>
+           </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -    <profile>
 -      <id>jdk8</id>
 -      <activation>
 -        <jdk>[1.8,1.9)</jdk>
 -      </activation>
 -      <build>
 -        <pluginManagement>
 -          <plugins>
 -            <plugin>
 -              <groupId>org.apache.maven.plugins</groupId>
 -              <artifactId>maven-javadoc-plugin</artifactId>
 -              <configuration>
 -                <quiet>true</quiet>
 -                <javadocVersion>1.8</javadocVersion>
 -                <additionalJOption>-J-Xmx512m</additionalJOption>
 -                <additionalparam>-Xdoclint:all,-Xdoclint:-missing</additionalparam>
 -              </configuration>
 -            </plugin>
 -            <plugin>
 -              <groupId>net.revelc.code</groupId>
 -              <artifactId>warbucks-maven-plugin</artifactId>
 -              <version>1.0.0</version>
 -            </plugin>
 -          </plugins>
 -        </pluginManagement>
 -        <plugins>
+           <plugin>
 -            <groupId>net.revelc.code</groupId>
 -            <artifactId>warbucks-maven-plugin</artifactId>
 -            <executions>
 -              <execution>
 -                <id>check-junit-categories-on-its</id>
 -                <goals>
 -                  <goal>check</goal>
 -                </goals>
 -                <configuration>
 -                  <rules>
 -                    <rule>
 -                      <includeMainClasses>true</includeMainClasses>
 -                      <includeTestClasses>true</includeTestClasses>
 -                      <classPattern>.*IT</classPattern>
 -                      <classAnnotationPattern>org[.]junit[.]experimental[.]categories[.]Category</classAnnotationPattern>
 -                    </rule>
 -                  </rules>
 -                </configuration>
 -              </execution>
 -            </executions>
 +            <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
 +            <artifactId>maven-java-formatter-plugin</artifactId>
 +            <configuration>
 +              <configFile>${eclipseFormatterStyle}</configFile>
 +            </configuration>
            </plugin>
          </plugins>
        </build>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/AccumuloServerContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooserEnvironment.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooserEnvironment.java
index b6886ba,b6d27cb..0747284
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooserEnvironment.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooserEnvironment.java
@@@ -16,8 -16,7 +16,9 @@@
   */
  package org.apache.accumulo.server.fs;
  
 -import com.google.common.base.Optional;
 +import java.util.Optional;
++
 +import org.apache.accumulo.core.client.impl.Table;
  
  public class VolumeChooserEnvironment {
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
index c3d15c8,030598a..d400679
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
@@@ -32,13 -32,9 +32,10 @@@ import java.util.SortedMap
  import java.util.TreeMap;
  import java.util.regex.Pattern;
  
- import com.google.common.collect.HashMultimap;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Multimap;
  import org.apache.accumulo.core.client.admin.TableOperations;
 -import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.client.impl.Table;
  import org.apache.accumulo.core.conf.ConfigurationObserver;
 +import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
  import org.apache.accumulo.core.conf.Property;
  import org.apache.accumulo.core.data.impl.KeyExtent;
  import org.apache.accumulo.core.master.thrift.TableInfo;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/main/java/org/apache/accumulo/server/rpc/HighlyAvailableServiceInvocationHandler.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/rpc/HighlyAvailableServiceInvocationHandler.java
index 9b9572e,0000000..c6ce391
mode 100644,000000..100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/HighlyAvailableServiceInvocationHandler.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/HighlyAvailableServiceInvocationHandler.java
@@@ -1,59 -1,0 +1,58 @@@
 +/*
 + * 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.server.rpc;
 +
 +import java.lang.reflect.InvocationHandler;
 +import java.lang.reflect.InvocationTargetException;
 +import java.lang.reflect.Method;
 +import java.util.Objects;
 +
 +import org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException;
 +import org.apache.accumulo.server.HighlyAvailableService;
- 
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * An {@link InvocationHandler} which checks to see if a {@link HighlyAvailableService} is the current active instance of that service, throwing
 + * {@link ThriftNotActiveServiceException} when it is not the current active instance.
 + */
 +public class HighlyAvailableServiceInvocationHandler<I> implements InvocationHandler {
 +  private static final Logger LOG = LoggerFactory.getLogger(HighlyAvailableServiceInvocationHandler.class);
 +
 +  private final I instance;
 +  private final HighlyAvailableService service;
 +
 +  public HighlyAvailableServiceInvocationHandler(I instance, HighlyAvailableService service) {
 +    this.instance = Objects.requireNonNull(instance);
 +    this.service = Objects.requireNonNull(service);
 +  }
 +
 +  @Override
 +  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
 +    // If the service is not active, throw an exception
 +    if (!service.isActiveService()) {
 +      LOG.trace("Denying access to RPC service as this instance is not the active instance.");
 +      throw new ThriftNotActiveServiceException();
 +    }
 +    try {
 +      // Otherwise, call the real method
 +      return method.invoke(instance, args);
 +    } catch (InvocationTargetException ex) {
 +      throw ex.getCause();
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/test/java/org/apache/accumulo/server/AccumuloServerContextTest.java
----------------------------------------------------------------------
diff --cc server/base/src/test/java/org/apache/accumulo/server/AccumuloServerContextTest.java
index 03003df,521fd7b..7bc670f
--- a/server/base/src/test/java/org/apache/accumulo/server/AccumuloServerContextTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/AccumuloServerContextTest.java
@@@ -23,8 -23,10 +23,9 @@@ import java.io.DataOutputStream
  import java.security.PrivilegedExceptionAction;
  import java.util.Iterator;
  import java.util.Map.Entry;
+ 
  import org.apache.accumulo.core.client.ClientConfiguration;
  import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty;
 -import org.apache.accumulo.core.client.Instance;
  import org.apache.accumulo.core.client.impl.ClientContext;
  import org.apache.accumulo.core.client.impl.Credentials;
  import org.apache.accumulo.core.client.security.tokens.PasswordToken;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/test/java/org/apache/accumulo/server/master/balancer/BaseHostRegexTableLoadBalancerTest.java
----------------------------------------------------------------------
diff --cc server/base/src/test/java/org/apache/accumulo/server/master/balancer/BaseHostRegexTableLoadBalancerTest.java
index 83d6312,e44491d..4606c04
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/BaseHostRegexTableLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/BaseHostRegexTableLoadBalancerTest.java
@@@ -27,7 -27,7 +27,8 @@@ import java.util.SortedMap
  import java.util.SortedSet;
  import java.util.TreeMap;
  import java.util.TreeSet;
 +import java.util.function.Predicate;
+ 
  import org.apache.accumulo.core.client.AccumuloException;
  import org.apache.accumulo.core.client.AccumuloSecurityException;
  import org.apache.accumulo.core.client.Connector;
@@@ -46,8 -43,7 +47,8 @@@ import org.apache.accumulo.core.conf.Pr
  import org.apache.accumulo.core.data.impl.KeyExtent;
  import org.apache.accumulo.core.master.thrift.TableInfo;
  import org.apache.accumulo.core.master.thrift.TabletServerStatus;
- import org.apache.accumulo.server.conf.NamespaceConfiguration;
  import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
++import org.apache.accumulo.server.conf.NamespaceConfiguration;
  import org.apache.accumulo.server.conf.ServerConfigurationFactory;
  import org.apache.accumulo.server.conf.TableConfiguration;
  import org.apache.accumulo.server.master.state.TServerInstance;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/base/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
----------------------------------------------------------------------
diff --cc server/base/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
index 928f2a2,f34cc3d..065eecf
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
@@@ -27,9 -25,9 +25,10 @@@ import java.util.Set
  import java.util.SortedMap;
  import java.util.TreeMap;
  import java.util.UUID;
+ 
  import org.apache.accumulo.core.client.Instance;
  import org.apache.accumulo.core.client.admin.TableOperations;
 +import org.apache.accumulo.core.client.impl.Table;
  import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
  import org.apache.accumulo.core.conf.DefaultConfiguration;
  import org.apache.accumulo.core.conf.Property;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneInfo.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneInfo.java
index 46e910e,96ff954..f4b983f
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneInfo.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneInfo.java
@@@ -23,6 -20,6 +20,9 @@@ import java.io.Serializable
  import java.util.Map;
  import java.util.Set;
  
++import org.apache.accumulo.core.client.impl.Namespace;
++import org.apache.accumulo.core.client.impl.Table;
++
  class CloneInfo implements Serializable {
  
    private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/master/src/main/java/org/apache/accumulo/master/tableOps/ExportInfo.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/ExportInfo.java
index fcefbfd,3e86488..6884a44
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/ExportInfo.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/ExportInfo.java
@@@ -16,11 -16,8 +16,11 @@@
   */
  package org.apache.accumulo.master.tableOps;
  
+ import java.io.Serializable;
+ 
 +import org.apache.accumulo.core.client.impl.Namespace;
 +import org.apache.accumulo.core.client.impl.Table;
 +
- import java.io.Serializable;
- 
  class ExportInfo implements Serializable {
  
    private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/master/src/main/java/org/apache/accumulo/master/tableOps/ImportedTableInfo.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/ImportedTableInfo.java
index 5378cc4,7c09eb1..365f693
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/ImportedTableInfo.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/ImportedTableInfo.java
@@@ -16,11 -16,8 +16,11 @@@
   */
  package org.apache.accumulo.master.tableOps;
  
+ import java.io.Serializable;
+ 
 +import org.apache.accumulo.core.client.impl.Namespace;
 +import org.apache.accumulo.core.client.impl.Table;
 +
- import java.io.Serializable;
- 
  class ImportedTableInfo implements Serializable {
  
    private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/master/src/main/java/org/apache/accumulo/master/tableOps/NamespaceInfo.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/NamespaceInfo.java
index c277233,aadb24f..0ed01e0
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/NamespaceInfo.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/NamespaceInfo.java
@@@ -19,8 -19,6 +19,8 @@@ package org.apache.accumulo.master.tabl
  import java.io.Serializable;
  import java.util.Map;
  
++import org.apache.accumulo.core.client.impl.Namespace;
++
  class NamespaceInfo implements Serializable {
  
    private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableInfo.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/TableInfo.java
index 5727833,ab418ae..8854e4f
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableInfo.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableInfo.java
@@@ -19,9 -19,6 +19,9 @@@ package org.apache.accumulo.master.tabl
  import java.io.Serializable;
  import java.util.Map;
  
++import org.apache.accumulo.core.client.impl.Namespace;
++import org.apache.accumulo.core.client.impl.Table;
++
  class TableInfo implements Serializable {
  
    private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3fcc76f8/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
----------------------------------------------------------------------


Mime
View raw message