accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [21/50] [abbrv] accumulo git commit: ACCUMULO-3167 Stop using ZooKeeper directly to recover from ConnectionLoss automatically
Date Tue, 02 Dec 2014 20:37:09 GMT
ACCUMULO-3167 Stop using ZooKeeper directly to recover from ConnectionLoss automatically


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

Branch: refs/heads/metrics2
Commit: 8f09ea163ca16e373b6653e738500ad9c60fa4d5
Parents: b0e3008
Author: Josh Elser <elserj@apache.org>
Authored: Sun Nov 23 14:19:14 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Nov 24 18:08:52 2014 -0500

----------------------------------------------------------------------
 .../test/java/org/apache/accumulo/test/VolumeIT.java    | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8f09ea16/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
index 844c250..dc534d5 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
@@ -60,6 +60,7 @@ import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.fate.zookeeper.ZooReader;
 import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
 import org.apache.accumulo.server.ServerConstants;
 import org.apache.accumulo.server.init.Initialize;
@@ -71,7 +72,6 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.RawLocalFileSystem;
 import org.apache.hadoop.io.Text;
-import org.apache.zookeeper.ZooKeeper;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -464,11 +464,10 @@ public class VolumeIT extends ConfigurableMacIT {
     verifyVolumesUsed(tableNames[0], true, v2);
 
     // check that root tablet is not on volume 1
+    ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
     String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers()))
+ RootTable.ZROOT_TABLET_PATH;
-    ZooKeeper zookeeper = new ZooKeeper(cluster.getZooKeepers(), 30000, null);
-    String rootTabletDir = new String(zookeeper.getData(zpath, false, null), UTF_8);
+    String rootTabletDir = new String(zreader.getData(zpath, false, null), UTF_8);
     Assert.assertTrue(rootTabletDir.startsWith(v2.toString()));
-    zookeeper.close();
 
     conn.tableOperations().clone(tableNames[0], tableNames[1], true, new HashMap<String,String>(),
new HashSet<String>());
 
@@ -526,11 +525,10 @@ public class VolumeIT extends ConfigurableMacIT {
     verifyVolumesUsed(tableNames[1], true, v8, v9);
 
     // check that root tablet is not on volume 1 or 2
+    ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
     String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers()))
+ RootTable.ZROOT_TABLET_PATH;
-    ZooKeeper zookeeper = new ZooKeeper(cluster.getZooKeepers(), 30000, null);
-    String rootTabletDir = new String(zookeeper.getData(zpath, false, null), UTF_8);
+    String rootTabletDir = new String(zreader.getData(zpath, false, null), UTF_8);
     Assert.assertTrue(rootTabletDir.startsWith(v8.toString()) || rootTabletDir.startsWith(v9.toString()));
-    zookeeper.close();
 
     getConnector().tableOperations().clone(tableNames[1], tableNames[2], true, new HashMap<String,String>(),
new HashSet<String>());
 


Mime
View raw message