accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [12/16] git commit: Incomplete, but needs to be checkpointed
Date Mon, 22 Sep 2014 20:48:12 GMT
Incomplete, but needs to be checkpointed



git-svn-id: https://svn.apache.org/repos/asf/accumulo/branches/ACCUMULO-CURATOR@1497618 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/ACCUMULO-CURATOR
Commit: e261f8f4554a63b5bf5c96732ab28263ed6e420b
Parents: 139c18e
Author: John Vines <vines@apache.org>
Authored: Fri Jun 28 00:22:33 2013 +0000
Committer: John Vines <vines@apache.org>
Committed: Fri Jun 28 00:22:33 2013 +0000

----------------------------------------------------------------------
 .../accumulo/core/client/ZooKeeperInstance.java |  10 +-
 .../client/admin/InstanceOperationsImpl.java    |   4 +-
 .../accumulo/core/client/impl/ServerClient.java |  12 +-
 .../accumulo/core/client/impl/Tables.java       |  12 +-
 .../accumulo/core/trace/DistributedTrace.java   |   4 +-
 .../accumulo/core/trace/ZooTraceClient.java     |   6 +-
 .../apache/accumulo/core/util/shell/Shell.java  |   4 +-
 .../core/util/shell/commands/FateCommand.java   |   9 +-
 .../apache/accumulo/core/zookeeper/ZooUtil.java |   2 +-
 .../org/apache/accumulo/fate/AdminUtil.java     |  21 +-
 .../java/org/apache/accumulo/fate/ZooStore.java |  40 ++--
 .../apache/accumulo/fate/zookeeper/ZooLock.java |  39 ++--
 .../accumulo/fate/zookeeper/ZooQueueLock.java   |  12 +-
 .../accumulo/fate/zookeeper/ZooReader.java      | 105 ----------
 .../fate/zookeeper/ZooReaderWriter.java         | 207 -------------------
 .../accumulo/fate/zookeeper/ZooReservation.java |  10 +-
 .../accumulo/fate/zookeeper/ZooSession.java     | 153 --------------
 pom.xml                                         |   2 +-
 .../org/apache/accumulo/server/Accumulo.java    |   6 +-
 .../accumulo/server/client/HdfsZooInstance.java |   6 +-
 .../accumulo/server/conf/ZooConfiguration.java  |   8 +-
 .../server/constraints/MetadataConstraints.java |   3 +-
 .../org/apache/accumulo/server/fate/Admin.java  |   5 +-
 .../server/gc/GarbageCollectWriteAheadLogs.java |   4 +-
 .../accumulo/server/master/LiveTServerSet.java  |   5 +-
 .../apache/accumulo/server/master/Master.java   |  40 ++--
 .../server/master/TabletGroupWatcher.java       |   2 +-
 .../server/master/balancer/TabletBalancer.java  |   2 +-
 .../server/master/recovery/HadoopLogCloser.java |   2 +-
 .../server/master/recovery/LogCloser.java       |   2 +-
 .../server/master/recovery/MapRLogCloser.java   |   2 +-
 .../server/master/state/DeadServerList.java     |  16 +-
 .../server/master/state/IllegalDSException.java |   1 -
 .../server/master/state/MergeStats.java         |   6 +-
 .../server/master/state/SetGoalState.java       |   6 +-
 .../accumulo/server/master/state/ZooStore.java  |  12 +-
 .../master/state/tables/TableManager.java       |  23 +--
 .../master/tableOps/CancelCompactions.java      |   9 +-
 .../server/master/tableOps/CloneTable.java      |   2 +-
 .../server/master/tableOps/CompactRange.java    |  15 +-
 .../server/master/tableOps/CreateTable.java     |   2 +-
 .../server/master/tableOps/ImportTable.java     |   2 +-
 .../server/master/tableOps/RenameTable.java     |   9 +-
 .../accumulo/server/master/tableOps/Utils.java  |  15 +-
 .../master/tserverOps/ShutdownTServer.java      |   7 +-
 .../accumulo/server/metanalysis/FindTablet.java |   2 +-
 .../server/metanalysis/PrintEvents.java         |   2 +-
 .../monitor/servlets/TServersServlet.java       |   2 +-
 .../server/monitor/servlets/trace/Summary.java  |   2 +-
 .../accumulo/server/problems/ProblemReport.java |  11 +-
 .../server/problems/ProblemReports.java         |   5 +-
 .../security/handler/ZKAuthenticator.java       |  16 +-
 .../server/security/handler/ZKAuthorizor.java   |  16 +-
 .../server/security/handler/ZKPermHandler.java  |  42 ++--
 .../server/tabletserver/MinorCompactor.java     |   4 +-
 .../accumulo/server/tabletserver/Tablet.java    |  13 +-
 .../tabletserver/TabletIteratorEnvironment.java |   2 +-
 .../server/tabletserver/TabletServer.java       |  10 +-
 .../TabletServerResourceManager.java            |   2 +-
 .../tabletserver/UniqueNameAllocator.java       |   5 +-
 .../mastermessage/SplitReportMessage.java       |   2 +-
 .../mastermessage/TabletStatusMessage.java      |   4 +-
 .../accumulo/server/trace/TraceServer.java      |   7 +-
 .../accumulo/server/util/ChangeSecret.java      |  30 ++-
 .../accumulo/server/util/CleanZookeeper.java    |  21 +-
 .../accumulo/server/util/DeleteZooInstance.java |  10 +-
 .../accumulo/server/util/DumpZookeeper.java     |   7 +-
 .../apache/accumulo/server/util/Initialize.java |  19 +-
 .../accumulo/server/util/ListInstances.java     |   7 +-
 .../accumulo/server/util/MetadataTable.java     |  18 +-
 .../accumulo/server/util/RestoreZookeeper.java  |  11 +-
 .../accumulo/server/util/SystemPropUtil.java    |   9 +-
 .../accumulo/server/util/TablePropUtil.java     |  11 +-
 .../accumulo/server/util/TabletServerLocks.java |   9 +-
 .../org/apache/accumulo/server/util/ZooZap.java |  12 +-
 .../server/zookeeper/DistributedWorkQueue.java  |  14 +-
 .../server/zookeeper/TransactionWatcher.java    |  21 +-
 .../accumulo/server/zookeeper/ZooCache.java     |   6 +-
 .../accumulo/server/zookeeper/ZooLock.java      |   7 +-
 .../accumulo/server/zookeeper/ZooQueueLock.java |   3 +-
 .../server/zookeeper/ZooReaderWriter.java       |  86 --------
 .../server/client/BulkImporterTest.java         |   3 +-
 .../iterators/MetadataBulkLoadFilterTest.java   |   3 +-
 .../accumulo/server/master/DefaultMapTest.java  |   5 +-
 .../balancer/DefaultLoadBalancerTest.java       |   8 +-
 .../server/master/state/MergeInfoTest.java      |   2 -
 .../security/handler/ZKAuthenticatorTest.java   |   5 +-
 .../accumulo/server/util/DefaultMapTest.java    |   4 +-
 .../server/util/time/BaseRelativeTimeTest.java  |   5 +-
 .../org/apache/accumulo/test/TestIngest.java    |   4 +-
 .../org/apache/accumulo/test/VerifyIngest.java  |   4 +-
 .../test/functional/CacheTestClean.java         |   8 +-
 .../test/functional/CacheTestReader.java        |   4 +-
 .../test/functional/CacheTestWriter.java        |  12 +-
 .../test/functional/SplitRecoveryTest.java      |   7 +-
 .../accumulo/test/functional/ZombieTServer.java |   6 +-
 .../randomwalk/concurrent/StopTabletServer.java |   4 +-
 .../accumulo/fate/zookeeper/ZooLockTest.java    |   7 +-
 98 files changed, 401 insertions(+), 1002 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
