accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [34/64] [abbrv] git commit: Merge branch '1.4.6-SNAPSHOT' into 1.5.2-SNAPSHOT
Date Wed, 09 Apr 2014 17:58:05 GMT
Merge branch '1.4.6-SNAPSHOT' into 1.5.2-SNAPSHOT

Conflicts:
	core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
	core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
	core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java
	core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
	core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
	core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
	core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java
	core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
	examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java
	minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
	server/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
	server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
	server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
	server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java
	server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
	server/src/main/java/org/apache/accumulo/server/util/RestoreZookeeper.java
	server/src/main/java/org/apache/accumulo/server/util/SendLogToChainsaw.java
	server/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
	server/src/main/java/org/apache/accumulo/server/util/TabletServerLocks.java
	src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
	src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java
	src/server/src/main/java/org/apache/accumulo/server/util/DumpMapFile.java
	src/server/src/main/java/org/apache/accumulo/server/util/DumpTabletsOnServer.java
	test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java
	test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
	trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java


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

Branch: refs/heads/1.5.2-SNAPSHOT
Commit: 92613388919b6fc138e829382cc1cbb6647faa31
Parents: 5363d78 c8e165a
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Apr 9 13:14:57 2014 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Apr 9 13:14:57 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/core/Constants.java     |   1 -
 .../core/client/ClientSideIteratorScanner.java  |   2 -
 .../apache/accumulo/core/client/Connector.java  |   2 -
 .../accumulo/core/client/IteratorSetting.java   |   4 -
 .../accumulo/core/client/RowIterator.java       |   4 -
 .../accumulo/core/client/ScannerBase.java       |   2 +-
 .../accumulo/core/client/ZooKeeperInstance.java |   2 -
 .../core/client/admin/ActiveCompaction.java     |   1 -
 .../core/client/admin/InstanceOperations.java   |  12 -
 .../client/admin/InstanceOperationsImpl.java    |  33 --
 .../core/client/admin/TableOperations.java      |  32 --
 .../core/client/admin/TableOperationsImpl.java  |   4 -
 .../core/client/impl/OfflineScanner.java        |   6 -
 .../core/client/impl/ThriftTransportPool.java   |  16 +-
 .../client/mapred/AccumuloOutputFormat.java     |   1 -
 .../core/client/mapred/InputFormatBase.java     |   1 -
 .../client/mapreduce/AccumuloOutputFormat.java  |   1 -
 .../core/client/mapreduce/InputFormatBase.java  |   1 -
 .../mapreduce/lib/util/ConfiguratorBase.java    |   1 -
 .../core/client/mock/MockBatchDeleter.java      |   4 -
 .../client/mock/MockInstanceOperations.java     |  43 ---
 .../apache/accumulo/core/data/ColumnUpdate.java |   1 -
 .../java/org/apache/accumulo/core/data/Key.java |   7 +-
 .../apache/accumulo/core/data/KeyExtent.java    |   6 +-
 .../org/apache/accumulo/core/data/Range.java    |  17 +-
 .../accumulo/core/file/rfile/BlockIndex.java    |   5 -
 .../accumulo/core/file/rfile/bcfile/BCFile.java |  14 +-
 .../core/file/rfile/bcfile/ByteArray.java       |   2 -
 .../accumulo/core/file/rfile/bcfile/Chunk.java  |   2 -
 .../accumulo/core/file/rfile/bcfile/TFile.java  |  44 ---
 .../core/file/rfile/bcfile/TFileDumper.java     |   1 -
 .../accumulo/core/file/rfile/bcfile/Utils.java  |  11 -
 .../core/iterators/TypedValueCombiner.java      |   6 -
 .../core/iterators/ValueFormatException.java    |   6 -
 .../core/iterators/system/MapFileIterator.java  |   8 +-
 .../core/iterators/user/GrepIterator.java       |   3 -
 .../iterators/user/IntersectingIterator.java    |  10 -
 .../accumulo/core/iterators/user/RowFilter.java |   1 -
 .../iterators/user/TransformingIterator.java    | 166 +++++-----
 .../core/iterators/user/VersioningIterator.java |   3 -
 .../accumulo/core/security/SecurityUtil.java    |   1 -
 .../core/security/crypto/CryptoModule.java      |   2 -
 .../security/crypto/CryptoModuleFactory.java    |   1 -
 .../core/client/impl/ScannerOptionsTest.java    |   2 -
 .../client/mapred/AccumuloInputFormatTest.java  |   4 -
 .../mapreduce/AccumuloInputFormatTest.java      |   6 -
 .../shell/command/FormatterCommandTest.java     |  15 +-
 .../simple/client/RandomBatchScanner.java       |   5 -
 .../simple/client/RandomBatchWriter.java        |   4 -
 .../simple/client/SequentialBatchWriter.java    |   5 -
 .../simple/client/TraceDumpExample.java         |   9 +-
 .../examples/simple/dirlist/QueryUtil.java      |   3 -
 .../examples/simple/mapreduce/NGramIngest.java  |   3 -
 .../examples/simple/mapreduce/TableToFile.java  |   1 -
 .../accumulo/examples/simple/shard/Query.java   |   3 -
 .../minicluster/MiniAccumuloCluster.java        |  10 -
 .../accumulo/proxy/TestProxyReadWrite.java      |  10 -
 .../accumulo/server/conf/ConfigSanityCheck.java |   3 -
 .../accumulo/server/logger/LogReader.java       |   1 -
 .../master/balancer/ChaoticLoadBalancer.java    |   8 -
 .../server/master/balancer/TabletBalancer.java  |   2 -
 .../server/master/state/TabletStateStore.java   |   8 +-
 .../server/master/tableOps/TraceRepo.java       |  25 --
 .../server/metanalysis/LogFileOutputFormat.java |   4 -
 .../server/metanalysis/PrintEvents.java         |   5 +-
 .../server/metrics/AbstractMetricsImpl.java     |   4 -
 .../security/handler/InsecurePermHandler.java   |  42 ---
 .../server/security/handler/ZKAuthorizor.java   |   7 +-
 .../server/security/handler/ZKPermHandler.java  |   6 +-
 .../accumulo/server/tabletserver/MemValue.java  |   4 +-
 .../server/tabletserver/TabletServer.java       |   8 +-
 .../server/util/AddFilesWithMissingEntries.java |   1 -
 .../accumulo/server/util/DumpZookeeper.java     |   3 -
 .../server/util/FindOfflineTablets.java         |   3 -
 .../accumulo/server/util/LoginProperties.java   |   3 -
 .../accumulo/server/util/MetadataTable.java     | 305 +++++++++----------
 .../accumulo/server/util/RestoreZookeeper.java  |   4 -
 .../accumulo/server/util/SendLogToChainsaw.java |   1 -
 .../accumulo/server/util/TServerUtils.java      |   7 +-
 .../accumulo/server/util/TableDiskUsage.java    |   3 -
 .../accumulo/server/util/TabletServerLocks.java |   3 -
 .../start/classloader/AccumuloClassLoader.java  |   3 -
 .../start/classloader/vfs/ContextManager.java   |   2 -
 .../vfs/PostDelegatingVFSClassLoader.java       |   7 +-
 .../vfs/providers/HdfsFileSystem.java           |   5 -
 .../apache/accumulo/test/GetMasterStats.java    |   9 -
 .../accumulo/test/NativeMapPerformanceTest.java |   3 -
 .../accumulo/test/NativeMapStressTest.java      |   3 -
 .../test/continuous/ContinuousMoru.java         |   1 -
 .../test/continuous/ContinuousVerify.java       |   1 -
 .../test/functional/CacheTestClean.java         |   3 -
 .../accumulo/test/functional/RunTests.java      |   4 -
 .../metadata/MetadataBatchScanTest.java         |   3 -
 .../test/performance/thrift/NullTserver.java    |   8 +-
 .../accumulo/test/randomwalk/Framework.java     |   3 -
 .../apache/accumulo/test/randomwalk/Node.java   |   1 -
 .../randomwalk/concurrent/CheckBalance.java     |   5 +-
 .../instrument/receivers/ZooSpanClient.java     |  10 -
 98 files changed, 284 insertions(+), 817 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/Constants.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/Constants.java
