Index: shims/ivy.xml
===================================================================
--- shims/ivy.xml (revision 1300276)
+++ shims/ivy.xml (working copy)
@@ -29,6 +29,7 @@
+
@@ -41,7 +42,9 @@
+ transitive="false"/>
+
+
Index: shims/src/test/org/apache/hadoop/hive/thrift/TestZooKeeperTokenStore.java
===================================================================
--- shims/src/test/org/apache/hadoop/hive/thrift/TestZooKeeperTokenStore.java (revision 1300276)
+++ shims/src/test/org/apache/hadoop/hive/thrift/TestZooKeeperTokenStore.java (working copy)
@@ -39,6 +39,8 @@
private MiniZooKeeperCluster zkCluster = null;
private ZooKeeper zkClient = null;
+ private int zkPort = -1;
+ private ZooKeeperTokenStore ts;
@Override
protected void setUp() throws Exception {
@@ -47,14 +49,17 @@
throw new IOException("Cluster already running");
}
this.zkCluster = new MiniZooKeeperCluster();
- this.zkCluster.startup(zkDataDir);
+ this.zkPort = this.zkCluster.startup(zkDataDir);
this.zkClient = new ZooKeeper("localhost:"
- + this.zkCluster.getClientPort(), 300, null);
+ + zkPort, 300, null);
}
@Override
protected void tearDown() throws Exception {
this.zkClient.close();
+ if (ts != null) {
+ ts.close();
+ }
this.zkCluster.shutdown();
this.zkCluster = null;
}
@@ -63,7 +68,7 @@
Configuration conf = new Configuration();
conf.set(
HadoopThriftAuthBridge20S.Server.DELEGATION_TOKEN_STORE_ZK_CONNECT_STR,
- "localhost:" + this.zkCluster.getClientPort());
+ "localhost:" + this.zkPort);
conf.set(
HadoopThriftAuthBridge20S.Server.DELEGATION_TOKEN_STORE_ZK_ZNODE,
zkPath);
@@ -72,7 +77,7 @@
public void testTokenStorage() throws Exception {
String ZK_PATH = "/zktokenstore-testTokenStorage";
- ZooKeeperTokenStore ts = new ZooKeeperTokenStore();
+ ts = new ZooKeeperTokenStore();
ts.setConf(createConf(ZK_PATH));
int keySeq = ts.addMasterKey("key1Data");
@@ -124,7 +129,7 @@
HadoopThriftAuthBridge20S.Server.DELEGATION_TOKEN_STORE_ZK_ACL,
"ip:127.0.0.1:r");
- ZooKeeperTokenStore ts = new ZooKeeperTokenStore();
+ ts = new ZooKeeperTokenStore();
try {
ts.setConf(conf);
fail("expected ACL exception");
@@ -145,7 +150,7 @@
List aclList = ZooKeeperTokenStore.parseACLs(aclString);
assertEquals(1, aclList.size());
- ZooKeeperTokenStore ts = new ZooKeeperTokenStore();
+ ts = new ZooKeeperTokenStore();
try {
ts.setConf(conf);
fail("expected ACL exception");
@@ -161,7 +166,7 @@
conf.set(
HadoopThriftAuthBridge20S.Server.DELEGATION_TOKEN_STORE_ZK_ACL,
"world:anyone:cdrwa,ip:127.0.0.1:cdrwa");
- ZooKeeperTokenStore ts = new ZooKeeperTokenStore();
+ ts = new ZooKeeperTokenStore();
ts.setConf(conf);
List acl = zkClient.getACL(ZK_PATH, new Stat());
assertEquals(2, acl.size());
Index: shims/src/common-secure/java/org/apache/hadoop/hive/thrift/ZooKeeperTokenStore.java
===================================================================
--- shims/src/common-secure/java/org/apache/hadoop/hive/thrift/ZooKeeperTokenStore.java (revision 1300276)
+++ shims/src/common-secure/java/org/apache/hadoop/hive/thrift/ZooKeeperTokenStore.java (working copy)
@@ -58,7 +58,6 @@
private final int zkSessionTimeout = 3000;
private List newNodeAcl = Ids.OPEN_ACL_UNSAFE;
-
private class ZooKeeperWatcher implements Watcher {
public void process(org.apache.zookeeper.WatchedEvent event) {
LOGGER.info(event.toString());
@@ -199,8 +198,8 @@
LOGGER.warn("Failed to close existing session.", ex);
}
}
+ ZooKeeper zk = getSession();
- ZooKeeper zk = getSession();
try {
ensurePath(zk, rootNode + NODE_KEYS, newNodeAcl);
ensurePath(zk, rootNode + NODE_TOKENS, newNodeAcl);
@@ -400,4 +399,15 @@
return result;
}
+ @Override
+ public void close() throws IOException {
+ if (this.zkSession != null) {
+ try {
+ this.zkSession.close();
+ } catch (InterruptedException ex) {
+ LOGGER.warn("Failed to close existing session.", ex);
+ }
+ }
+ }
+
}
Index: shims/src/common-secure/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java
===================================================================
--- shims/src/common-secure/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java (revision 1300276)
+++ shims/src/common-secure/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java (working copy)
@@ -18,6 +18,7 @@
package org.apache.hadoop.hive.thrift;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -101,4 +102,9 @@
return result;
}
+ @Override
+ public void close() throws IOException {
+ //no-op
+ }
+
}
Index: shims/src/common-secure/java/org/apache/hadoop/hive/thrift/DelegationTokenStore.java
===================================================================
--- shims/src/common-secure/java/org/apache/hadoop/hive/thrift/DelegationTokenStore.java (revision 1300276)
+++ shims/src/common-secure/java/org/apache/hadoop/hive/thrift/DelegationTokenStore.java (working copy)
@@ -17,6 +17,7 @@
*/
package org.apache.hadoop.hive.thrift;
+import java.io.Closeable;
import java.util.List;
import org.apache.hadoop.conf.Configurable;
@@ -27,7 +28,7 @@
* storage for load balancing and high availability (for example using ZooKeeper).
* Internal, store specific errors are translated into {@link TokenStoreException}.
*/
-public interface DelegationTokenStore extends Configurable {
+public interface DelegationTokenStore extends Configurable, Closeable {
/**
* Exception for internal token store errors that typically cannot be handled by the caller.
Index: hbase-handler/ivy.xml
===================================================================
--- hbase-handler/ivy.xml (revision 1300276)
+++ hbase-handler/ivy.xml (working copy)
@@ -49,7 +49,11 @@
+
+
+
Index: hbase-handler/src/test/org/apache/hadoop/hive/hbase/HBaseTestSetup.java
===================================================================
--- hbase-handler/src/test/org/apache/hadoop/hive/hbase/HBaseTestSetup.java (revision 1300276)
+++ hbase-handler/src/test/org/apache/hadoop/hive/hbase/HBaseTestSetup.java (working copy)
@@ -31,10 +31,10 @@
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HConnectionManager;
import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster;
@@ -68,7 +68,7 @@
setUpFixtures(conf);
}
conf.set("hbase.rootdir", hbaseRoot);
- conf.set("hbase.master", hbaseCluster.getHMasterAddress().toString());
+ conf.set("hbase.master", hbaseCluster.getMaster().getServerName().getHostAndPort());
conf.set("hbase.zookeeper.property.clientPort", Integer.toString(zooKeeperPort));
String auxJars = conf.getAuxJars();
auxJars = ((auxJars == null) ? "" : (auxJars + ",")) + "file://"
@@ -94,7 +94,7 @@
hbaseConf.setInt("hbase.regionserver.port", findFreePort());
hbaseConf.setInt("hbase.regionserver.info.port", -1);
hbaseCluster = new MiniHBaseCluster(hbaseConf, NUM_REGIONSERVERS);
- conf.set("hbase.master", hbaseCluster.getHMasterAddress().toString());
+ conf.set("hbase.master", hbaseCluster.getMaster().getServerName().getHostAndPort());
// opening the META table ensures that cluster is running
new HTable(hbaseConf, HConstants.META_TABLE_NAME);
createHBaseTable(hbaseConf);
Index: ivy/ivysettings.xml
===================================================================
--- ivy/ivysettings.xml (revision 1300276)
+++ ivy/ivysettings.xml (working copy)
@@ -32,7 +32,7 @@
-
+
Index: ivy/libraries.properties
===================================================================
--- ivy/libraries.properties (revision 1300276)
+++ ivy/libraries.properties (working copy)
@@ -37,9 +37,9 @@
commons-logging-api.version=1.0.4
commons-pool.version=1.5.4
derby.version=10.4.2.0
-guava.version=r06
-hbase.version=0.89.0-SNAPSHOT
-hbase-test.version=0.89.0-SNAPSHOT
+guava.version=r09
+hbase.version=0.92.0
+jackson.version=1.8.8
javaewah.version=0.3.2
jdo-api.version=2.3-ec
jdom.version=1.1
@@ -54,5 +54,4 @@
slf4j-api.version=1.6.1
slf4j-log4j12.version=1.6.1
velocity.version=1.5
-zookeeper.version=3.3.1
-
+zookeeper.version=3.4.3