hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khorg...@apache.org
Subject [1/2] hive git commit: HIVE-16973 : Fetching of Delegation tokens (Kerberos) for AccumuloStorageHandler fails in HS2 (Josh Elser via Sushanth Sowmyan)
Date Mon, 17 Jul 2017 03:18:13 GMT
Repository: hive
Updated Branches:
  refs/heads/master 93dd75d01 -> 173d98160


http://git-wip-us.apache.org/repos/asf/hive/blob/173d9816/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/TestHiveAccumuloTableOutputFormat.java
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/TestHiveAccumuloTableOutputFormat.java
b/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/TestHiveAccumuloTableOutputFormat.java
index 5fdab28..1dd2b8c 100644
--- a/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/TestHiveAccumuloTableOutputFormat.java
+++ b/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/mr/TestHiveAccumuloTableOutputFormat.java
@@ -109,14 +109,17 @@ public class TestHiveAccumuloTableOutputFormat {
   @Test
   public void testBasicConfiguration() throws IOException, AccumuloSecurityException {
     HiveAccumuloTableOutputFormat outputFormat = Mockito.mock(HiveAccumuloTableOutputFormat.class);
+    HiveAccumuloHelper helper = Mockito.mock(HiveAccumuloHelper.class);
+
+    Mockito.when(outputFormat.getHelper()).thenReturn(helper);
 
     Mockito.doCallRealMethod().when(outputFormat).configureAccumuloOutputFormat(conf);
     Mockito.doCallRealMethod().when(outputFormat).getConnectionParams(conf);
 
     outputFormat.configureAccumuloOutputFormat(conf);
 
-    Mockito.verify(outputFormat).setConnectorInfoWithErrorChecking(conf, user, new PasswordToken(password));
-    Mockito.verify(outputFormat).setZooKeeperInstanceWithErrorChecking(conf, instanceName,
zookeepers, false);
+    Mockito.verify(helper).setOutputFormatConnectorInfo(conf, user, new PasswordToken(password));
+    Mockito.verify(helper).setOutputFormatZooKeeperInstance(conf, instanceName, zookeepers,
false);
     Mockito.verify(outputFormat).setDefaultAccumuloTableName(conf, outputTable);
   }
 
@@ -160,38 +163,32 @@ public class TestHiveAccumuloTableOutputFormat {
     Mockito.when(cnxnParams.getZooKeepers()).thenReturn(zookeepers);
 
     // Stub OutputFormat actions
-    Mockito.when(outputFormat.hasKerberosCredentials(user1)).thenReturn(true);
+    Mockito.when(helper.hasKerberosCredentials(user1)).thenReturn(true);
 
     // Invoke the method
     outputFormat.configureAccumuloOutputFormat(conf);
 
-    // The AccumuloInputFormat methods
-    Mockito.verify(outputFormat).setZooKeeperInstanceWithErrorChecking(conf, instanceName,
zookeepers, true);
-    Mockito.verify(outputFormat).setConnectorInfoWithErrorChecking(conf, user, authToken);
+    // The AccumuloOutputFormat methods
+    Mockito.verify(helper).setOutputFormatZooKeeperInstance(conf, instanceName, zookeepers,
true);
+    Mockito.verify(helper).updateOutputFormatConfWithAccumuloToken(conf, user1, cnxnParams);
     Mockito.verify(outputFormat).setDefaultAccumuloTableName(conf, outputTable);
-
-    // Other methods we expect
-    Mockito.verify(helper).mergeTokenIntoJobConf(conf, hadoopToken);
-
-    // Make sure the token made it into the UGI
-    Collection<Token<? extends TokenIdentifier>> tokens = user1.getTokens();
-    Assert.assertEquals(1, tokens.size());
-    Assert.assertEquals(hadoopToken, tokens.iterator().next());
   }
 
   @Test
   public void testMockInstance() throws IOException, AccumuloSecurityException {
     HiveAccumuloTableOutputFormat outputFormat = Mockito.mock(HiveAccumuloTableOutputFormat.class);
+    HiveAccumuloHelper helper = Mockito.mock(HiveAccumuloHelper.class);
     conf.setBoolean(AccumuloConnectionParameters.USE_MOCK_INSTANCE, true);
     conf.unset(AccumuloConnectionParameters.ZOOKEEPERS);
 
+    Mockito.when(outputFormat.getHelper()).thenReturn(helper);
     Mockito.doCallRealMethod().when(outputFormat).configureAccumuloOutputFormat(conf);
     Mockito.doCallRealMethod().when(outputFormat).getConnectionParams(conf);
 
     outputFormat.configureAccumuloOutputFormat(conf);
 
-    Mockito.verify(outputFormat).setConnectorInfoWithErrorChecking(conf, user, new PasswordToken(password));
-    Mockito.verify(outputFormat).setMockInstanceWithErrorChecking(conf, instanceName);
+    Mockito.verify(helper).setOutputFormatConnectorInfo(conf, user, new PasswordToken(password));
+    Mockito.verify(helper).setOutputFormatMockInstance(conf, instanceName);
     Mockito.verify(outputFormat).setDefaultAccumuloTableName(conf, outputTable);
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/173d9816/itests/hive-unit/pom.xml
----------------------------------------------------------------------
diff --git a/itests/hive-unit/pom.xml b/itests/hive-unit/pom.xml
index ba9d7b9..bf600c2 100644
--- a/itests/hive-unit/pom.xml
+++ b/itests/hive-unit/pom.xml
@@ -399,6 +399,12 @@
       <version>${hamcrest.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>${plexus.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <profiles>

http://git-wip-us.apache.org/repos/asf/hive/blob/173d9816/itests/qtest-accumulo/pom.xml
----------------------------------------------------------------------
diff --git a/itests/qtest-accumulo/pom.xml b/itests/qtest-accumulo/pom.xml
index b7ce283..40d0a74 100644
--- a/itests/qtest-accumulo/pom.xml
+++ b/itests/qtest-accumulo/pom.xml
@@ -38,7 +38,8 @@
     <!-- Profile activation clause for accumulo-tests will flip skip.accumulo.tests to
false
          as long as -DskipAccumuloTests is not specified -->
     <skip.accumulo.tests>true</skip.accumulo.tests>
-    <accumulo-thrift.version>0.9.0</accumulo-thrift.version>
+    <!-- Must correspond with the Accumulo version specified in the pom -->
+    <accumulo-thrift.version>0.9.1</accumulo-thrift.version>
     <test.dfs.mkdir>-mkdir -p</test.dfs.mkdir>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/hive/blob/173d9816/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b6b7b5b..99ba218 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,7 +109,7 @@
     <maven.build-helper.plugin.version>1.8</maven.build-helper.plugin.version>
 
     <!-- Library Dependency Versions -->
-    <accumulo.version>1.6.0</accumulo.version>
+    <accumulo.version>1.7.3</accumulo.version>
     <activemq.version>5.5.0</activemq.version>
     <ant.version>1.9.1</ant.version>
     <antlr.version>3.5.2</antlr.version>
@@ -185,6 +185,7 @@
     <netty.version>4.0.29.Final</netty.version>
     <parquet.version>1.9.0</parquet.version>
     <pig.version>0.16.0</pig.version>
+    <plexus.version>1.5.6</plexus.version>
     <protobuf.version>2.5.0</protobuf.version>
     <stax.version>1.0.1</stax.version>
     <slf4j.version>1.7.10</slf4j.version>


Mime
View raw message