index 095319e,0000000..66c4034
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/Constants.java
+++ b/core/src/main/java/org/apache/accumulo/core/Constants.java
@@@ -1,213 -1,0 +1,212 @@@
 +/*
 + * 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;
 +
 +import java.nio.charset.Charset;
 +
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.Property;
 +import org.apache.accumulo.core.data.Key;
 +import org.apache.accumulo.core.data.KeyExtent;
 +import org.apache.accumulo.core.data.PartialKey;
 +import org.apache.accumulo.core.data.Range;
 +import org.apache.accumulo.core.security.Authorizations;
 +import org.apache.accumulo.core.util.ColumnFQ;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.hadoop.io.Text;
 +
 +public class Constants {
 +  public static final Charset UTF8 = Charset.forName("UTF-8");
 +  public static final String VERSION = FilteredConstants.VERSION;
 +  
 +  // versions should never be negative
 +  public static final Integer WIRE_VERSION = 2;
 +  public static final int DATA_VERSION = 5;
 +  public static final int PREV_DATA_VERSION = 4;
 +  
 +  // Zookeeper locations
 +  public static final String ZROOT = "/accumulo";
 +  public static final String ZINSTANCES = "/instances";
 +  
 +  public static final String ZTABLES = "/tables";
 +  public static final byte[] ZTABLES_INITIAL_ID = new byte[] {'0'};
 +  public static final String ZTABLE_NAME = "/name";
 +  public static final String ZTABLE_CONF = "/conf";
 +  public static final String ZTABLE_STATE = "/state";
 +  public static final String ZTABLE_FLUSH_ID = "/flush-id";
 +  public static final String ZTABLE_COMPACT_ID = "/compact-id";
 +  public static final String ZTABLE_COMPACT_CANCEL_ID = "/compact-cancel-id";
 +  
 +  public static final String ZROOT_TABLET = "/root_tablet";
 +  public static final String ZROOT_TABLET_LOCATION = ZROOT_TABLET + "/location";
 +  public static final String ZROOT_TABLET_FUTURE_LOCATION = ZROOT_TABLET + "/future_location";
 +  public static final String ZROOT_TABLET_LAST_LOCATION = ZROOT_TABLET + "/lastlocation";
 +  public static final String ZROOT_TABLET_WALOGS = ZROOT_TABLET + "/walogs";
 +  
 +  public static final String ZMASTERS = "/masters";
 +  public static final String ZMASTER_LOCK = ZMASTERS + "/lock";
 +  public static final String ZMASTER_GOAL_STATE = ZMASTERS + "/goal_state";
 +  public static final String ZGC = "/gc";
 +  public static final String ZGC_LOCK = ZGC + "/lock";
 +  
 +  public static final String ZMONITOR = "/monitor";
 +  public static final String ZMONITOR_LOCK = ZMONITOR + "/lock";
 +  public static final String ZMONITOR_HTTP_ADDR = ZMONITOR + "/http_addr";
 +  public static final String ZMONITOR_LOG4J_ADDR = ZMONITOR + "/log4j_addr";
 +  
 +  public static final String ZCONFIG = "/config";
 +  
 +  public static final String ZTSERVERS = "/tservers";
 +  
 +  public static final String ZDEAD = "/dead";
 +  public static final String ZDEADTSERVERS = "/dead/tservers";
 +  
 +  public static final String ZTRACERS = "/tracers";
 +  
 +  public static final String ZPROBLEMS = "/problems";
 +  public static final String ZUSERS = "/users";
 +  
 +  public static final String BULK_ARBITRATOR_TYPE = "bulkTx";
 +  
 +  public static final String ZFATE = "/fate";
 +  
 +  public static final String ZNEXT_FILE = "/next_file";
 +  
 +  public static final String ZBULK_FAILED_COPYQ = "/bulk_failed_copyq";
 +  
 +  public static final String ZHDFS_RESERVATIONS = "/hdfs_reservations";
 +  public static final String ZRECOVERY = "/recovery";
 +  
 +  public static final String METADATA_TABLE_ID = "!0";
 +  public static final String METADATA_TABLE_NAME = "!METADATA";
 +  public static final String DEFAULT_TABLET_LOCATION = "/default_tablet";
 +  public static final String TABLE_TABLET_LOCATION = "/table_info";
 +  public static final String ZTABLE_LOCKS = "/table_locks";
 +  
 +  // reserved keyspace is any row that begins with a tilde '~' character
 +  public static final Key METADATA_RESERVED_KEYSPACE_START_KEY = new Key(new Text(new byte[] {'~'}));
 +  public static final Key METADATA_RESERVED_KEYSPACE_STOP_KEY = new Key(new Text(new byte[] {'~' + 1}));
 +  public static final Range METADATA_RESERVED_KEYSPACE = new Range(METADATA_RESERVED_KEYSPACE_START_KEY, true, METADATA_RESERVED_KEYSPACE_STOP_KEY, false);
 +  public static final String METADATA_DELETE_FLAG_PREFIX = "~del";
 +  public static final String METADATA_DELETE_FLAG_FOR_METADATA_PREFIX = "!!" + METADATA_DELETE_FLAG_PREFIX;
 +  public static final Range METADATA_DELETES_KEYSPACE = new Range(new Key(new Text(METADATA_DELETE_FLAG_PREFIX)), true, new Key(new Text("~dem")), false);
 +  public static final Range METADATA_DELETES_FOR_METADATA_KEYSPACE = new Range(new Key(new Text(METADATA_DELETE_FLAG_FOR_METADATA_PREFIX)), true, new Key(new Text("!!~dem")), false);
 +  public static final String METADATA_BLIP_FLAG_PREFIX = "~blip"; // BLIP = bulk load in progress
 +  public static final Range METADATA_BLIP_KEYSPACE = new Range(new Key(new Text(METADATA_BLIP_FLAG_PREFIX)), true, new Key(new Text("~bliq")), false);
 +  
 +  public static final Text METADATA_SERVER_COLUMN_FAMILY = new Text("srv");
 +  public static final Text METADATA_TABLET_COLUMN_FAMILY = new Text("~tab"); // this needs to sort after all other column families for that tablet
 +  public static final Text METADATA_CURRENT_LOCATION_COLUMN_FAMILY = new Text("loc");
 +  public static final Text METADATA_FUTURE_LOCATION_COLUMN_FAMILY = new Text("future");
 +  public static final Text METADATA_LAST_LOCATION_COLUMN_FAMILY = new Text("last");
 +  public static final Text METADATA_BULKFILE_COLUMN_FAMILY = new Text("loaded"); // temporary marker that indicates a tablet loaded a bulk file
 +  public static final Text METADATA_CLONED_COLUMN_FAMILY = new Text("!cloned"); // temporary marker that indicates a tablet was successfully cloned
 +  
 +  // README : very important that prevRow sort last to avoid race conditions between
 +  // garbage collector and split
 +  public static final ColumnFQ METADATA_PREV_ROW_COLUMN = new ColumnFQ(METADATA_TABLET_COLUMN_FAMILY, new Text("~pr")); // this needs to sort after everything
 +                                                                                                                        // else for that tablet
 +  public static final ColumnFQ METADATA_OLD_PREV_ROW_COLUMN = new ColumnFQ(METADATA_TABLET_COLUMN_FAMILY, new Text("oldprevrow"));
 +  public static final ColumnFQ METADATA_DIRECTORY_COLUMN = new ColumnFQ(METADATA_SERVER_COLUMN_FAMILY, new Text("dir"));
 +  public static final ColumnFQ METADATA_TIME_COLUMN = new ColumnFQ(METADATA_SERVER_COLUMN_FAMILY, new Text("time"));
 +  public static final ColumnFQ METADATA_FLUSH_COLUMN = new ColumnFQ(METADATA_SERVER_COLUMN_FAMILY, new Text("flush"));
 +  public static final ColumnFQ METADATA_COMPACT_COLUMN = new ColumnFQ(METADATA_SERVER_COLUMN_FAMILY, new Text("compact"));
 +  public static final ColumnFQ METADATA_SPLIT_RATIO_COLUMN = new ColumnFQ(METADATA_TABLET_COLUMN_FAMILY, new Text("splitRatio"));
 +  public static final ColumnFQ METADATA_LOCK_COLUMN = new ColumnFQ(METADATA_SERVER_COLUMN_FAMILY, new Text("lock"));
 +  
 +  public static final Text METADATA_DATAFILE_COLUMN_FAMILY = new Text("file");
 +  public static final Text METADATA_SCANFILE_COLUMN_FAMILY = new Text("scan");
 +  public static final Text METADATA_LOG_COLUMN_FAMILY = new Text("log");
 +  public static final Text METADATA_CHOPPED_COLUMN_FAMILY = new Text("chopped");
 +  public static final ColumnFQ METADATA_CHOPPED_COLUMN = new ColumnFQ(METADATA_CHOPPED_COLUMN_FAMILY, new Text("chopped"));
 +  
 +  public static final Range NON_ROOT_METADATA_KEYSPACE = new Range(
 +      new Key(KeyExtent.getMetadataEntry(new Text(METADATA_TABLE_ID), null)).followingKey(PartialKey.ROW), true, METADATA_RESERVED_KEYSPACE_START_KEY, false);
 +  public static final Range METADATA_KEYSPACE = new Range(new Key(new Text(METADATA_TABLE_ID)), true, METADATA_RESERVED_KEYSPACE_START_KEY, false);
 +  
 +  public static final KeyExtent ROOT_TABLET_EXTENT = new KeyExtent(new Text(METADATA_TABLE_ID), KeyExtent.getMetadataEntry(new Text(METADATA_TABLE_ID), null),
 +      null);
 +  public static final Range METADATA_ROOT_TABLET_KEYSPACE = new Range(ROOT_TABLET_EXTENT.getMetadataEntry(), false, KeyExtent.getMetadataEntry(new Text(
 +      METADATA_TABLE_ID), null), true);
 +  
 +  public static final String VALUE_ENCODING = "UTF-8";
 +  
 +  public static final String BULK_PREFIX = "b-";
 +  public static final String OLD_BULK_PREFIX = "bulk_";
 +  
 +  // note: all times are in milliseconds
 +  
 +  public static final int SCAN_BATCH_SIZE = 1000; // this affects the table client caching of metadata
 +  
 +  public static final long MIN_MASTER_LOOP_TIME = 1000;
 +  public static final int MASTER_TABLETSERVER_CONNECTION_TIMEOUT = 3000;
 +  public static final long CLIENT_SLEEP_BEFORE_RECONNECT = 1000;
 +  
 +  // Security configuration
 +  public static final String PW_HASH_ALGORITHM = "SHA-256";
 +  
 +  // Representation of an empty set of authorizations
 +  // (used throughout the code, because scans of metadata table and many tests do not set record-level visibility)
 +  public static final Authorizations NO_AUTHS = new Authorizations();
 +  
 +  public static final int DEFAULT_MINOR_COMPACTION_MAX_SLEEP_TIME = 60 * 3; // in seconds
 +  
 +  public static final int MAX_DATA_TO_PRINT = 64;
 +  public static final int CLIENT_RETRIES = 5;
 +  public static final int TSERV_MINC_MAXCONCURRENT_NUMWAITING_MULTIPLIER = 2;
 +  public static final String CORE_PACKAGE_NAME = "org.apache.accumulo.core";
 +  public static final String OLD_PACKAGE_NAME = "cloudbase";
 +  public static final String VALID_TABLE_NAME_REGEX = "^\\w+$";
 +  public static final String MAPFILE_EXTENSION = "map";
 +  public static final String GENERATED_TABLET_DIRECTORY_PREFIX = "t-";
 +  
 +  public static final String EXPORT_METADATA_FILE = "metadata.bin";
 +  public static final String EXPORT_TABLE_CONFIG_FILE = "table_config.txt";
 +  public static final String EXPORT_FILE = "exportMetadata.zip";
 +  public static final String EXPORT_INFO_FILE = "accumulo_export_info.txt";
 +  
 +  public static String getBaseDir(final AccumuloConfiguration conf) {
 +    return conf.get(Property.INSTANCE_DFS_DIR);
 +  }
 +  
 +  public static String getTablesDir(final AccumuloConfiguration conf) {
 +    return getBaseDir(conf) + "/tables";
 +  }
 +  
 +  public static String getRecoveryDir(final AccumuloConfiguration conf) {
 +    return getBaseDir(conf) + "/recovery";
 +  }
 +  
 +  public static Path getDataVersionLocation(final AccumuloConfiguration conf) {
 +    return new Path(getBaseDir(conf) + "/version");
 +  }
 +  
 +  public static String getMetadataTableDir(final AccumuloConfiguration conf) {
 +    return getTablesDir(conf) + "/" + METADATA_TABLE_ID;
 +  }
 +  
 +  public static String getRootTabletDir(final AccumuloConfiguration conf) {
 +    return getMetadataTableDir(conf) + ZROOT_TABLET;
 +  }
 +  
 +  /**
-    * @param conf
 +   * @return The write-ahead log directory.
 +   */
 +  public static String getWalDirectory(final AccumuloConfiguration conf) {
 +    return getBaseDir(conf) + "/wal";
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
index 3085f56,0000000..fbf8670
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
@@@ -1,257 -1,0 +1,255 @@@
 +/*
 + * 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;
 +
 +import java.io.IOException;
 +import java.util.Collection;
 +import java.util.Iterator;
 +import java.util.Map;
 +import java.util.Map.Entry;
 +import java.util.Set;
 +import java.util.TreeMap;
 +import java.util.TreeSet;
 +import java.util.concurrent.TimeUnit;
 +
 +import org.apache.accumulo.core.client.impl.ScannerOptions;
 +import org.apache.accumulo.core.client.mock.IteratorAdapter;
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.data.ArrayByteSequence;
 +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;
 +import org.apache.accumulo.core.data.Value;
 +import org.apache.accumulo.core.data.thrift.IterInfo;
 +import org.apache.accumulo.core.iterators.IteratorEnvironment;
 +import org.apache.accumulo.core.iterators.IteratorUtil;
 +import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 +import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 +import org.apache.hadoop.io.Text;
 +
 +/**
 + * A scanner that instantiates iterators on the client side instead of on the tablet server. This can be useful for testing iterators or in cases where you
 + * don't want iterators affecting the performance of tablet servers.<br>
 + * <br>
 + * Suggested usage:<br>
 + * <code>Scanner scanner = new ClientSideIteratorScanner(connector.createScanner(tableName, authorizations));</code><br>
 + * <br>
 + * Iterators added to this scanner will be run in the client JVM. Separate scan iterators can be run on the server side and client side by adding iterators to
 + * the source scanner (which will execute server side) and to the client side scanner (which will execute client side).
 + */
 +public class ClientSideIteratorScanner extends ScannerOptions implements Scanner {
 +  private int size;
 +  
 +  private Range range;
 +  private boolean isolated = false;
 +  
 +  /**
 +   * A class that wraps a Scanner in a SortedKeyValueIterator so that other accumulo iterators can use it as a source.
 +   */
 +  public class ScannerTranslator implements SortedKeyValueIterator<Key,Value> {
 +    protected Scanner scanner;
 +    Iterator<Entry<Key,Value>> iter;
 +    Entry<Key,Value> top = null;
 +    
 +    /**
 +     * Constructs an accumulo iterator from a scanner.
 +     * 
 +     * @param scanner
 +     *          the scanner to iterate over
 +     */
 +    public ScannerTranslator(final Scanner scanner) {
 +      this.scanner = scanner;
 +    }
 +    
 +    @Override
 +    public void init(final SortedKeyValueIterator<Key,Value> source, final Map<String,String> options, final IteratorEnvironment env) throws IOException {
 +      throw new UnsupportedOperationException();
 +    }
 +    
 +    @Override
 +    public boolean hasTop() {
 +      return top != null;
 +    }
 +    
 +    @Override
 +    public void next() throws IOException {
 +      if (iter.hasNext())
 +        top = iter.next();
 +      else
 +        top = null;
 +    }
 +    
 +    @Override
 +    public void seek(final Range range, final Collection<ByteSequence> columnFamilies, final boolean inclusive) throws IOException {
 +      if (!inclusive && columnFamilies.size() > 0) {
 +        throw new IllegalArgumentException();
 +      }
 +      scanner.setRange(range);
 +      scanner.clearColumns();
 +      for (ByteSequence colf : columnFamilies) {
 +        scanner.fetchColumnFamily(new Text(colf.toArray()));
 +      }
 +      iter = scanner.iterator();
 +      next();
 +    }
 +    
 +    @Override
 +    public Key getTopKey() {
 +      return top.getKey();
 +    }
 +    
 +    @Override
 +    public Value getTopValue() {
 +      return top.getValue();
 +    }
 +    
 +    @Override
 +    public SortedKeyValueIterator<Key,Value> deepCopy(final IteratorEnvironment env) {
 +      return new ScannerTranslator(scanner);
 +    }
 +  }
 +  
 +  private ScannerTranslator smi;
 +  
 +  /**
 +   * Constructs a scanner that can execute client-side iterators.
 +   * 
 +   * @param scanner
 +   *          the source scanner
 +   */
 +  public ClientSideIteratorScanner(final Scanner scanner) {
 +    smi = new ScannerTranslator(scanner);
 +    this.range = scanner.getRange();
 +    this.size = scanner.getBatchSize();
 +    this.timeOut = scanner.getTimeout(TimeUnit.MILLISECONDS);
 +  }
 +  
 +  /**
 +   * Sets the source Scanner.
-    * 
-    * @param scanner
 +   */
 +  public void setSource(final Scanner scanner) {
 +    smi = new ScannerTranslator(scanner);
 +  }
 +  
 +  @Override
 +  public Iterator<Entry<Key,Value>> iterator() {
 +    smi.scanner.setBatchSize(size);
 +    smi.scanner.setTimeout(timeOut, TimeUnit.MILLISECONDS);
 +    if (isolated)
 +      smi.scanner.enableIsolation();
 +    else
 +      smi.scanner.disableIsolation();
 +    
 +    final TreeMap<Integer,IterInfo> tm = new TreeMap<Integer,IterInfo>();
 +    
 +    for (IterInfo iterInfo : serverSideIteratorList) {
 +      tm.put(iterInfo.getPriority(), iterInfo);
 +    }
 +    
 +    SortedKeyValueIterator<Key,Value> skvi;
 +    try {
 +      skvi = IteratorUtil.loadIterators(smi, tm.values(), serverSideIteratorOptions, new IteratorEnvironment() {
 +        @Override
 +        public SortedKeyValueIterator<Key,Value> reserveMapFileReader(final String mapFileName) throws IOException {
 +          return null;
 +        }
 +        
 +        @Override
 +        public AccumuloConfiguration getConfig() {
 +          return null;
 +        }
 +        
 +        @Override
 +        public IteratorScope getIteratorScope() {
 +          return null;
 +        }
 +        
 +        @Override
 +        public boolean isFullMajorCompaction() {
 +          return false;
 +        }
 +        
 +        @Override
 +        public void registerSideChannel(final SortedKeyValueIterator<Key,Value> iter) {}
 +      }, false, null);
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +    
 +    final Set<ByteSequence> colfs = new TreeSet<ByteSequence>();
 +    for (Column c : this.getFetchedColumns()) {
 +      colfs.add(new ArrayByteSequence(c.getColumnFamily()));
 +    }
 +    
 +    try {
 +      skvi.seek(range, colfs, true);
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +    
 +    return new IteratorAdapter(skvi);
 +  }
 +  
 +  @Deprecated
 +  @Override
 +  public void setTimeOut(int timeOut) {
 +    if (timeOut == Integer.MAX_VALUE)
 +      setTimeout(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
 +    else
 +      setTimeout(timeOut, TimeUnit.SECONDS);
 +  }
 +  
 +  @Deprecated
 +  @Override
 +  public int getTimeOut() {
 +    long timeout = getTimeout(TimeUnit.SECONDS);
 +    if (timeout >= Integer.MAX_VALUE)
 +      return Integer.MAX_VALUE;
 +    return (int) timeout;
 +  }
 +  
 +  @Override
 +  public void setRange(final Range range) {
 +    this.range = range;
 +  }
 +  
 +  @Override
 +  public Range getRange() {
 +    return range;
 +  }
 +  
 +  @Override
 +  public void setBatchSize(final int size) {
 +    this.size = size;
 +  }
 +  
 +  @Override
 +  public int getBatchSize() {
 +    return size;
 +  }
 +  
 +  @Override
 +  public void enableIsolation() {
 +    this.isolated = true;
 +  }
 +  
 +  @Override
 +  public void disableIsolation() {
 +    this.isolated = false;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/Connector.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/Connector.java
index d2e7321,0000000..3189d44
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Connector.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Connector.java
@@@ -1,210 -1,0 +1,208 @@@
 +/*
 + * 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;
 +
 +import org.apache.accumulo.core.client.admin.InstanceOperations;
 +import org.apache.accumulo.core.client.admin.SecurityOperations;
 +import org.apache.accumulo.core.client.admin.TableOperations;
 +import org.apache.accumulo.core.security.Authorizations;
 +
 +/**
 + * Connector connects to an Accumulo instance and allows the user to request readers and writers for the instance as well as various objects that permit
 + * administrative operations.
 + * 
 + * The Connector enforces security on the client side by forcing all API calls to be accompanied by user credentials.
 + */
 +public abstract class Connector {
 +  
 +  /**
 +   * Factory method to create a BatchScanner connected to Accumulo.
 +   * 
 +   * @param tableName
 +   *          the name of the table to query
 +   * @param authorizations
 +   *          A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in
 +   *          must be a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are
 +   *          passed, then an exception will be thrown.
 +   * @param numQueryThreads
 +   *          the number of concurrent threads to spawn for querying
 +   * 
 +   * @return BatchScanner object for configuring and querying
 +   * @throws TableNotFoundException
 +   *           when the specified table doesn't exist
 +   */
 +  public abstract BatchScanner createBatchScanner(String tableName, Authorizations authorizations, int numQueryThreads) throws TableNotFoundException;
 +  
 +  /**
 +   * Factory method to create a BatchDeleter connected to Accumulo.
 +   * 
 +   * @param tableName
 +   *          the name of the table to query and delete from
 +   * @param authorizations
 +   *          A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in
 +   *          must be a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are
 +   *          passed, then an exception will be thrown.
 +   * @param numQueryThreads
 +   *          the number of concurrent threads to spawn for querying
 +   * @param maxMemory
 +   *          size in bytes of the maximum memory to batch before writing
 +   * @param maxLatency
 +   *          size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
 +   * @param maxWriteThreads
 +   *          the maximum number of threads to use for writing data to the tablet servers
 +   * 
 +   * @return BatchDeleter object for configuring and deleting
 +   * @throws TableNotFoundException
 +   *           when the specified table doesn't exist
 +   * @deprecated since 1.5.0; Use {@link #createBatchDeleter(String, Authorizations, int, BatchWriterConfig)} instead.
 +   */
 +  @Deprecated
 +  public abstract BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, long maxMemory, long maxLatency,
 +      int maxWriteThreads) throws TableNotFoundException;
 +  
 +  /**
 +   * 
 +   * @param tableName
 +   *          the name of the table to query and delete from
 +   * @param authorizations
 +   *          A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in
 +   *          must be a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are
 +   *          passed, then an exception will be thrown.
 +   * @param numQueryThreads
 +   *          the number of concurrent threads to spawn for querying
 +   * @param config
 +   *          configuration used to create batch writer
 +   * @return BatchDeleter object for configuring and deleting
-    * @throws TableNotFoundException
 +   * @since 1.5.0
 +   */
 +  
 +  public abstract BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, BatchWriterConfig config)
 +      throws TableNotFoundException;
 +  
 +  /**
 +   * Factory method to create a BatchWriter connected to Accumulo.
 +   * 
 +   * @param tableName
 +   *          the name of the table to insert data into
 +   * @param maxMemory
 +   *          size in bytes of the maximum memory to batch before writing
 +   * @param maxLatency
 +   *          time in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
 +   * @param maxWriteThreads
 +   *          the maximum number of threads to use for writing data to the tablet servers
 +   * 
 +   * @return BatchWriter object for configuring and writing data to
 +   * @throws TableNotFoundException
 +   *           when the specified table doesn't exist
 +   * @deprecated since 1.5.0; Use {@link #createBatchWriter(String, BatchWriterConfig)} instead.
 +   */
 +  @Deprecated
 +  public abstract BatchWriter createBatchWriter(String tableName, long maxMemory, long maxLatency, int maxWriteThreads) throws TableNotFoundException;
 +  
 +  /**
 +   * Factory method to create a BatchWriter connected to Accumulo.
 +   * 
 +   * @param tableName
 +   *          the name of the table to insert data into
 +   * @param config
 +   *          configuration used to create batch writer
 +   * @return BatchWriter object for configuring and writing data to
-    * @throws TableNotFoundException
 +   * @since 1.5.0
 +   */
 +  
 +  public abstract BatchWriter createBatchWriter(String tableName, BatchWriterConfig config) throws TableNotFoundException;
 +  
 +  /**
 +   * Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables, which is good for
 +   * ingesting data into multiple tables from the same source
 +   * 
 +   * @param maxMemory
 +   *          size in bytes of the maximum memory to batch before writing
 +   * @param maxLatency
 +   *          size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
 +   * @param maxWriteThreads
 +   *          the maximum number of threads to use for writing data to the tablet servers
 +   * 
 +   * @return MultiTableBatchWriter object for configuring and writing data to
 +   * @deprecated since 1.5.0; Use {@link #createMultiTableBatchWriter(BatchWriterConfig)} instead.
 +   */
 +  @Deprecated
 +  public abstract MultiTableBatchWriter createMultiTableBatchWriter(long maxMemory, long maxLatency, int maxWriteThreads);
 +  
 +  /**
 +   * Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables. Also data for
 +   * multiple tables can be sent to a server in a single batch. Its an efficient way to ingest data into multiple tables from a single process.
 +   * 
 +   * @param config
 +   *          configuration used to create multi-table batch writer
 +   * @return MultiTableBatchWriter object for configuring and writing data to
 +   * @since 1.5.0
 +   */
 +  
 +  public abstract MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config);
 +  
 +  /**
 +   * Factory method to create a Scanner connected to Accumulo.
 +   * 
 +   * @param tableName
 +   *          the name of the table to query data from
 +   * @param authorizations
 +   *          A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in
 +   *          must be a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are
 +   *          passed, then an exception will be thrown.
 +   * 
 +   * @return Scanner object for configuring and querying data with
 +   * @throws TableNotFoundException
 +   *           when the specified table doesn't exist
 +   */
 +  public abstract Scanner createScanner(String tableName, Authorizations authorizations) throws TableNotFoundException;
 +  
 +  /**
 +   * Accessor method for internal instance object.
 +   * 
 +   * @return the internal instance object
 +   */
 +  public abstract Instance getInstance();
 +  
 +  /**
 +   * Get the current user for this connector
 +   * 
 +   * @return the user name
 +   */
 +  public abstract String whoami();
 +  
 +  /**
 +   * Retrieves a TableOperations object to perform table functions, such as create and delete.
 +   * 
 +   * @return an object to manipulate tables
 +   */
 +  public abstract TableOperations tableOperations();
 +  
 +  /**
 +   * Retrieves a SecurityOperations object to perform user security operations, such as creating users.
 +   * 
 +   * @return an object to modify users and permissions
 +   */
 +  public abstract SecurityOperations securityOperations();
 +  
 +  /**
 +   * Retrieves an InstanceOperations object to modify instance configuration.
 +   * 
 +   * @return an object to modify instance configuration
 +   */
 +  public abstract InstanceOperations instanceOperations();
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
index 85e996a,0000000..e58a1be
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
@@@ -1,387 -1,0 +1,383 @@@
 +/*
 + * 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;
 +
 +import java.io.DataInput;
 +import java.io.DataOutput;
 +import java.io.IOException;
 +import java.util.Collections;
 +import java.util.HashMap;
 +import java.util.Map;
 +import java.util.Map.Entry;
 +import java.util.Set;
 +
 +import org.apache.accumulo.core.data.Key;
 +import org.apache.accumulo.core.data.Value;
 +import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 +import org.apache.accumulo.core.util.ArgumentChecker;
 +import org.apache.accumulo.core.util.Pair;
 +import org.apache.hadoop.io.Text;
 +import org.apache.hadoop.io.Writable;
 +import org.apache.hadoop.io.WritableUtils;
 +
 +/**
 + * Configure an iterator for minc, majc, and/or scan. By default, IteratorSetting will be configured for scan.
 + * 
 + * Every iterator has a priority, a name, a class, a set of scopes, and configuration parameters.
 + * 
 + * A typical use case configured for scan:
 + * 
 + * <pre>
 + * IteratorSetting cfg = new IteratorSetting(priority, &quot;myIter&quot;, MyIterator.class);
 + * MyIterator.addOption(cfg, 42);
 + * scanner.addScanIterator(cfg);
 + * </pre>
 + */
 +public class IteratorSetting implements Writable {
 +  private int priority;
 +  private String name;
 +  private String iteratorClass;
 +  private Map<String,String> properties;
 +
 +  /**
 +   * Get layer at which this iterator applies. See {@link #setPriority(int)} for how the priority is used.
 +   * 
 +   * @return the priority of this Iterator
 +   */
 +  public int getPriority() {
 +    return priority;
 +  }
 +
 +  /**
 +   * Set layer at which this iterator applies.
 +   * 
 +   * @param priority
 +   *          determines the order in which iterators are applied (system iterators are always applied first, then user-configured iterators, lowest priority
 +   *          first)
 +   */
 +  public void setPriority(int priority) {
 +    ArgumentChecker.strictlyPositive(priority);
 +    this.priority = priority;
 +  }
 +
 +  /**
 +   * Get the iterator's name.
 +   * 
 +   * @return the name of the iterator
 +   */
 +  public String getName() {
 +    return name;
 +  }
 +
 +  /**
 +   * Set the iterator's name. Must be a simple alphanumeric identifier.
-    * 
-    * @param name
 +   */
 +  public void setName(String name) {
 +    ArgumentChecker.notNull(name);
 +    this.name = name;
 +  }
 +
 +  /**
 +   * Get the name of the class that implements the iterator.
 +   * 
 +   * @return the iterator's class name
 +   */
 +  public String getIteratorClass() {
 +    return iteratorClass;
 +  }
 +
 +  /**
 +   * Set the name of the class that implements the iterator. The class does not have to be present on the client, but it must be available to all tablet
 +   * servers.
-    * 
-    * @param iteratorClass
 +   */
 +  public void setIteratorClass(String iteratorClass) {
 +    ArgumentChecker.notNull(iteratorClass);
 +    this.iteratorClass = iteratorClass;
 +  }
 +
 +  /**
 +   * Constructs an iterator setting configured for the scan scope with no parameters. (Parameters can be added later.)
 +   * 
 +   * @param priority
 +   *          the priority for the iterator (see {@link #setPriority(int)})
 +   * @param name
 +   *          the distinguishing name for the iterator
 +   * @param iteratorClass
 +   *          the fully qualified class name for the iterator
 +   */
 +  public IteratorSetting(int priority, String name, String iteratorClass) {
 +    this(priority, name, iteratorClass, new HashMap<String,String>());
 +  }
 +
 +  /**
 +   * Constructs an iterator setting configured for the specified scopes with the specified parameters.
 +   * 
 +   * @param priority
 +   *          the priority for the iterator (see {@link #setPriority(int)})
 +   * @param name
 +   *          the distinguishing name for the iterator
 +   * @param iteratorClass
 +   *          the fully qualified class name for the iterator
 +   * @param properties
 +   *          any properties for the iterator
 +   */
 +  public IteratorSetting(int priority, String name, String iteratorClass, Map<String,String> properties) {
 +    setPriority(priority);
 +    setName(name);
 +    setIteratorClass(iteratorClass);
 +    this.properties = new HashMap<String,String>();
 +    addOptions(properties);
 +  }
 +
 +  /**
 +   * Constructs an iterator setting using the given class's SimpleName for the iterator name. The iterator setting will be configured for the scan scope with no
 +   * parameters.
 +   * 
 +   * @param priority
 +   *          the priority for the iterator (see {@link #setPriority(int)})
 +   * @param iteratorClass
 +   *          the class for the iterator
 +   */
 +  public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
 +    this(priority, iteratorClass.getSimpleName(), iteratorClass.getName());
 +  }
 +
 +  /**
 +   * 
 +   * Constructs an iterator setting using the given class's SimpleName for the iterator name and configured for the specified scopes with the specified
 +   * parameters.
 +   * 
 +   * @param priority
 +   *          the priority for the iterator (see {@link #setPriority(int)})
 +   * @param iteratorClass
 +   *          the class for the iterator
 +   * @param properties
 +   *          any properties for the iterator
 +   */
 +  public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, Map<String,String> properties) {
 +    this(priority, iteratorClass.getSimpleName(), iteratorClass.getName(), properties);
 +  }
 +
 +  /**
 +   * Constructs an iterator setting configured for the scan scope with no parameters.
 +   * 
 +   * @param priority
 +   *          the priority for the iterator (see {@link #setPriority(int)})
 +   * @param name
 +   *          the distinguishing name for the iterator
 +   * @param iteratorClass
 +   *          the class for the iterator
 +   */
 +  public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
 +    this(priority, name, iteratorClass.getName());
 +  }
 +
 +  /**
 +   * @since 1.5.0
 +   */
 +  public IteratorSetting(DataInput din) throws IOException {
 +    this.properties = new HashMap<String,String>();
 +    this.readFields(din);
 +  }
 +
 +  /**
 +   * Add another option to the iterator.
 +   * 
 +   * @param option
 +   *          the name of the option
 +   * @param value
 +   *          the value of the option
 +   */
 +  public void addOption(String option, String value) {
 +    ArgumentChecker.notNull(option, value);
 +    properties.put(option, value);
 +  }
 +
 +  /**
 +   * Remove an option from the iterator.
 +   * 
 +   * @param option
 +   *          the name of the option
 +   * @return the value previously associated with the option, or null if no such option existed
 +   */
 +  public String removeOption(String option) {
 +    ArgumentChecker.notNull(option);
 +    return properties.remove(option);
 +  }
 +
 +  /**
 +   * Add many options to the iterator.
 +   * 
 +   * @param propertyEntries
 +   *          a set of entries to add to the options
 +   */
 +  public void addOptions(Set<Entry<String,String>> propertyEntries) {
 +    ArgumentChecker.notNull(propertyEntries);
 +    for (Entry<String,String> keyValue : propertyEntries) {
 +      addOption(keyValue.getKey(), keyValue.getValue());
 +    }
 +  }
 +
 +  /**
 +   * Add many options to the iterator.
 +   * 
 +   * @param properties
 +   *          a map of entries to add to the options
 +   */
 +  public void addOptions(Map<String,String> properties) {
 +    ArgumentChecker.notNull(properties);
 +    addOptions(properties.entrySet());
 +  }
 +
 +  /**
 +   * Get the configuration parameters for this iterator.
 +   * 
 +   * @return the properties
 +   */
 +  public Map<String,String> getOptions() {
 +    return Collections.unmodifiableMap(properties);
 +  }
 +
 +  /**
 +   * Remove all options from the iterator.
 +   */
 +  public void clearOptions() {
 +    properties.clear();
 +  }
 +
 +  /**
 +   * @see java.lang.Object#hashCode()
 +   */
 +  @Override
 +  public int hashCode() {
 +    final int prime = 31;
 +    int result = 1;
 +    result = prime * result + ((iteratorClass == null) ? 0 : iteratorClass.hashCode());
 +    result = prime * result + ((name == null) ? 0 : name.hashCode());
 +    result = prime * result + priority;
 +    result = prime * result + ((properties == null) ? 0 : properties.hashCode());
 +    return result;
 +  }
 +
 +  @Override
 +  public boolean equals(Object obj) {
 +    if (this == obj)
 +      return true;
 +    if (obj == null)
 +      return false;
 +    if (!(obj instanceof IteratorSetting))
 +      return false;
 +    IteratorSetting other = (IteratorSetting) obj;
 +    if (iteratorClass == null) {
 +      if (other.iteratorClass != null)
 +        return false;
 +    } else if (!iteratorClass.equals(other.iteratorClass))
 +      return false;
 +    if (name == null) {
 +      if (other.name != null)
 +        return false;
 +    } else if (!name.equals(other.name))
 +      return false;
 +    if (priority != other.priority)
 +      return false;
 +    if (properties == null) {
 +      if (other.properties != null)
 +        return false;
 +    } else if (!properties.equals(other.properties))
 +      return false;
 +    return true;
 +  }
 +
 +  /**
 +   * @see java.lang.Object#toString()
 +   */
 +  @Override
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    sb.append("name:");
 +    sb.append(name);
 +    sb.append(", priority:");
 +    sb.append(Integer.toString(priority));
 +    sb.append(", class:");
 +    sb.append(iteratorClass);
 +    sb.append(", properties:");
 +    sb.append(properties);
 +    return sb.toString();
 +  }
 +
 +  /**
 +   * A convenience class for passing column family and column qualifiers to iterator configuration methods.
 +   */
 +  public static class Column extends Pair<Text,Text> {
 +
 +    public Column(Text columnFamily, Text columnQualifier) {
 +      super(columnFamily, columnQualifier);
 +    }
 +
 +    public Column(Text columnFamily) {
 +      super(columnFamily, null);
 +    }
 +
 +    public Column(String columnFamily, String columnQualifier) {
 +      super(new Text(columnFamily), new Text(columnQualifier));
 +    }
 +
 +    public Column(String columnFamily) {
 +      super(new Text(columnFamily), null);
 +    }
 +
 +    public Text getColumnFamily() {
 +      return getFirst();
 +    }
 +
 +    public Text getColumnQualifier() {
 +      return getSecond();
 +    }
 +
 +  }
 +
 +  /**
 +   * @since 1.5.0
 +   */
 +  @Override
 +  public void readFields(DataInput din) throws IOException {
 +    priority = WritableUtils.readVInt(din);
 +    name = WritableUtils.readString(din);
 +    iteratorClass = WritableUtils.readString(din);
 +    properties.clear();
 +    int size = WritableUtils.readVInt(din);
 +    while (size > 0) {
 +      properties.put(WritableUtils.readString(din), WritableUtils.readString(din));
 +      size--;
 +    }
 +  }
 +
 +  /**
 +   * @since 1.5.0
 +   */
 +  @Override
 +  public void write(DataOutput dout) throws IOException {
 +    WritableUtils.writeVInt(dout, priority);
 +    WritableUtils.writeString(dout, name);
 +    WritableUtils.writeString(dout, iteratorClass);
 +    WritableUtils.writeVInt(dout, properties.size());
 +    for (Entry<String,String> e : properties.entrySet()) {
 +      WritableUtils.writeString(dout, e.getKey());
 +      WritableUtils.writeString(dout, e.getValue());
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/RowIterator.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/RowIterator.java
index 005f697,0000000..f5e9547
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/RowIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/RowIterator.java
@@@ -1,164 -1,0 +1,160 @@@
 +/*
 + * 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;
 +
 +import java.util.Iterator;
 +import java.util.Map.Entry;
 +import java.util.NoSuchElementException;
 +
 +import org.apache.accumulo.core.data.Key;
 +import org.apache.accumulo.core.data.Value;
 +import org.apache.accumulo.core.util.PeekingIterator;
 +import org.apache.hadoop.io.Text;
 +
 +/**
 + * Group Key/Value pairs into Iterators over rows. Suggested usage:
 + * 
 + * <pre>
 + * RowIterator rowIterator = new RowIterator(connector.createScanner(tableName, authorizations));
 + * </pre>
 + */
 +public class RowIterator implements Iterator<Iterator<Entry<Key,Value>>> {
 +  
 +  /**
 +   * Iterate over entries in a single row.
 +   */
 +  private static class SingleRowIter implements Iterator<Entry<Key,Value>> {
 +    private PeekingIterator<Entry<Key,Value>> source;
 +    private Text currentRow = null;
 +    private long count = 0;
 +    private boolean disabled = false;
 +    
 +    /**
 +     * SingleRowIter must be passed a PeekingIterator so that it can peek at the next entry to see if it belongs in the current row or not.
 +     */
 +    public SingleRowIter(PeekingIterator<Entry<Key,Value>> source) {
 +      this.source = source;
 +      if (source.hasNext())
 +        currentRow = source.peek().getKey().getRow();
 +    }
 +    
 +    @Override
 +    public boolean hasNext() {
 +      if (disabled)
 +        throw new IllegalStateException("SingleRowIter no longer valid");
 +      return currentRow != null;
 +    }
 +    
 +    @Override
 +    public Entry<Key,Value> next() {
 +      if (disabled)
 +        throw new IllegalStateException("SingleRowIter no longer valid");
 +      return _next();
 +    }
 +    
 +    private Entry<Key,Value> _next() {
 +      if (currentRow == null)
 +        throw new NoSuchElementException();
 +      count++;
 +      Entry<Key,Value> kv = source.next();
 +      if (!source.hasNext() || !source.peek().getKey().getRow().equals(currentRow)) {
 +        currentRow = null;
 +      }
 +      return kv;
 +    }
 +    
 +    @Override
 +    public void remove() {
 +      throw new UnsupportedOperationException();
 +    }
 +    
 +    /**
 +     * Get a count of entries read from the row (only equals the number of entries in the row when the row has been read fully).
 +     */
 +    public long getCount() {
 +      return count;
 +    }
 +    
 +    /**
 +     * Consume the rest of the row. Disables the iterator from future use.
 +     */
 +    public void consume() {
 +      disabled = true;
 +      while (currentRow != null)
 +        _next();
 +    }
 +  }
 +  
 +  private final PeekingIterator<Entry<Key,Value>> iter;
 +  private long count = 0;
 +  private SingleRowIter lastIter = null;
 +  
 +  /**
 +   * Create an iterator from an (ordered) sequence of KeyValue pairs.
-    * 
-    * @param iterator
 +   */
 +  public RowIterator(Iterator<Entry<Key,Value>> iterator) {
 +    this.iter = new PeekingIterator<Entry<Key,Value>>(iterator);
 +  }
 +  
 +  /**
 +   * Create an iterator from an Iterable.
-    * 
-    * @param iterable
 +   */
 +  public RowIterator(Iterable<Entry<Key,Value>> iterable) {
 +    this(iterable.iterator());
 +  }
 +  
 +  /**
 +   * Returns true if there is at least one more row to get.
 +   * 
 +   * If the last row hasn't been fully read, this method will read through the end of the last row so it can determine if the underlying iterator has a next
 +   * row. The last row is disabled from future use.
 +   */
 +  @Override
 +  public boolean hasNext() {
 +    if (lastIter != null) {
 +      lastIter.consume();
 +      count += lastIter.getCount();
 +      lastIter = null;
 +    }
 +    return iter.hasNext();
 +  }
 +  
 +  /**
 +   * Fetch the next row.
 +   */
 +  @Override
 +  public Iterator<Entry<Key,Value>> next() {
 +    if (!hasNext())
 +      throw new NoSuchElementException();
 +    return lastIter = new SingleRowIter(iter);
 +  }
 +  
 +  /**
 +   * Unsupported.
 +   */
 +  @Override
 +  public void remove() {
 +    throw new UnsupportedOperationException();
 +  }
 +  
 +  /**
 +   * Get a count of the total number of entries in all rows read so far.
 +   */
 +  public long getKVCount() {
 +    return count;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
index 873a3ad,0000000..7c61d57
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
@@@ -1,130 -1,0 +1,130 @@@
 +/*
 + * 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;
 +
 +import java.util.Iterator;
 +import java.util.Map.Entry;
 +import java.util.concurrent.TimeUnit;
 +
 +import org.apache.accumulo.core.data.Key;
 +import org.apache.accumulo.core.data.Value;
 +import org.apache.hadoop.io.Text;
 +
 +/**
 + * This class hosts configuration methods that are shared between different types of scanners.
 + * 
 + */
 +public interface ScannerBase extends Iterable<Entry<Key,Value>> {
 +  
 +  /**
 +   * Add a server-side scan iterator.
 +   * 
 +   * @param cfg
 +   *          fully specified scan-time iterator, including all options for the iterator. Any changes to the iterator setting after this call are not propagated
 +   *          to the stored iterator.
 +   * @throws IllegalArgumentException
 +   *           if the setting conflicts with existing iterators
 +   */
 +  public void addScanIterator(IteratorSetting cfg);
 +  
 +  /**
 +   * Remove an iterator from the list of iterators.
 +   * 
 +   * @param iteratorName
 +   *          nickname used for the iterator
 +   */
 +  public void removeScanIterator(String iteratorName);
 +  
 +  /**
 +   * Update the options for an iterator. Note that this does <b>not</b> change the iterator options during a scan, it just replaces the given option on a
 +   * configured iterator before a scan is started.
 +   * 
 +   * @param iteratorName
 +   *          the name of the iterator to change
 +   * @param key
 +   *          the name of the option
 +   * @param value
 +   *          the new value for the named option
 +   */
 +  public void updateScanIteratorOption(String iteratorName, String key, String value);
 +  
 +  /**
 +   * Adds a column family to the list of columns that will be fetched by this scanner. By default when no columns have been added the scanner fetches all
 +   * columns.
 +   * 
 +   * @param col
 +   *          the column family to be fetched
 +   */
 +  public void fetchColumnFamily(Text col);
 +  
 +  /**
 +   * Adds a column to the list of columns that will be fetched by this scanner. The column is identified by family and qualifier. By default when no columns
 +   * have been added the scanner fetches all columns.
 +   * 
 +   * @param colFam
 +   *          the column family of the column to be fetched
 +   * @param colQual
 +   *          the column qualifier of the column to be fetched
 +   */
 +  public void fetchColumn(Text colFam, Text colQual);
 +  
 +  /**
 +   * Clears the columns to be fetched (useful for resetting the scanner for reuse). Once cleared, the scanner will fetch all columns.
 +   */
 +  public void clearColumns();
 +  
 +  /**
 +   * Clears scan iterators prior to returning a scanner to the pool.
 +   */
 +  public void clearScanIterators();
 +  
 +  /**
 +   * Returns an iterator over an accumulo table. This iterator uses the options that are currently set for its lifetime, so setting options will have no effect
 +   * on existing iterators.
 +   * 
 +   * Keys returned by the iterator are not guaranteed to be in sorted order.
 +   * 
 +   * @return an iterator over Key,Value pairs which meet the restrictions set on the scanner
 +   */
++  @Override
 +  public Iterator<Entry<Key,Value>> iterator();
 +  
 +  /**
 +   * This setting determines how long a scanner will automatically retry when a failure occurs. By default a scanner will retry forever.
 +   * 
 +   * Setting to zero or Long.MAX_VALUE and TimeUnit.MILLISECONDS means to retry forever.
 +   * 
-    * @param timeOut
 +   * @param timeUnit
 +   *          determines how timeout is interpreted
 +   * @since 1.5.0
 +   */
 +  public void setTimeout(long timeOut, TimeUnit timeUnit);
 +  
 +  /**
 +   * Returns the setting for how long a scanner will automatically retry when a failure occurs.
 +   * 
 +   * @return the timeout configured for this scanner
 +   * @since 1.5.0
 +   */
 +  public long getTimeout(TimeUnit timeUnit);
 +
 +  /**
 +   * Closes any underlying connections on the scanner
 +   * @since 1.5.0
 +   */
 +  public void close();
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
index 5197262,0000000..795ce9f
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
@@@ -1,320 -1,0 +1,318 @@@
 +/*
 + * 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;
 +
 +import java.io.FileNotFoundException;
 +import java.io.IOException;
 +import java.net.UnknownHostException;
 +import java.nio.ByteBuffer;
 +import java.util.Collections;
 +import java.util.List;
 +import java.util.UUID;
 +
 +import org.apache.accumulo.core.Constants;
 +import org.apache.accumulo.core.client.impl.ConnectorImpl;
 +import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 +import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.Property;
 +import org.apache.accumulo.core.file.FileUtil;
 +import org.apache.accumulo.core.security.CredentialHelper;
 +import org.apache.accumulo.core.security.thrift.TCredentials;
 +import org.apache.accumulo.core.util.ArgumentChecker;
 +import org.apache.accumulo.core.util.ByteBufferUtil;
 +import org.apache.accumulo.core.util.CachedConfiguration;
 +import org.apache.accumulo.core.util.OpTimer;
 +import org.apache.accumulo.core.util.TextUtil;
 +import org.apache.accumulo.core.zookeeper.ZooUtil;
 +import org.apache.accumulo.fate.zookeeper.ZooCache;
 +import org.apache.hadoop.fs.FileStatus;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.hadoop.io.Text;
 +import org.apache.log4j.Level;
 +import org.apache.log4j.Logger;
 +
 +/**
 + * <p>
 + * An implementation of instance that looks in zookeeper to find information needed to connect to an instance of accumulo.
 + * 
 + * <p>
 + * The advantage of using zookeeper to obtain information about accumulo is that zookeeper is highly available, very responsive, and supports caching.
 + * 
 + * <p>
 + * Because it is possible for multiple instances of accumulo to share a single set of zookeeper servers, all constructors require an accumulo instance name.
 + * 
 + * If you do not know the instance names then run accumulo org.apache.accumulo.server.util.ListInstances on an accumulo server.
 + * 
 + */
 +
 +public class ZooKeeperInstance implements Instance {
 +
 +  private static final Logger log = Logger.getLogger(ZooKeeperInstance.class);
 +
 +  private String instanceId = null;
 +  private String instanceName = null;
 +
 +  private final ZooCache zooCache;
 +
 +  private final String zooKeepers;
 +
 +  private final int zooKeepersSessionTimeOut;
 +
 +  /**
 +   * 
 +   * @param instanceName
 +   *          The name of specific accumulo instance. This is set at initialization time.
 +   * @param zooKeepers
 +   *          A comma separated list of zoo keeper server locations. Each location can contain an optional port, of the format host:port.
 +   */
 +
 +  public ZooKeeperInstance(String instanceName, String zooKeepers) {
 +    this(instanceName, zooKeepers, (int) AccumuloConfiguration.getDefaultConfiguration().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
 +  }
 +
 +  /**
 +   * 
 +   * @param instanceName
 +   *          The name of specific accumulo instance. This is set at initialization time.
 +   * @param zooKeepers
 +   *          A comma separated list of zoo keeper server locations. Each location can contain an optional port, of the format host:port.
 +   * @param sessionTimeout
 +   *          zoo keeper session time out in milliseconds.
 +   */
 +
 +  public ZooKeeperInstance(String instanceName, String zooKeepers, int sessionTimeout) {
 +    ArgumentChecker.notNull(instanceName, zooKeepers);
 +    this.instanceName = instanceName;
 +    this.zooKeepers = zooKeepers;
 +    this.zooKeepersSessionTimeOut = sessionTimeout;
 +    zooCache = ZooCache.getInstance(zooKeepers, sessionTimeout);
 +    getInstanceID();
 +  }
 +
 +  /**
 +   * 
 +   * @param instanceId
 +   *          The UUID that identifies the accumulo instance you want to connect to.
 +   * @param zooKeepers
 +   *          A comma separated list of zoo keeper server locations. Each location can contain an optional port, of the format host:port.
 +   */
 +
 +  public ZooKeeperInstance(UUID instanceId, String zooKeepers) {
 +    this(instanceId, zooKeepers, (int) AccumuloConfiguration.getDefaultConfiguration().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
 +  }
 +
 +  /**
 +   * 
 +   * @param instanceId
 +   *          The UUID that identifies the accumulo instance you want to connect to.
 +   * @param zooKeepers
 +   *          A comma separated list of zoo keeper server locations. Each location can contain an optional port, of the format host:port.
 +   * @param sessionTimeout
 +   *          zoo keeper session time out in milliseconds.
 +   */
 +
 +  public ZooKeeperInstance(UUID instanceId, String zooKeepers, int sessionTimeout) {
 +    ArgumentChecker.notNull(instanceId, zooKeepers);
 +    this.instanceId = instanceId.toString();
 +    this.zooKeepers = zooKeepers;
 +    this.zooKeepersSessionTimeOut = sessionTimeout;
 +    zooCache = ZooCache.getInstance(zooKeepers, sessionTimeout);
 +  }
 +
 +  @Override
 +  public String getInstanceID() {
 +    if (instanceId == null) {
 +      // want the instance id to be stable for the life of this instance object,
 +      // so only get it once
 +      String instanceNamePath = Constants.ZROOT + Constants.ZINSTANCES + "/" + instanceName;
 +      byte[] iidb = zooCache.get(instanceNamePath);
 +      if (iidb == null) {
 +        throw new RuntimeException("Instance name " + instanceName
 +            + " does not exist in zookeeper.  Run \"accumulo org.apache.accumulo.server.util.ListInstances\" to see a list.");
 +      }
 +      instanceId = new String(iidb, Constants.UTF8);
 +    }
 +
 +    if (zooCache.get(Constants.ZROOT + "/" + instanceId) == null) {
 +      if (instanceName == null)
 +        throw new RuntimeException("Instance id " + instanceId + " does not exist in zookeeper");
 +      throw new RuntimeException("Instance id " + instanceId + " pointed to by the name " + instanceName + " does not exist in zookeeper");
 +    }
 +
 +    return instanceId;
 +  }
 +
 +  @Override
 +  public List<String> getMasterLocations() {
 +    String masterLocPath = ZooUtil.getRoot(this) + Constants.ZMASTER_LOCK;
 +
 +    OpTimer opTimer = new OpTimer(log, Level.TRACE).start("Looking up master location in zoocache.");
 +    byte[] loc = ZooUtil.getLockData(zooCache, masterLocPath);
 +    opTimer.stop("Found master at " + (loc == null ? null : new String(loc, Constants.UTF8)) + " in %DURATION%");
 +
 +    if (loc == null) {
 +      return Collections.emptyList();
 +    }
 +
 +    return Collections.singletonList(new String(loc, Constants.UTF8));
 +  }
 +
 +  @Override
 +  public String getRootTabletLocation() {
 +    String zRootLocPath = ZooUtil.getRoot(this) + Constants.ZROOT_TABLET_LOCATION;
 +
 +    OpTimer opTimer = new OpTimer(log, Level.TRACE).start("Looking up root tablet location in zookeeper.");
 +    byte[] loc = zooCache.get(zRootLocPath);
 +    opTimer.stop("Found root tablet at " + (loc == null ? null : new String(loc, Constants.UTF8)) + " in %DURATION%");
 +
 +    if (loc == null) {
 +      return null;
 +    }
 +
 +    return new String(loc, Constants.UTF8).split("\\|")[0];
 +  }
 +
 +  @Override
 +  public String getInstanceName() {
 +    if (instanceName == null)
 +      instanceName = lookupInstanceName(zooCache, UUID.fromString(getInstanceID()));
 +
 +    return instanceName;
 +  }
 +
 +  @Override
 +  public String getZooKeepers() {
 +    return zooKeepers;
 +  }
 +
 +  @Override
 +  public int getZooKeepersSessionTimeOut() {
 +    return zooKeepersSessionTimeOut;
 +  }
 +
 +  @Override
 +  @Deprecated
 +  public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
 +    return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
 +  }
 +
 +  @Override
 +  @Deprecated
 +  public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
 +    return getConnector(user, ByteBufferUtil.toBytes(pass));
 +  }
 +
 +  @Override
 +  public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
 +    return getConnector(CredentialHelper.create(principal, token, getInstanceID()));
 +  }
 +
 +  @SuppressWarnings("deprecation")
 +  private Connector getConnector(TCredentials credential) throws AccumuloException, AccumuloSecurityException {
 +    return new ConnectorImpl(this, credential);
 +  }
 +
 +  @Override
 +  @Deprecated
 +  public Connector getConnector(String principal, byte[] pass) throws AccumuloException, AccumuloSecurityException {
 +    return getConnector(principal, new PasswordToken(pass));
 +  }
 +
 +  private AccumuloConfiguration conf = null;
 +
 +  @Override
 +  public AccumuloConfiguration getConfiguration() {
 +    if (conf == null)
 +      conf = AccumuloConfiguration.getDefaultConfiguration();
 +    return conf;
 +  }
 +
 +  @Override
 +  public void setConfiguration(AccumuloConfiguration conf) {
 +    this.conf = conf;
 +  }
 +
 +  /**
 +   * @deprecated Use {@link #lookupInstanceName(org.apache.accumulo.fate.zookeeper.ZooCache, UUID)} instead
 +   */
 +  @Deprecated
 +  public static String lookupInstanceName(org.apache.accumulo.core.zookeeper.ZooCache zooCache, UUID instanceId) {
 +    return lookupInstanceName((ZooCache) zooCache, instanceId);
 +  }
 +
 +  /**
 +   * Given a zooCache and instanceId, look up the instance name.
 +   * 
-    * @param zooCache
-    * @param instanceId
 +   * @return the instance name
 +   */
 +  public static String lookupInstanceName(ZooCache zooCache, UUID instanceId) {
 +    ArgumentChecker.notNull(zooCache, instanceId);
 +    for (String name : zooCache.getChildren(Constants.ZROOT + Constants.ZINSTANCES)) {
 +      String instanceNamePath = Constants.ZROOT + Constants.ZINSTANCES + "/" + name;
 +      byte[] bytes = zooCache.get(instanceNamePath);
 +      UUID iid = UUID.fromString(new String(bytes, Constants.UTF8));
 +      if (iid.equals(instanceId)) {
 +        return name;
 +      }
 +    }
 +    return null;
 +  }
 +
 +  /**
 +   * To be moved to server code. Only lives here to support certain client side utilities to minimize command-line options.
 +   */
 +  @Deprecated
 +  public static String getInstanceIDFromHdfs(Path instanceDirectory) {
 +    try {
 +      FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), AccumuloConfiguration.getSiteConfiguration());
 +      FileStatus[] files = null;
 +      try {
 +        files = fs.listStatus(instanceDirectory);
 +      } catch (FileNotFoundException ex) {
 +        // ignored
 +      }
 +      log.debug("Trying to read instance id from " + instanceDirectory);
 +      if (files == null || files.length == 0) {
 +        log.error("unable obtain instance id at " + instanceDirectory);
 +        throw new RuntimeException("Accumulo not initialized, there is no instance id at " + instanceDirectory);
 +      } else if (files.length != 1) {
 +        log.error("multiple potential instances in " + instanceDirectory);
 +        throw new RuntimeException("Accumulo found multiple possible instance ids in " + instanceDirectory);
 +      } else {
 +        String result = files[0].getPath().getName();
 +        return result;
 +      }
 +    } catch (IOException e) {
 +      log.error("Problem reading instance id out of hdfs at " + instanceDirectory, e);
 +      throw new RuntimeException("Can't tell if Accumulo is initialized; can't read instance id at " + instanceDirectory, e);
 +    } catch (IllegalArgumentException exception) {
 +      /* HDFS throws this when there's a UnknownHostException due to DNS troubles. */
 +      if (exception.getCause() instanceof UnknownHostException) {
 +        log.error("Problem reading instance id out of hdfs at " + instanceDirectory, exception);
 +      }
 +      throw exception;
 +    }
 +  }
 +
 +  @Deprecated
 +  @Override
 +  public Connector getConnector(org.apache.accumulo.core.security.thrift.AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
 +    return getConnector(auth.user, auth.password);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java
index f2876b2,0000000..9c39ea6
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java
@@@ -1,185 -1,0 +1,184 @@@
 +/*
 + * 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.admin;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +import java.util.Map;
 +
 +import org.apache.accumulo.core.client.Instance;
 +import org.apache.accumulo.core.client.IteratorSetting;
 +import org.apache.accumulo.core.client.TableNotFoundException;
 +import org.apache.accumulo.core.client.impl.Tables;
 +import org.apache.accumulo.core.data.KeyExtent;
 +import org.apache.accumulo.core.data.thrift.IterInfo;
 +
 +
 +/**
 + * 
 + * @since 1.5.0
 + */
 +public class ActiveCompaction {
 +  
 +  private org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction tac;
 +  private Instance instance;
 +
 +  ActiveCompaction(Instance instance, org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction tac) {
 +    this.tac = tac;
 +    this.instance = instance;
 +  }
 +
 +  public static enum CompactionType {
 +    /**
 +     * compaction to flush a tablets memory
 +     */
 +    MINOR,
 +    /**
 +     * compaction to flush a tablets memory and merge it with the tablets smallest file. This type compaction is done when a tablet has too many files
 +     */
 +    MERGE,
 +    /**
 +     * compaction that merges a subset of a tablets files into one file
 +     */
 +    MAJOR,
 +    /**
 +     * compaction that merges all of a tablets files into one file
 +     */
 +    FULL
 +  };
 +  
 +  public static enum CompactionReason {
 +    /**
 +     * compaction initiated by user
 +     */
 +    USER,
 +    /**
 +     * Compaction initiated by system
 +     */
 +    SYSTEM,
 +    /**
 +     * Compaction initiated by merge operation
 +     */
 +    CHOP,
 +    /**
 +     * idle compaction
 +     */
 +    IDLE,
 +    /**
 +     * Compaction initiated to close a unload a tablet
 +     */
 +    CLOSE
 +  };
 +  
 +  /**
 +   * 
 +   * @return name of the table the compaction is running against
-    * @throws TableNotFoundException
 +   */
 +  
 +  public String getTable() throws TableNotFoundException {
 +    return Tables.getTableName(instance, getExtent().getTableId().toString());
 +  }
 +  
 +  /**
 +   * @return tablet thats is compacting
 +   */
 +
 +  public KeyExtent getExtent() {
 +    return new KeyExtent(tac.getExtent());
 +  }
 +  
 +  /**
 +   * @return how long the compaction has been running in milliseconds
 +   */
 +
 +  public long getAge() {
 +    return tac.getAge();
 +  }
 +  
 +  /**
 +   * @return the files the compaction is reading from
 +   */
 +
 +  public List<String> getInputFiles() {
 +    return tac.getInputFiles();
 +  }
 +  
 +  /**
 +   * @return file compactions is writing too
 +   */
 +
 +  public String getOutputFile() {
 +    return tac.getOutputFile();
 +  }
 +  
 +  /**
 +   * @return the type of compaction
 +   */
 +  public CompactionType getType() {
 +    return CompactionType.valueOf(tac.getType().name());
 +  }
 +  
 +  /**
 +   * @return the reason the compaction was started
 +   */
 +
 +  public CompactionReason getReason() {
 +    return CompactionReason.valueOf(tac.getReason().name());
 +  }
 +  
 +  /**
 +   * @return the locality group that is compacting
 +   */
 +
 +  public String getLocalityGroup() {
 +    return tac.getLocalityGroup();
 +  }
 +  
 +  /**
 +   * @return the number of key/values read by the compaction
 +   */
 +
 +  public long getEntriesRead() {
 +    return tac.getEntriesRead();
 +  }
 +  
 +  /**
 +   * @return the number of key/values written by the compaction
 +   */
 +
 +  public long getEntriesWritten() {
 +    return tac.getEntriesWritten();
 +  }
 +  
 +  /**
 +   * @return the per compaction iterators configured
 +   */
 +
 +  public List<IteratorSetting> getIterators() {
 +    ArrayList<IteratorSetting> ret = new ArrayList<IteratorSetting>();
 +    
 +    for (IterInfo ii : tac.getSsiList()) {
 +      IteratorSetting settings = new IteratorSetting(ii.getPriority(), ii.getIterName(), ii.getClassName());
 +      Map<String,String> options = tac.getSsio().get(ii.getIterName());
 +      settings.addOptions(options);
 +      
 +      ret.add(settings);
 +    }
 +    
 +    return ret;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/92613388/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
index fce0716,0000000..29ff2a6
mode 100644,000000..100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
@@@ -1,131 -1,0 +1,119 @@@
 +/*
 + * 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.admin;
 +
 +import java.util.List;
 +import java.util.Map;
 +
 +import org.apache.accumulo.core.client.AccumuloException;
 +import org.apache.accumulo.core.client.AccumuloSecurityException;
 +
 +/**
 + * 
 + */
 +public interface InstanceOperations {
 +  
 +  /**
 +   * Sets an system property in zookeeper. Tablet servers will pull this setting and override the equivalent setting in accumulo-site.xml. Changes can be seen
 +   * using {@link #getSystemConfiguration()}
 +   * 
 +   * @param property
 +   *          the name of a per-table property
 +   * @param value
 +   *          the value to set a per-table property to
 +   * @throws AccumuloException
 +   *           if a general error occurs
 +   * @throws AccumuloSecurityException
 +   *           if the user does not have permission
 +   */
 +  public void setProperty(final String property, final String value) throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * Removes a system property from zookeeper. Changes can be seen using {@link #getSystemConfiguration()}
 +   * 
 +   * @param property
 +   *          the name of a per-table property
 +   * @throws AccumuloException
 +   *           if a general error occurs
 +   * @throws AccumuloSecurityException
 +   *           if the user does not have permission
 +   */
 +  public void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * 
 +   * @return A map of system properties set in zookeeper. If a property is not set in zookeeper, then it will return the value set in accumulo-site.xml on some
 +   *         server. If nothing is set in an accumulo-site.xml file it will return the default value for each property.
-    * @throws AccumuloException
-    * @throws AccumuloSecurityException
 +   */
 +
 +  public Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * 
 +   * @return A map of system properties set in accumulo-site.xml on some server. If nothing is set in an accumulo-site.xml file it will return the default value
 +   *         for each property.
-    * @throws AccumuloException
-    * @throws AccumuloSecurityException
 +   */
 +
 +  public Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * List the currently active tablet servers participating in the accumulo instance
 +   * 
 +   * @return A list of currently active tablet servers.
 +   */
 +  
 +  public List<String> getTabletServers();
 +  
 +  /**
 +   * List the active scans on tablet server.
 +   * 
 +   * @param tserver
 +   *          The tablet server address should be of the form <ip address>:<port>
 +   * @return A list of active scans on tablet server.
-    * @throws AccumuloException
-    * @throws AccumuloSecurityException
 +   */
 +  
 +  public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * List the active compaction running on a tablet server
 +   * 
 +   * @param tserver
 +   *          The tablet server address should be of the form <ip address>:<port>
 +   * @return the list of active compactions
-    * @throws AccumuloException
-    * @throws AccumuloSecurityException
 +   * @since 1.5.0
 +   */
 +  
 +  public List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException;
 +  
 +  /**
 +   * Throws an exception if a tablet server can not be contacted.
 +   * 
 +   * @param tserver
 +   *          The tablet server address should be of the form <ip address>:<port>
-    * @throws AccumuloException
 +   * @since 1.5.0
 +   */
 +  public void ping(String tserver) throws AccumuloException;
 +  
 +  /**
 +   * Test to see if the instance can load the given class as the given type. This check does not consider per table classpaths, see
 +   * {@link TableOperations#testClassLoad(String, String, String)}
 +   * 
-    * @param className
-    * @param asTypeName
 +   * @return true if the instance can load the given class as the given type, false otherwise
-    * @throws AccumuloException
 +   */
 +  public boolean testClassLoad(final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException;
 +  
 +}


Mime
View raw message