index 5fff3a2..1d5eee3 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
@@ -39,8 +39,8 @@ import org.apache.accumulo.core.util.OpTimer;
 import org.apache.accumulo.core.util.RootTable;
 import org.apache.accumulo.core.util.TextUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.accumulo.fate.curator.CuratorUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
 import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -70,7 +70,7 @@ public class ZooKeeperInstance implements Instance {
   private String instanceId = null;
   private String instanceName = null;
   
-  private final ZooCache zooCache;
+  private final CuratorCaches zooCache;
   
   private final String zooKeepers;
   
@@ -103,7 +103,7 @@ public class ZooKeeperInstance implements Instance {
     this.instanceName = instanceName;
     this.zooKeepers = zooKeepers;
     this.zooKeepersSessionTimeOut = sessionTimeout;
-    zooCache = ZooCache.getInstance(zooKeepers, sessionTimeout);
+    zooCache = CuratorCaches.getInstance(zooKeepers, sessionTimeout);
     getInstanceID();
   }
   
@@ -134,7 +134,7 @@ public class ZooKeeperInstance implements Instance {
     this.instanceId = instanceId.toString();
     this.zooKeepers = zooKeepers;
     this.zooKeepersSessionTimeOut = sessionTimeout;
-    zooCache = ZooCache.getInstance(zooKeepers, sessionTimeout);
+    zooCache = CuratorCaches.getInstance(zooKeepers, sessionTimeout);
   }
   
   @Override
@@ -257,7 +257,7 @@ public class ZooKeeperInstance implements Instance {
    * @param instanceId
    * @return the instance name
    */
-  public static String lookupInstanceName(ZooCache zooCache, UUID instanceId) {
+  public static String lookupInstanceName(CuratorCaches zooCache, UUID instanceId) {
     ArgumentChecker.notNull(zooCache, instanceId);
     String path = Constants.ZROOT + Constants.ZINSTANCES;
     for (ChildData name : zooCache.getChildren(path)) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
index 7d0f78b..b54683c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
@@ -41,8 +41,8 @@ import org.apache.accumulo.core.util.AddressUtil;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.accumulo.core.util.ThriftUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.accumulo.fate.curator.CuratorUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
 import org.apache.accumulo.trace.instrument.Tracer;
 import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.thrift.TException;
@@ -112,7 +112,7 @@ public class InstanceOperationsImpl implements InstanceOperations {
   
   @Override
   public List<String> getTabletServers() {
-    ZooCache cache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
+    CuratorCaches cache = CuratorCaches.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
     String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
     List<String> results = new ArrayList<String>();
     for (ChildData candidate : cache.getChildren(path)) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
index 7773979..68fce23 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
@@ -36,7 +36,7 @@ import org.apache.accumulo.core.util.ServerServices.Service;
 import org.apache.accumulo.core.util.ThriftUtil;
 import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.log4j.Logger;
 import org.apache.thrift.transport.TTransport;
@@ -44,12 +44,12 @@ import org.apache.thrift.transport.TTransportException;
 
 public class ServerClient {
   private static final Logger log = Logger.getLogger(ServerClient.class);
-  private static final Map<String,ZooCache> zooCaches = new HashMap<String,ZooCache>();
+  private static final Map<String,CuratorCaches> zooCaches = new HashMap<String,CuratorCaches>();
   
-  private synchronized static ZooCache getZooCache(Instance instance) {
-    ZooCache result = zooCaches.get(instance.getZooKeepers());
+  private synchronized static CuratorCaches getZooCache(Instance instance) {
+    CuratorCaches result = zooCaches.get(instance.getZooKeepers());
     if (result == null) {
-      result = new ZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
+      result = new CuratorCaches(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
       zooCaches.put(instance.getZooKeepers(), result);
     }
     return result;
@@ -135,7 +135,7 @@ public class ServerClient {
     ArrayList<ThriftTransportKey> servers = new ArrayList<ThriftTransportKey>();
     
     // add tservers
-    ZooCache zc = getZooCache(instance);
+    CuratorCaches zc = getZooCache(instance);
     for (ChildData tserver : zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTSERVERS)) {
       String path = tserver.getPath();
       byte[] data = ZooUtil.getLockData(zc, path);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
----------------------------------------------------------------------
diff --git 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
index 75d22e5..5471f43 100644
--- 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
@@ -27,23 +27,23 @@ import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.accumulo.fate.curator.CuratorUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
 import org.apache.curator.framework.recipes.cache.ChildData;
 
 public class Tables {
   private static SecurityPermission TABLES_PERMISSION = new SecurityPermission("tablesPermission");
   
-  private static ZooCache getZooCache(Instance instance) {
+  private static CuratorCaches getZooCache(Instance instance) {
     SecurityManager sm = System.getSecurityManager();
     if (sm != null) {
       sm.checkPermission(TABLES_PERMISSION);
     }
-    return ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
+    return CuratorCaches.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
   }
   
   private static SortedMap<String,String> getMap(Instance instance, boolean nameAsKey) {
-    ZooCache zc = getZooCache(instance);
+    CuratorCaches zc = getZooCache(instance);
     
     List<ChildData> tableIds = zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES);
     
@@ -85,7 +85,7 @@ public class Tables {
   }
   
   public static boolean exists(Instance instance, String tableId) {
-    ZooCache zc = getZooCache(instance);
+    CuratorCaches zc = getZooCache(instance);
     ChildData table = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + '/' + tableId);
     return table != null;
   }
@@ -126,7 +126,7 @@ public class Tables {
   
   public static TableState getTableState(Instance instance, String tableId) {
     String statePath = ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE;
-    ZooCache zc = getZooCache(instance);
+    CuratorCaches zc = getZooCache(instance);
     byte[] state = zc.get(statePath).getData();
     if (state == null)
       return TableState.UNKNOWN;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
index 83f5c26..2b1806d 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
@@ -24,12 +24,12 @@ import org.apache.accumulo.trace.instrument.Tracer;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
-import org.apache.accumulo.fate.zookeeper.ZooReader;
+import org.apache.accumulo.fate.curator.CuratorReader;
 import org.apache.zookeeper.KeeperException;
 
 
 public class DistributedTrace {
-  public static void enable(Instance instance, ZooReader zoo, String application, String address) throws IOException, KeeperException, InterruptedException {
+  public static void enable(Instance instance, CuratorReader zoo, String application, String address) throws IOException, KeeperException, InterruptedException {
     String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
     if (address == null) {
       try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/trace/ZooTraceClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/ZooTraceClient.java b/core/src/main/java/org/apache/accumulo/core/trace/ZooTraceClient.java
index 43fa464..a0f1d93 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/ZooTraceClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/ZooTraceClient.java
@@ -23,7 +23,7 @@ import java.util.Map;
 import java.util.Random;
 
 import org.apache.accumulo.trace.instrument.receivers.SendSpansViaThrift;
-import org.apache.accumulo.fate.zookeeper.ZooReader;
+import org.apache.accumulo.fate.curator.CuratorReader;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
@@ -38,12 +38,12 @@ public class ZooTraceClient extends SendSpansViaThrift implements Watcher {
   
   private static final Logger log = Logger.getLogger(ZooTraceClient.class);
   
-  final ZooReader zoo;
+  final CuratorReader zoo;
   final String path;
   final Random random = new Random();
   final List<String> hosts = new ArrayList<String>();
   
-  public ZooTraceClient(ZooReader zoo, String path, String host, String service, long millis) throws IOException, KeeperException, InterruptedException {
+  public ZooTraceClient(CuratorReader zoo, String path, String host, String service, long millis) throws IOException, KeeperException, InterruptedException {
     super(host, service, millis);
     this.path = path;
     this.zoo = zoo;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
index ef3e519..d227c47 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
@@ -140,7 +140,7 @@ import org.apache.accumulo.core.util.shell.commands.UserCommand;
 import org.apache.accumulo.core.util.shell.commands.UserPermissionsCommand;
 import org.apache.accumulo.core.util.shell.commands.UsersCommand;
 import org.apache.accumulo.core.util.shell.commands.WhoAmICommand;
-import org.apache.accumulo.fate.zookeeper.ZooReader;
+import org.apache.accumulo.fate.curator.CuratorReader;
 import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.HelpFormatter;
@@ -286,7 +286,7 @@ public class Shell extends ShellOptions {
       }
       
       if (!options.isFake()) {
-        ZooReader zr = new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
+        CuratorReader zr = new CuratorReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
         DistributedTrace.enable(instance, zr, "shell", InetAddress.getLocalHost().getHostName());
       }
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
index 8a4d0ce..bb09e3a 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
@@ -33,8 +33,7 @@ import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.AdminUtil;
 import org.apache.accumulo.fate.TStore.TStatus;
 import org.apache.accumulo.fate.ZooStore;
-import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
-import org.apache.accumulo.fate.zookeeper.ZooReaderWriter;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
@@ -69,7 +68,7 @@ public class FateCommand extends Command {
     
     String path = ZooUtil.getRoot(instance) + Constants.ZFATE;
     String masterPath = ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK;
-    IZooReaderWriter zk = getZooReaderWriter(shellState.getInstance(), cl.getOptionValue(secretOption.getOpt()));
+    CuratorReaderWriter zk = getZooReaderWriter(shellState.getInstance(), cl.getOptionValue(secretOption.getOpt()));
     ZooStore<FateCommand> zs = new ZooStore<FateCommand>(path, zk);
     
     if ("fail".equals(cmd)) {
@@ -138,14 +137,14 @@ public class FateCommand extends Command {
   }
   
   @SuppressWarnings("deprecation")
-  protected synchronized IZooReaderWriter getZooReaderWriter(Instance instance, String secret) {
+  protected synchronized CuratorReaderWriter getZooReaderWriter(Instance instance, String secret) {
 
     if (secret == null) {
       AccumuloConfiguration conf = AccumuloConfiguration.getSiteConfiguration();
       secret = conf.get(Property.INSTANCE_SECRET);
     }
     
-    return new ZooReaderWriter(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), SCHEME,
+    return CuratorReaderWriter.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), SCHEME,
         (USER + ":" + secret).getBytes());
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
index 86dc4d2..4ed1e0a 100644
--- a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
@@ -19,7 +19,7 @@ package org.apache.accumulo.core.zookeeper;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 
-public class ZooUtil extends org.apache.accumulo.fate.zookeeper.ZooUtil {
+public class ZooUtil extends org.apache.accumulo.fate.curator.CuratorUtil {
   public static String getRoot(final Instance instance) {
     return getRoot(instance.getInstanceID());
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
index 8f86d43..ec735bb 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
@@ -27,9 +27,8 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 import org.apache.accumulo.fate.TStore.TStatus;
-import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
 import org.apache.accumulo.fate.zookeeper.ZooLock;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
 import org.apache.zookeeper.KeeperException;
 
 /**
@@ -57,11 +56,11 @@ public class AdminUtil<T> {
     this.exitOnError = exitOnError;
   }
   
-  public void print(ZooStore<T> zs, IZooReaderWriter zk, String lockPath) throws KeeperException, InterruptedException {
+  public void print(ZooStore<T> zs, CuratorReaderWriter zk, String lockPath) throws KeeperException, InterruptedException {
     print(zs, zk, lockPath, new Formatter(System.out), null, null);
   }
   
-  public void print(ZooStore<T> zs, IZooReaderWriter zk, String lockPath, Formatter fmt, Set<Long> filterTxid, EnumSet<TStatus> filterStatus)
+  public void print(ZooStore<T> zs, CuratorReaderWriter zk, String lockPath, Formatter fmt, Set<Long> filterTxid, EnumSet<TStatus> filterStatus)
       throws KeeperException, InterruptedException {
     Map<Long,List<String>> heldLocks = new HashMap<Long,List<String>>();
     Map<Long,List<String>> waitingLocks = new HashMap<Long,List<String>>();
@@ -162,7 +161,7 @@ public class AdminUtil<T> {
     }
   }
   
-  public boolean prepDelete(ZooStore<T> zs, IZooReaderWriter zk, String path, String txidStr) {
+  public boolean prepDelete(ZooStore<T> zs, CuratorReaderWriter zk, String path, String txidStr) {
     if (!checkGlobalLock(zk, path)) {
       return false;
     }
@@ -197,7 +196,7 @@ public class AdminUtil<T> {
     return state;
   }
   
-  public boolean prepFail(ZooStore<T> zs, IZooReaderWriter zk, String path, String txidStr) {
+  public boolean prepFail(ZooStore<T> zs, CuratorReaderWriter zk, String path, String txidStr) {
     if (!checkGlobalLock(zk, path)) {
       return false;
     }
@@ -239,7 +238,7 @@ public class AdminUtil<T> {
     return state;
   }
   
-  public void deleteLocks(ZooStore<T> zs, IZooReaderWriter zk, String path, String txidStr) throws KeeperException, InterruptedException {
+  public void deleteLocks(ZooStore<T> zs, CuratorReaderWriter zk, String path, String txidStr) throws KeeperException, InterruptedException {
     // delete any locks assoc w/ fate operation
     List<String> lockedIds = zk.getChildren(path);
     
@@ -250,14 +249,14 @@ public class AdminUtil<T> {
         byte[] data = zk.getData(path + "/" + id + "/" + node, null);
         String lda[] = new String(data).split(":");
         if (lda[1].equals(txidStr))
-          zk.recursiveDelete(lockPath, NodeMissingPolicy.SKIP);
+          zk.recursiveDelete(lockPath);
       }
     }
   }
   
-  public boolean checkGlobalLock(IZooReaderWriter zk, String path) {
+  public boolean checkGlobalLock(CuratorReaderWriter zk, String path) {
     try {
-      if (ZooLock.getLockData(zk.getZooKeeper(), path) != null) {
+      if (ZooLock.getLockData(zk.getCurator().getZookeeperClient().getZooKeeper(), path) != null) {
         System.err.println("ERROR: Master lock is held, not running");
         if (this.exitOnError)
           System.exit(1);
@@ -276,6 +275,8 @@ public class AdminUtil<T> {
         System.exit(1);
       else
         return false;
+    } catch (Exception e) {
+      throw new RuntimeException(e);
     }
     return true;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java b/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
index c78dcc1..1564aa9 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
@@ -32,9 +32,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.apache.zookeeper.KeeperException.NodeExistsException;
@@ -46,7 +44,7 @@ import org.apache.zookeeper.KeeperException.NodeExistsException;
 public class ZooStore<T> implements TStore<T> {
   
   private String path;
-  private IZooReaderWriter zk;
+  private CuratorReaderWriter curator;
   private String lastReserved = "";
   private Set<Long> reserved;
   private Map<Long,Long> defered;
@@ -86,15 +84,15 @@ public class ZooStore<T> implements TStore<T> {
     return Long.parseLong(txdir.split("_")[1], 16);
   }
   
-  public ZooStore(String path, IZooReaderWriter zk) throws KeeperException, InterruptedException {
+  public ZooStore(String path, CuratorReaderWriter curator) throws KeeperException, InterruptedException {
     
     this.path = path;
-    this.zk = zk;
+    this.curator = curator;
     this.reserved = new HashSet<Long>();
     this.defered = new HashMap<Long,Long>();
     this.idgenerator = new SecureRandom();
     
-    zk.putPersistentData(path, new byte[0], NodeExistsPolicy.SKIP);
+    curator.putPersistentData(path, new byte[0], CuratorReaderWriter.NodeExistsPolicy.SKIP);
   }
   
   @Override
@@ -103,7 +101,7 @@ public class ZooStore<T> implements TStore<T> {
       try {
         // looking at the code for SecureRandom, it appears to be thread safe
         long tid = idgenerator.nextLong() & 0x7fffffffffffffffl;
-        zk.putPersistentData(getTXPath(tid), TStatus.NEW.name().getBytes(), NodeExistsPolicy.FAIL);
+        curator.putPersistentData(getTXPath(tid), TStatus.NEW.name().getBytes(), CuratorReaderWriter.NodeExistsPolicy.FAIL);
         return tid;
       } catch (NodeExistsException nee) {
         // exist, so just try another random #
@@ -123,7 +121,7 @@ public class ZooStore<T> implements TStore<T> {
           events = statusChangeEvents;
         }
         
-        List<String> txdirs = new ArrayList<String>(zk.getChildren(path));
+        List<String> txdirs = new ArrayList<String>(curator.getChildren(path));
         Collections.sort(txdirs);
         
         synchronized (this) {
@@ -157,7 +155,7 @@ public class ZooStore<T> implements TStore<T> {
           // have reserved id, status should not change
           
           try {
-            TStatus status = TStatus.valueOf(new String(zk.getData(path + "/" + txdir, null)));
+            TStatus status = TStatus.valueOf(new String(curator.getData(path + "/" + txdir, null)));
             if (status == TStatus.IN_PROGRESS || status == TStatus.FAILED_IN_PROGRESS) {
               return tid;
             } else {
@@ -256,7 +254,7 @@ public class ZooStore<T> implements TStore<T> {
         if (top == null)
           return null;
         
-        byte[] ser = zk.getData(txpath + "/" + top, null);
+        byte[] ser = curator.getData(txpath + "/" + top, null);
         return (Repo<T>) deserialize(ser);
       } catch (KeeperException.NoNodeException ex) {
         continue;
@@ -267,7 +265,7 @@ public class ZooStore<T> implements TStore<T> {
   }
   
   private String findTop(String txpath) throws KeeperException, InterruptedException {
-    List<String> ops = zk.getChildren(txpath);
+    List<String> ops = curator.getChildren(txpath);
     
     ops = new ArrayList<String>(ops);
     
@@ -294,7 +292,7 @@ public class ZooStore<T> implements TStore<T> {
         throw new StackOverflowException("Repo stack size too large");
       }
       
-      zk.putPersistentSequential(txpath + "/repo_", serialize(repo));
+      curator.putPersistentSequential(txpath + "/repo_", serialize(repo));
     } catch (StackOverflowException soe) {
       throw soe;
     } catch (Exception e) {
@@ -311,7 +309,7 @@ public class ZooStore<T> implements TStore<T> {
       String top = findTop(txpath);
       if (top == null)
         throw new IllegalStateException("Tried to pop when empty " + tid);
-      zk.recursiveDelete(txpath + "/" + top, NodeMissingPolicy.SKIP);
+      curator.recursiveDelete(txpath + "/" + top);
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
@@ -319,7 +317,7 @@ public class ZooStore<T> implements TStore<T> {
   
   private TStatus _getStatus(long tid) {
     try {
-      return TStatus.valueOf(new String(zk.getData(getTXPath(tid), null)));
+      return TStatus.valueOf(new String(curator.getData(getTXPath(tid), null)));
     } catch (NoNodeException nne) {
       return TStatus.UNKNOWN;
     } catch (Exception e) {
@@ -362,7 +360,7 @@ public class ZooStore<T> implements TStore<T> {
     verifyReserved(tid);
     
     try {
-      zk.putPersistentData(getTXPath(tid), status.name().getBytes(), NodeExistsPolicy.OVERWRITE);
+      curator.putPersistentData(getTXPath(tid), status.name().getBytes(), CuratorReaderWriter.NodeExistsPolicy.OVERWRITE);
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
@@ -378,7 +376,7 @@ public class ZooStore<T> implements TStore<T> {
     verifyReserved(tid);
     
     try {
-      zk.recursiveDelete(getTXPath(tid), NodeMissingPolicy.SKIP);
+      curator.recursiveDelete(getTXPath(tid));
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
@@ -390,14 +388,14 @@ public class ZooStore<T> implements TStore<T> {
     
     try {
       if (so instanceof String) {
-        zk.putPersistentData(getTXPath(tid) + "/prop_" + prop, ("S " + so).getBytes(), NodeExistsPolicy.OVERWRITE);
+        curator.putPersistentData(getTXPath(tid) + "/prop_" + prop, ("S " + so).getBytes(), CuratorReaderWriter.NodeExistsPolicy.OVERWRITE);
       } else {
         byte[] sera = serialize(so);
         byte[] data = new byte[sera.length + 2];
         System.arraycopy(sera, 0, data, 2, sera.length);
         data[0] = 'O';
         data[1] = ' ';
-        zk.putPersistentData(getTXPath(tid) + "/prop_" + prop, data, NodeExistsPolicy.OVERWRITE);
+        curator.putPersistentData(getTXPath(tid) + "/prop_" + prop, data, CuratorReaderWriter.NodeExistsPolicy.OVERWRITE);
       }
     } catch (Exception e2) {
       throw new RuntimeException(e2);
@@ -409,7 +407,7 @@ public class ZooStore<T> implements TStore<T> {
     verifyReserved(tid);
     
     try {
-      byte[] data = zk.getData(getTXPath(tid) + "/prop_" + prop, null);
+      byte[] data = curator.getData(getTXPath(tid) + "/prop_" + prop, null);
       
       if (data[0] == 'O') {
         byte[] sera = new byte[data.length - 2];
@@ -431,7 +429,7 @@ public class ZooStore<T> implements TStore<T> {
   public List<Long> list() {
     try {
       ArrayList<Long> l = new ArrayList<Long>();
-      List<String> transactions = zk.getChildren(path);
+      List<String> transactions = curator.getChildren(path);
       for (String txid : transactions) {
         l.add(parseTid(txid));
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
index 4587597..345889d 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
@@ -20,9 +20,10 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.accumulo.fate.curator.CuratorCaches;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
 import org.apache.accumulo.fate.curator.CuratorUtil;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.LockID;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
+import org.apache.accumulo.fate.curator.CuratorUtil.LockID;
 import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
@@ -62,7 +63,7 @@ public class ZooLock implements Watcher {
   
   private boolean lockWasAcquired;
   final private String path;
-  protected final IZooReaderWriter zooKeeper;
+  protected final CuratorReaderWriter zooKeeper;
   private String lock;
   private LockWatcher lockWatcher;
   private boolean watchingParent = false;
@@ -73,10 +74,10 @@ public class ZooLock implements Watcher {
   }
   
   public ZooLock(String zookeepers, int timeInMillis, String scheme, byte[] auth, String path) {
-    this(new ZooCache(zookeepers, timeInMillis), ZooReaderWriter.getInstance(zookeepers, timeInMillis, scheme, auth), path);
+    this(new CuratorCaches(zookeepers, timeInMillis), CuratorReaderWriter.getInstance(zookeepers, timeInMillis, scheme, auth), path);
   }
   
-  protected ZooLock(ZooCache zc, IZooReaderWriter zrw, String path) {
+  protected ZooLock(CuratorCaches zc, CuratorReaderWriter zrw, String path) {
     getLockDataZooCache = zc;
     this.path = path;
     zooKeeper = zrw;
@@ -129,7 +130,7 @@ public class ZooLock implements Watcher {
     }
     
     if (asyncLock != null) {
-      zooKeeper.recursiveDelete(path + "/" + asyncLock, NodeMissingPolicy.SKIP);
+      zooKeeper.recursiveDelete(path + "/" + asyncLock);
       asyncLock = null;
     }
     
@@ -281,7 +282,7 @@ public class ZooLock implements Watcher {
     boolean del = false;
     
     if (asyncLock != null) {
-      zooKeeper.recursiveDelete(path + "/" + asyncLock, NodeMissingPolicy.SKIP);
+      zooKeeper.recursiveDelete(path + "/" + asyncLock);
       del = true;
     }
     
@@ -304,7 +305,7 @@ public class ZooLock implements Watcher {
     lock = null;
     lockWatcher = null;
     
-    zooKeeper.recursiveDelete(path + "/" + localLock, NodeMissingPolicy.SKIP);
+    zooKeeper.recursiveDelete(path + "/" + localLock);
     
     localLw.lostLock(LockLossReason.LOCK_DELETED);
   }
@@ -324,7 +325,11 @@ public class ZooLock implements Watcher {
     if (lock == null) {
       throw new IllegalStateException("Lock not held");
     }
-    return new LockID(path, lock, zooKeeper.getZooKeeper().getSessionId());
+    try {
+      return new LockID(path, lock, zooKeeper.getCurator().getZookeeperClient().getZooKeeper().getSessionId());
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
   }
   
   /**
@@ -384,7 +389,7 @@ public class ZooLock implements Watcher {
     return stat != null && stat.getEphemeralOwner() == lid.eid;
   }
   
-  public static boolean isLockHeld(ZooCache zc, LockID lid) {
+  public static boolean isLockHeld(CuratorCaches zc, LockID lid) {
     
     List<ChildData> children = zc.getChildren(lid.path);
     
@@ -416,7 +421,7 @@ public class ZooLock implements Watcher {
     return zk.getData(path + "/" + lockNode, false, null);
   }
   
-  public static ChildData getLockData(org.apache.accumulo.fate.zookeeper.ZooCache zc, String path) {
+  public static ChildData getLockData(org.apache.accumulo.fate.curator.CuratorCaches zc, String path) {
     
     List<ChildData> children = zc.getChildren(path);
     
@@ -436,13 +441,13 @@ public class ZooLock implements Watcher {
     return children.get(0);
   }
   
-  private static ZooCache getLockDataZooCache;
+  private static CuratorCaches getLockDataZooCache;
   
   public static ChildData getLockData(String path) {
     return getLockData(getLockDataZooCache, path);
   }
   
-  public static long getSessionId(ZooCache zc, String path) throws KeeperException, InterruptedException {
+  public static long getSessionId(CuratorCaches zc, String path) throws KeeperException, InterruptedException {
     List<ChildData> children = zc.getChildren(path);
     
     if (children == null || children.size() == 0) {
@@ -459,7 +464,7 @@ public class ZooLock implements Watcher {
     return getSessionId(getLockDataZooCache, path);
   }
   
-  public static void deleteLock(IZooReaderWriter zk, String path) throws InterruptedException, KeeperException {
+  public static void deleteLock(CuratorReaderWriter zk, String path) throws InterruptedException, KeeperException {
     List<String> children;
     
     children = zk.getChildren(path);
@@ -476,11 +481,11 @@ public class ZooLock implements Watcher {
       throw new RuntimeException("Node " + lockNode + " at " + path + " is not a lock node");
     }
     
-    zk.recursiveDelete(path + "/" + lockNode, NodeMissingPolicy.SKIP);
+    zk.recursiveDelete(path + "/" + lockNode);
     
   }
   
-  public static boolean deleteLock(IZooReaderWriter zk, String path, String lockData) throws InterruptedException, KeeperException {
+  public static boolean deleteLock(CuratorReaderWriter zk, String path, String lockData) throws InterruptedException, KeeperException {
     List<String> children;
     
     children = zk.getChildren(path);
@@ -501,7 +506,7 @@ public class ZooLock implements Watcher {
     byte[] data = zk.getData(path + "/" + lockNode, stat);
     
     if (lockData.equals(new String(data))) {
-      zk.recursiveDelete(path + "/" + lockNode, stat.getVersion(), NodeMissingPolicy.FAIL);
+      zk.recursiveDelete(path + "/" + lockNode, stat.getVersion());
       return true;
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java
index f30cda3..bea7ad6 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java
@@ -21,9 +21,9 @@ import java.util.List;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter.NodeExistsPolicy;
 import org.apache.accumulo.fate.zookeeper.DistributedReadWriteLock.QueueLock;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.apache.zookeeper.KeeperException.NotEmptyException;
@@ -34,16 +34,16 @@ public class ZooQueueLock implements QueueLock {
   
   // private static final Logger log = Logger.getLogger(ZooQueueLock.class);
   
-  private IZooReaderWriter zoo;
+  private CuratorReaderWriter zoo;
   private String path;
   private boolean ephemeral;
   
   public ZooQueueLock(String zookeepers, int timeInMillis, String scheme, byte[] auth, String path, boolean ephemeral) throws KeeperException,
       InterruptedException {
-    this(ZooReaderWriter.getRetryingInstance(zookeepers, timeInMillis, scheme, auth), path, ephemeral);
+    this(CuratorReaderWriter.getInstance(zookeepers, timeInMillis, scheme, auth), path, ephemeral);
   }
   
-  protected ZooQueueLock(IZooReaderWriter zrw, String path, boolean ephemeral) {
+  protected ZooQueueLock(CuratorReaderWriter zrw, String path, boolean ephemeral) {
     this.zoo = zrw;
     this.path = path;
     this.ephemeral = ephemeral;
@@ -104,7 +104,7 @@ public class ZooQueueLock implements QueueLock {
   @Override
   public void removeEntry(long entry) {
     try {
-      zoo.recursiveDelete(path + String.format("/%s%010d", PREFIX, entry), NodeMissingPolicy.SKIP);
+      zoo.recursiveDelete(path + String.format("/%s%010d", PREFIX, entry));
       try {
         // try to delete the parent if it has no children
         zoo.delete(path, -1);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
deleted file mode 100644
index ab73012..0000000
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.fate.zookeeper;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.AsyncCallback.VoidCallback;
-import org.apache.zookeeper.KeeperException.Code;
-import org.apache.zookeeper.data.Stat;
-
-public class ZooReader implements IZooReader {
-  
-  protected String keepers;
-  protected int timeout;
-  
-  protected ZooKeeper getSession(String keepers, int timeout, String scheme, byte[] auth) {
-    return ZooSession.getSession(keepers, timeout, scheme, auth);
-  }
-  
-  protected ZooKeeper getZooKeeper() {
-    return getSession(keepers, timeout, null, null);
-  }
-  
-  @Override
-  public byte[] getData(String zPath, Stat stat) throws KeeperException, InterruptedException {
-    return getZooKeeper().getData(zPath, false, stat);
-  }
-  
-  @Override
-  public Stat getStatus(String zPath) throws KeeperException, InterruptedException {
-    return getZooKeeper().exists(zPath, false);
-  }
-  
-  @Override
-  public Stat getStatus(String zPath, Watcher watcher) throws KeeperException, InterruptedException {
-    return getZooKeeper().exists(zPath, watcher);
-  }
-  
-  @Override
-  public List<String> getChildren(String zPath) throws KeeperException, InterruptedException {
-    return getZooKeeper().getChildren(zPath, false);
-  }
-  
-  @Override
-  public List<String> getChildren(String zPath, Watcher watcher) throws KeeperException, InterruptedException {
-    return getZooKeeper().getChildren(zPath, watcher);
-  }
-  
-  @Override
-  public boolean exists(String zPath) throws KeeperException, InterruptedException {
-    return getZooKeeper().exists(zPath, false) != null;
-  }
-  
-  @Override
-  public boolean exists(String zPath, Watcher watcher) throws KeeperException, InterruptedException {
-    return getZooKeeper().exists(zPath, watcher) != null;
-  }
-  
-  @Override
-  public void sync(final String path) throws KeeperException, InterruptedException {
-    final AtomicInteger rc = new AtomicInteger();
-    final AtomicBoolean waiter = new AtomicBoolean(false);
-    getZooKeeper().sync(path, new VoidCallback() {
-      @Override
-      public void processResult(int code, String arg1, Object arg2) {
-        rc.set(code);
-        synchronized (waiter) {
-          waiter.set(true);
-          waiter.notifyAll();
-        }
-      }}, null);
-    synchronized (waiter) {
-      while (!waiter.get())
-        waiter.wait();
-    }
-    Code code = Code.get(rc.get());
-    if (code != KeeperException.Code.OK) {
-      throw KeeperException.create(code);
-    }
-  }  
-  
-  public ZooReader(String keepers, int timeout) {
-    this.keepers = keepers;
-    this.timeout = timeout;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
deleted file mode 100644
index 7800ec0..0000000
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * 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.fate.zookeeper;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.security.SecurityPermission;
-import java.util.List;
-
-import org.apache.accumulo.fate.util.UtilWaitThread;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
-import org.apache.log4j.Logger;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.KeeperException.BadVersionException;
-import org.apache.zookeeper.KeeperException.NodeExistsException;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.data.ACL;
-import org.apache.zookeeper.data.Stat;
-
-public class ZooReaderWriter extends ZooReader implements IZooReaderWriter {
-  
-  private static SecurityPermission ZOOWRITER_PERMISSION = new SecurityPermission("zookeeperWriterPermission");
-  
-  private static ZooReaderWriter instance = null;
-  private static IZooReaderWriter retryingInstance = null;
-  private final String scheme;
-  private final byte[] auth;
-  
-  @Override
-  public ZooKeeper getZooKeeper() {
-    SecurityManager sm = System.getSecurityManager();
-    if (sm != null) {
-      sm.checkPermission(ZOOWRITER_PERMISSION);
-    }
-    return getSession(keepers, timeout, scheme, auth);
-  }
-  
-  public ZooReaderWriter(String string, int timeInMillis, String scheme, byte[] auth) {
-    super(string, timeInMillis);
-    this.scheme = scheme;
-    this.auth = auth;
-  }
-  
-  @Override
-  public void recursiveDelete(String zPath, NodeMissingPolicy policy) throws KeeperException, InterruptedException {
-    ZooUtil.recursiveDelete(getZooKeeper(), zPath, policy);
-  }
-  
-  @Override
-  public void recursiveDelete(String zPath, int version, NodeMissingPolicy policy) throws KeeperException, InterruptedException {
-    ZooUtil.recursiveDelete(getZooKeeper(), zPath, version, policy);
-  }
-  
-  /**
-   * Create a persistent node with the default ACL
-   * 
-   * @return true if the node was created or altered; false if it was skipped
-   */
-  @Override
-  public boolean putPersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException {
-    return ZooUtil.putPersistentData(getZooKeeper(), zPath, data, policy);
-  }
-  
-  @Override
-  public boolean putPrivatePersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException {
-    return ZooUtil.putPrivatePersistentData(getZooKeeper(), zPath, data, policy);
-  }
-  
-  @Override
-  public void putPersistentData(String zPath, byte[] data, int version, NodeExistsPolicy policy) throws KeeperException, InterruptedException {
-    ZooUtil.putPersistentData(getZooKeeper(), zPath, data, version, policy);
-  }
-  
-  @Override
-  public String putPersistentSequential(String zPath, byte[] data) throws KeeperException, InterruptedException {
-    return ZooUtil.putPersistentSequential(getZooKeeper(), zPath, data);
-  }
-  
-  @Override
-  public String putEphemeralData(String zPath, byte[] data) throws KeeperException, InterruptedException {
-    return ZooUtil.putEphemeralData(getZooKeeper(), zPath, data);
-  }
-  
-  @Override
-  public String putEphemeralSequential(String zPath, byte[] data) throws KeeperException, InterruptedException {
-    return ZooUtil.putEphemeralSequential(getZooKeeper(), zPath, data);
-  }
-  
-  @Override
-  public void recursiveCopyPersistent(String source, String destination, NodeExistsPolicy policy) throws KeeperException, InterruptedException {
-    ZooUtil.recursiveCopyPersistent(getZooKeeper(), source, destination, policy);
-  }
-  
-  @Override
-  public void delete(String path, int version) throws InterruptedException, KeeperException {
-    getZooKeeper().delete(path, version);
-  }
-  
-  public interface Mutator {
-    byte[] mutate(byte[] currentValue) throws Exception;
-  }
-  
-  @Override
-  public byte[] mutate(String zPath, byte[] createValue, List<ACL> acl, Mutator mutator) throws Exception {
-    if (createValue != null) {
-      try {
-        getZooKeeper().create(zPath, createValue, acl, CreateMode.PERSISTENT);
-        return createValue;
-      } catch (NodeExistsException ex) {
-        // expected
-      }
-    }
-    do {
-      Stat stat = new Stat();
-      byte[] data = getZooKeeper().getData(zPath, false, stat);
-      data = mutator.mutate(data);
-      if (data == null)
-        return data;
-      try {
-        getZooKeeper().setData(zPath, data, stat.getVersion());
-        return data;
-      } catch (BadVersionException ex) {
-        //
-      }
-    } while (true);
-  }
-  
-  public static synchronized ZooReaderWriter getInstance(String zookeepers, int timeInMillis, String scheme, byte[] auth) {
-    if (instance == null)
-      instance = new ZooReaderWriter(zookeepers, timeInMillis, scheme, auth);
-    return instance;
-  }
-  
-  /**
-   * get an instance that retries when zookeeper connection errors occur
-   * 
-   * @return an instance that retries when Zookeeper connection errors occur.
-   */
-  public static synchronized IZooReaderWriter getRetryingInstance(String zookeepers, int timeInMillis, String scheme, byte[] auth) {
-    
-    if (retryingInstance == null) {
-      final IZooReaderWriter inst = getInstance(zookeepers, timeInMillis, scheme, auth);
-      
-      InvocationHandler ih = new InvocationHandler() {
-        @Override
-        public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
-          long retryTime = 250;
-          while (true) {
-            try {
-              return method.invoke(inst, args);
-            } catch (InvocationTargetException e) {
-              if (e.getCause() instanceof KeeperException.ConnectionLossException) {
-                Logger.getLogger(ZooReaderWriter.class).warn("Error connecting to zookeeper, will retry in " + retryTime, e.getCause());
-                UtilWaitThread.sleep(retryTime);
-                retryTime = Math.min(5000, retryTime + 250);
-              } else {
-                throw e.getCause();
-              }
-            }
-          }
-        }
-      };
-      
-      retryingInstance = (IZooReaderWriter) Proxy.newProxyInstance(ZooReaderWriter.class.getClassLoader(), new Class[] {IZooReaderWriter.class}, ih);
-    }
-    
-    return retryingInstance;
-  }
-  
-  @Override
-  public boolean isLockHeld(ZooUtil.LockID lockID) throws KeeperException, InterruptedException {
-    return ZooUtil.isLockHeld(getZooKeeper(), lockID);
-  }
-  
-  @Override
-  public void mkdirs(String path) throws KeeperException, InterruptedException {
-    if (path.equals(""))
-      return;
-    if (!path.startsWith("/"))
-      throw new IllegalArgumentException(path + "does not start with /");
-    if (getZooKeeper().exists(path, false) != null)
-      return;
-    String parent = path.substring(0, path.lastIndexOf("/"));
-    mkdirs(parent);
-    putPersistentData(path, new byte[] {}, NodeExistsPolicy.SKIP);
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
index e938e88..3b07eb4 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
@@ -16,8 +16,8 @@
  */
 package org.apache.accumulo.fate.zookeeper;
 
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter.NodeExistsPolicy;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NoNodeException;
@@ -26,7 +26,7 @@ import org.apache.zookeeper.data.Stat;
 
 public class ZooReservation {
   
-  public static boolean attempt(IZooReaderWriter zk, String path, String reservationID, String debugInfo) throws KeeperException, InterruptedException {
+  public static boolean attempt(CuratorReaderWriter zk, String path, String reservationID, String debugInfo) throws KeeperException, InterruptedException {
     if (reservationID.contains(":"))
       throw new IllegalArgumentException();
     
@@ -51,7 +51,7 @@ public class ZooReservation {
     
   }
   
-  public static void release(IZooReaderWriter zk, String path, String reservationID) throws KeeperException, InterruptedException {
+  public static void release(CuratorReaderWriter zk, String path, String reservationID) throws KeeperException, InterruptedException {
     Stat stat = new Stat();
     byte[] zooData;
     
@@ -69,7 +69,7 @@ public class ZooReservation {
       throw new IllegalStateException("Tried to release reservation " + path + " with data mismatch " + new String(reservationID) + " " + new String(zooData));
     }
     
-    zk.recursiveDelete(path, stat.getVersion(), NodeMissingPolicy.SKIP);
+    zk.recursiveDelete(path, stat.getVersion());
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
deleted file mode 100644
index 4854d49..0000000
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.fate.zookeeper;
-
-import java.io.IOException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-import org.apache.accumulo.fate.util.UtilWaitThread;
-import org.apache.log4j.Logger;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.Watcher.Event.KeeperState;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.ZooKeeper.States;
-
-class ZooSession {
-  
-  private static final Logger log = Logger.getLogger(ZooSession.class);
-  
-  private static class ZooSessionInfo {
-    public ZooSessionInfo(ZooKeeper zooKeeper, ZooWatcher watcher) {
-      this.zooKeeper = zooKeeper;
-    }
-    
-    ZooKeeper zooKeeper;
-  }
-  
-  private static Map<String,ZooSessionInfo> sessions = new HashMap<String,ZooSessionInfo>();
-  
-  private static String sessionKey(String keepers, int timeout, String scheme, byte[] auth) {
-    return keepers + ":" + timeout + ":" + (scheme == null ? "" : scheme) + ":" + (auth == null ? "" : new String(auth));
-  }
-  
-  private static class ZooWatcher implements Watcher {
-    
-    private HashSet<Watcher> watchers = new HashSet<Watcher>();
-    
-    public void process(WatchedEvent event) {
-      // copy the watchers, in case the callback adds() more Watchers
-      // otherwise we get a ConcurrentModificationException
-      Collection<Watcher> watcherCopy = new ArrayList<Watcher>(watchers);
-      
-      for (Watcher watcher : watcherCopy) {
-        watcher.process(event);
-      }
-      
-      if (event.getState() == KeeperState.Expired) {
-        log.debug("Session expired, state of current session : " + event.getState());
-      }
-    }
-    
-  }
-  
-  public static ZooKeeper connect(String host, int timeout, String scheme, byte[] auth, Watcher watcher) {
-    final int TIME_BETWEEN_CONNECT_CHECKS_MS = 100;
-    final int TOTAL_CONNECT_TIME_WAIT_MS = 10 * 1000;
-    boolean tryAgain = true;
-    int sleepTime = 100;
-    ZooKeeper zooKeeper = null;
-    
-    long startTime = System.currentTimeMillis();
-
-    while (tryAgain) {
-      try {
-        zooKeeper = new ZooKeeper(host, timeout, watcher);
-        // it may take some time to get connected to zookeeper if some of the servers are down
-        for (int i = 0; i < TOTAL_CONNECT_TIME_WAIT_MS / TIME_BETWEEN_CONNECT_CHECKS_MS && tryAgain; i++) {
-          if (zooKeeper.getState().equals(States.CONNECTED)) {
-            if (auth != null)
-              zooKeeper.addAuthInfo(scheme, auth);
-            tryAgain = false;
-          } else
-            UtilWaitThread.sleep(TIME_BETWEEN_CONNECT_CHECKS_MS);
-        }
-        
-        if (System.currentTimeMillis() - startTime > 2 * timeout)
-          throw new RuntimeException("Failed to connect to zookeeper (" + host + ") within 2x zookeeper timeout period " + timeout);
-
-      } catch (UnknownHostException uhe) {
-        // do not expect to recover from this
-        log.warn(uhe.getClass().getName() + " : " + uhe.getMessage());
-        throw new RuntimeException(uhe);
-      } catch (IOException e) {
-        log.warn("Connection to zooKeeper failed, will try again in " + String.format("%.2f secs", sleepTime / 1000.0), e);
-      } finally {
-        if (tryAgain && zooKeeper != null)
-          try {
-            zooKeeper.close();
-            zooKeeper = null;
-          } catch (InterruptedException e) {
-            log.warn("interrupted", e);
-          }
-      }
-      
-      if (tryAgain) {
-        UtilWaitThread.sleep(sleepTime);
-        if (sleepTime < 10000)
-          sleepTime = (int) (sleepTime + sleepTime * Math.random());
-      }
-    }
-    
-    return zooKeeper;
-  }
-  
-  public static synchronized ZooKeeper getSession(String zooKeepers, int timeout) {
-    return getSession(zooKeepers, timeout, null, null);
-  }
-  
-  public static synchronized ZooKeeper getSession(String zooKeepers, int timeout, String scheme, byte[] auth) {
-    
-    String sessionKey = sessionKey(zooKeepers, timeout, scheme, auth);
-    
-    // a read-only session can use a session with authorizations, so cache a copy for it w/out auths
-    String readOnlySessionKey = sessionKey(zooKeepers, timeout, null, null);
-    
-    ZooSessionInfo zsi = sessions.get(sessionKey);
-    if (zsi != null && zsi.zooKeeper.getState() == States.CLOSED) {
-      if (auth != null && sessions.get(readOnlySessionKey) == zsi)
-        sessions.remove(readOnlySessionKey);
-      zsi = null;
-      sessions.remove(sessionKey);
-    }
-    
-    if (zsi == null) {
-      ZooWatcher watcher = new ZooWatcher();
-      log.debug("Connecting to " + zooKeepers + " with timeout " + timeout + " with auth");
-      zsi = new ZooSessionInfo(connect(zooKeepers, timeout, scheme, auth, watcher), watcher);
-      sessions.put(sessionKey, zsi);
-      if (auth != null && !sessions.containsKey(readOnlySessionKey))
-        sessions.put(readOnlySessionKey, zsi);
-    }
-    return zsi.zooKeeper;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 61a6a92..da082a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,7 +109,7 @@
     <!-- used for filtering the java source with the current version -->
     <accumulo.release.version>${project.version}</accumulo.release.version>
     <!-- ZooKeeper 3.4.x works also, but we're not using new features yet; this ensures 3.3.x compatibility. -->
-    <curator.version>2.0.1-incubating</curator.version>
+    <curator.version>2.1.0-incubating</curator.version>
     <!-- the maven-release-plugin makes this recommendation, due to plugin bugs -->
     <maven.min-version>3.0.4</maven.min-version>
     <powermock.version>1.5</powermock.version>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/Accumulo.java b/server/src/main/java/org/apache/accumulo/server/Accumulo.java
index 87b47cb..1de64a9 100644
--- a/server/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/src/main/java/org/apache/accumulo/server/Accumulo.java
@@ -32,9 +32,9 @@ import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.core.util.Version;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.conf.ServerConfiguration;
+import org.apache.accumulo.server.curator.CuratorReaderWriter;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.util.time.SimpleTimer;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
 import org.apache.log4j.Logger;
@@ -74,7 +74,7 @@ public class Accumulo {
   
   public static void enableTracing(String address, String application) {
     try {
-      DistributedTrace.enable(HdfsZooInstance.getInstance(), ZooReaderWriter.getInstance(), application, address);
+      DistributedTrace.enable(HdfsZooInstance.getInstance(), CuratorReaderWriter.getInstance(), application, address);
     } catch (Exception ex) {
       log.error("creating remote sink for trace spans", ex);
     }
@@ -185,7 +185,7 @@ public class Accumulo {
     log.info("Attempting to talk to zookeeper");
     while (true) {
       try {
-        ZooReaderWriter.getInstance().getChildren(Constants.ZROOT);
+        CuratorReaderWriter.getInstance().getChildren(Constants.ZROOT);
         break;
       } catch (InterruptedException e) {
         // ignored

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java b/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
index 3e79711..6495e55 100644
--- a/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
+++ b/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
@@ -40,7 +40,7 @@ import org.apache.accumulo.core.util.RootTable;
 import org.apache.accumulo.core.util.StringUtil;
 import org.apache.accumulo.core.util.TextUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.accumulo.server.ServerConstants;
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.zookeeper.ZooLock;
@@ -65,7 +65,7 @@ public class HdfsZooInstance implements Instance {
   
   private HdfsZooInstance() {
     AccumuloConfiguration acuConf = ServerConfiguration.getSiteConfiguration();
-    zooCache = new ZooCache(acuConf.get(Property.INSTANCE_ZK_HOST), (int) acuConf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
+    zooCache = new CuratorCaches(acuConf.get(Property.INSTANCE_ZK_HOST), (int) acuConf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
   }
   
   private static HdfsZooInstance cachedHdfsZooInstance = null;
@@ -76,7 +76,7 @@ public class HdfsZooInstance implements Instance {
     return cachedHdfsZooInstance;
   }
   
-  private static ZooCache zooCache;
+  private static CuratorCaches zooCache;
   private static String instanceId = null;
   private static final Logger log = Logger.getLogger(HdfsZooInstance.class);
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java b/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
index d0c3ece..3a9b73b 100644
--- a/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
+++ b/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
@@ -30,8 +30,8 @@ import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.curator.CuratorCaches;
 import org.apache.accumulo.fate.curator.CuratorUtil;
-import org.apache.accumulo.fate.zookeeper.ZooCache;
 import org.apache.accumulo.server.ServerConstants;
 import org.apache.accumulo.server.client.HdfsZooInstance.AccumuloNotInitializedException;
 import org.apache.curator.framework.recipes.cache.ChildData;
@@ -43,7 +43,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
   private final AccumuloConfiguration parent;
   private static ZooConfiguration instance = null;
   private static String instanceId = null;
-  private static ZooCache propCache = null;
+  private static CuratorCaches propCache = null;
   private final Map<String,String> fixedProps = Collections.synchronizedMap(new HashMap<String,String>());
   
   private ZooConfiguration(AccumuloConfiguration parent) {
@@ -52,7 +52,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
   
   synchronized public static ZooConfiguration getInstance(Instance inst, AccumuloConfiguration parent) {
     if (instance == null) {
-      propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut());
+      propCache = new CuratorCaches(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut());
       instance = new ZooConfiguration(parent);
       instanceId = inst.getInstanceID();
       // Sets up a child cache listener for all properties
@@ -63,7 +63,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
   
   synchronized public static ZooConfiguration getInstance(AccumuloConfiguration parent) {
     if (instance == null) {
-      propCache = new ZooCache(parent.get(Property.INSTANCE_ZK_HOST), (int) parent.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
+      propCache = new CuratorCaches(parent.get(Property.INSTANCE_ZK_HOST), (int) parent.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
       instance = new ZooConfiguration(parent);
       @SuppressWarnings("deprecation")
       String deprecatedInstanceIdFromHdfs = ZooKeeperInstance.getInstanceIDFromHdfs(ServerConstants.getInstanceIdLocation());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java b/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java
index 03cbde3..4673357 100644
--- a/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java
+++ b/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java
@@ -32,6 +32,7 @@ import org.apache.accumulo.core.util.ColumnFQ;
 import org.apache.accumulo.core.util.MetadataTable;
 import org.apache.accumulo.core.util.MetadataTable.DataFileValue;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.curator.CuratorUtil;
 import org.apache.accumulo.fate.zookeeper.TransactionWatcher.Arbitrator;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.zookeeper.TransactionWatcher.ZooArbitrator;
@@ -247,7 +248,7 @@ public class MetadataConstraints implements Constraint {
           String lockId = new String(columnUpdate.getValue());
           
           try {
-            lockHeld = ZooLock.isLockHeld(zooCache, new ZooUtil.LockID(zooRoot, lockId));
+            lockHeld = ZooLock.isLockHeld(zooCache, new CuratorUtil.LockID(zooRoot, lockId));
           } catch (Exception e) {
             log.debug("Failed to verify lock was held " + lockId + " " + e.getMessage());
           }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
index dd27193..73492c8 100644
--- a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
+++ b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
@@ -25,10 +25,9 @@ import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.AdminUtil;
 import org.apache.accumulo.fate.ZooStore;
-import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.server.client.HdfsZooInstance;
+import org.apache.accumulo.server.curator.CuratorReaderWriter;
 import org.apache.accumulo.server.master.Master;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 
 import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
@@ -73,7 +72,7 @@ public class Admin {
     Instance instance = HdfsZooInstance.getInstance();
     String path = ZooUtil.getRoot(instance) + Constants.ZFATE;
     String masterPath = ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK;
-    IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
+    CuratorReaderWriter zk = CuratorReaderWriter.getInstance();
     ZooStore<Master> zs = new ZooStore<Master>(path, zk);
     
     if (jc.getParsedCommand().equals("fail")) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java b/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
index d88a85c..0dbc41f 100644
--- a/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
+++ b/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
@@ -39,12 +39,12 @@ import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client;
 import org.apache.accumulo.core.util.ThriftUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.server.ServerConstants;
+import org.apache.accumulo.server.curator.CuratorReaderWriter;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.security.SecurityConstants;
 import org.apache.accumulo.server.util.AddressUtil;
 import org.apache.accumulo.server.util.MetadataTable;
 import org.apache.accumulo.server.util.MetadataTable.LogEntry;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.trace.instrument.Span;
 import org.apache.accumulo.trace.instrument.Trace;
 import org.apache.accumulo.trace.instrument.Tracer;
@@ -118,7 +118,7 @@ public class GarbageCollectWriteAheadLogs {
   boolean holdsLock(InetSocketAddress addr) {
     try {
       String zpath = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + org.apache.accumulo.core.util.AddressUtil.toString(addr);
-      List<String> children = ZooReaderWriter.getInstance().getChildren(zpath);
+      List<String> children = CuratorReaderWriter.getInstance().getChildren(zpath);
       return !(children == null || children.isEmpty());
     } catch (KeeperException.NoNodeException ex) {
       return false;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java b/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
index 6525512..16a5b07 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.master;
 
-import static org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy.SKIP;
 
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
@@ -42,6 +41,7 @@ import org.apache.accumulo.core.util.ServerServices;
 import org.apache.accumulo.core.util.ThriftUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.curator.CuratorUtil;
+import org.apache.accumulo.server.curator.CuratorReaderWriter;
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.security.SecurityConstants;
 import org.apache.accumulo.server.util.AddressUtil;
@@ -49,7 +49,6 @@ import org.apache.accumulo.server.util.Halt;
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.server.zookeeper.ZooCache;
 import org.apache.accumulo.server.zookeeper.ZooLock;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.trace.instrument.Tracer;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.recipes.cache.ChildData;
@@ -395,7 +394,7 @@ public class LiveTServerSet {
     log.info("Removing zookeeper lock for " + server);
     String zpath = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + server.hostPort();
     try {
-      ZooReaderWriter.getRetryingInstance().recursiveDelete(zpath, SKIP);
+      CuratorReaderWriter.getInstance().recursiveDelete(zpath);
     } catch (Exception e) {
       String msg = "error removing tablet server lock";
       log.fatal(msg, e);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e261f8f4/server/src/main/java/org/apache/accumulo/server/master/Master.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/Master.java b/server/src/main/java/org/apache/accumulo/server/master/Master.java
index 7011320..f5b5530 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/Master.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/Master.java
@@ -80,15 +80,14 @@ import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.AgeOffStore;
 import org.apache.accumulo.fate.Fate;
 import org.apache.accumulo.fate.TStore.TStatus;
-import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter.Mutator;
+import org.apache.accumulo.fate.curator.CuratorReaderWriter.NodeExistsPolicy;
 import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
-import org.apache.accumulo.fate.zookeeper.ZooReaderWriter.Mutator;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
-import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
 import org.apache.accumulo.server.Accumulo;
 import org.apache.accumulo.server.ServerConstants;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.conf.ServerConfiguration;
+import org.apache.accumulo.server.curator.CuratorReaderWriter;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.fs.VolumeManagerImpl;
 import org.apache.accumulo.server.master.LiveTServerSet.TServerConnection;
@@ -138,7 +137,6 @@ import org.apache.accumulo.server.util.TablePropUtil;
 import org.apache.accumulo.server.util.TabletIterator.TabletDeletedException;
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.server.zookeeper.ZooLock;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.accumulo.trace.instrument.thrift.TraceWrap;
 import org.apache.accumulo.trace.thrift.TInfo;
@@ -258,10 +256,10 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
       try {
         log.info("Upgrading zookeeper");
         
-        IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+        CuratorReaderWriter zoo = CuratorReaderWriter.getInstance();
         
-        zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/loggers", NodeMissingPolicy.SKIP);
-        zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/dead/loggers", NodeMissingPolicy.SKIP);
+        zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/loggers");
+        zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/dead/loggers");
         
         zoo.putPersistentData(ZooUtil.getRoot(instance) + Constants.ZRECOVERY, new byte[] {'0'}, NodeExistsPolicy.SKIP);
         
@@ -474,10 +472,10 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
       String zTablePath = Constants.ZROOT + "/" + getConfiguration().getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId
           + Constants.ZTABLE_FLUSH_ID;
       
-      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+      CuratorReaderWriter zoo = CuratorReaderWriter.getInstance();
       byte fid[];
       try {
-        fid = zoo.mutate(zTablePath, null, null, new Mutator() {
+        fid = zoo.mutate(zTablePath, null, false, new Mutator() {
           @Override
           public byte[] mutate(byte[] currentValue) throws Exception {
             long flushID = Long.parseLong(new String(currentValue));
@@ -1036,9 +1034,9 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
     synchronized (mergeLock) {
       try {
         String path = ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + tableId.toString() + "/merge";
-        if (!ZooReaderWriter.getInstance().exists(path))
+        if (!CuratorReaderWriter.getInstance().exists(path))
           return new MergeInfo();
-        byte[] data = ZooReaderWriter.getInstance().getData(path, new Stat());
+        byte[] data = CuratorReaderWriter.getInstance().getData(path, new Stat());
         DataInputBuffer in = new DataInputBuffer();
         in.reset(data, data.length);
         MergeInfo info = new MergeInfo();
@@ -1059,7 +1057,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
       String path = ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + info.getExtent().getTableId().toString() + "/merge";
       info.setState(state);
       if (state.equals(MergeState.NONE)) {
-        ZooReaderWriter.getInstance().recursiveDelete(path, NodeMissingPolicy.SKIP);
+        CuratorReaderWriter.getInstance().recursiveDelete(path);
       } else {
         DataOutputBuffer out = new DataOutputBuffer();
         try {
@@ -1067,8 +1065,8 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         } catch (IOException ex) {
           throw new RuntimeException("Unlikely", ex);
         }
-        ZooReaderWriter.getInstance().putPersistentData(path, out.getData(),
-            state.equals(MergeState.STARTED) ? ZooUtil.NodeExistsPolicy.FAIL : ZooUtil.NodeExistsPolicy.OVERWRITE);
+        CuratorReaderWriter.getInstance().putPersistentData(path, out.getData(),
+            state.equals(MergeState.STARTED) ? CuratorReaderWriter.NodeExistsPolicy.FAIL : CuratorReaderWriter.NodeExistsPolicy.OVERWRITE);
       }
       mergeLock.notifyAll();
     }
@@ -1078,7 +1076,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
   public void clearMergeState(Text tableId) throws IOException, KeeperException, InterruptedException {
     synchronized (mergeLock) {
       String path = ZooUtil.getRoot(instance.getInstanceID()) + Constants.ZTABLES + "/" + tableId.toString() + "/merge";
-      ZooReaderWriter.getInstance().recursiveDelete(path, NodeMissingPolicy.SKIP);
+      CuratorReaderWriter.getInstance().recursiveDelete(path);
       mergeLock.notifyAll();
     }
     nextEvent.event("Merge state of %s cleared", tableId);
@@ -1086,7 +1084,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
   
   private void setMasterGoalState(MasterGoalState state) {
     try {
-      ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, state.name().getBytes(),
+      CuratorReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, state.name().getBytes(),
           NodeExistsPolicy.OVERWRITE);
     } catch (Exception ex) {
       log.error("Unable to set master goal state in zookeeper");
@@ -1096,7 +1094,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
   MasterGoalState getMasterGoalState() {
     while (true)
       try {
-        byte[] data = ZooReaderWriter.getInstance().getData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, null);
+        byte[] data = CuratorReaderWriter.getInstance().getData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, null);
         return MasterGoalState.valueOf(new String(data));
       } catch (Exception e) {
         log.error("Problem getting real goal state: " + e);
@@ -1473,7 +1471,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
     // TODO: add shutdown for fate object - ACCUMULO-1307
     try {
       final AgeOffStore<Master> store = new AgeOffStore<Master>(new org.apache.accumulo.fate.ZooStore<Master>(ZooUtil.getRoot(instance) + Constants.ZFATE,
-          ZooReaderWriter.getRetryingInstance()), 1000 * 60 * 60 * 8);
+          CuratorReaderWriter.getInstance()), 1000 * 60 * 60 * 8);
       
       int threads = this.getConfiguration().getConfiguration().getCount(Property.MASTER_FATE_THREADPOOL_SIZE);
       
@@ -1492,13 +1490,13 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
       throw new IOException(e);
     }
     
-    ZooReaderWriter.getInstance().getChildren(zroot + Constants.ZRECOVERY, new Watcher() {
+    CuratorReaderWriter.getInstance().getChildren(zroot + Constants.ZRECOVERY, new Watcher() {
       @Override
       public void process(WatchedEvent event) {
         nextEvent.event("Noticed recovery changes", event.getType());
         try {
           // watcher only fires once, add it back
-          ZooReaderWriter.getInstance().getChildren(zroot + Constants.ZRECOVERY, this);
+          CuratorReaderWriter.getInstance().getChildren(zroot + Constants.ZRECOVERY, this);
         } catch (Exception e) {
           log.error("Failed to add log recovery watcher back", e);
         }


Mime
View raw message