Author: virag
Date: Wed Jan 2 19:58:28 2013
New Revision: 1427984
URL: http://svn.apache.org/viewvc?rev=1427984&view=rev
Log:
OOZIE-1151 HbaseCredentials doesn't use properties from the credentials module
(virag)
Added:
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestCredentials.java
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
oozie/branches/branch-3.3/release-log.txt
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java?rev=1427984&r1=1427983&r2=1427984&view=diff
==============================================================================
---
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
(original)
+++
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
Wed Jan 2 19:58:28 2013
@@ -47,6 +47,8 @@ public class HbaseCredentials extends Cr
try {
// Create configuration using hbase-site.xml/hbase-default.xml
Configuration hbaseConf = HBaseConfiguration.create();
+ // copy cred props to hbaseconf and override if values already
exists
+ addPropsConf(props, hbaseConf);
// copy conf from hbaseConf to jobConf without overriding the
// already existing values of jobConf
injectConf(hbaseConf, jobConf);
@@ -61,6 +63,12 @@ public class HbaseCredentials extends Cr
}
}
+ private void addPropsConf(CredentialsProperties props, Configuration
destConf) {
+ for (Map.Entry<String, String> entry :
props.getProperties().entrySet()) {
+ destConf.set(entry.getKey(), entry.getValue());
+ }
+ }
+
private void injectConf(Configuration srcConf, Configuration destConf) {
for (Map.Entry<String, String> entry : srcConf) {
String name = entry.getKey();
Added:
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestCredentials.java
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestCredentials.java?rev=1427984&view=auto
==============================================================================
---
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestCredentials.java
(added)
+++
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestCredentials.java
Wed Jan 2 19:58:28 2013
@@ -0,0 +1,52 @@
+/**
+ * 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.oozie.action.hadoop;
+
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.oozie.WorkflowActionBean;
+import org.apache.oozie.WorkflowJobBean;
+import org.apache.oozie.action.hadoop.Credentials;
+import org.apache.oozie.action.hadoop.CredentialsProperties;
+
+/**
+ * Test Credentials
+ *
+ */
+public class TestCredentials extends ActionExecutorTestCase {
+
+ public void testHbaseCredentials() {
+ CredentialsProperties prop = new CredentialsProperties("dummyName",
"dummyType");
+ prop.getProperties().put("hbase.zookeeper.quorum", "dummyHost");
+ Credentials hb = new HbaseCredentials();
+ WorkflowJobBean wfBean = new WorkflowJobBean();
+ wfBean.setUser("dummyUser");
+ JobConf jc = new JobConf(false);
+ try {
+ hb.addtoJobConf(jc, prop, new Context(wfBean, new
WorkflowActionBean()));
+ }
+ catch (Exception e) {
+ // Change this when security related classes are available from
+ // hbase maven repo
+ if (!(e.getCause() instanceof ClassNotFoundException)) {
+ fail("unexpected exception " + e.getMessage());
+ }
+ }
+ assertEquals("dummyHost", jc.get("hbase.zookeeper.quorum"));
+ }
+
+}
Modified: oozie/branches/branch-3.3/release-log.txt
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/release-log.txt?rev=1427984&r1=1427983&r2=1427984&view=diff
==============================================================================
--- oozie/branches/branch-3.3/release-log.txt (original)
+++ oozie/branches/branch-3.3/release-log.txt Wed Jan 2 19:58:28 2013
@@ -1,5 +1,6 @@
-- Oozie 3.3.1 (unreleased)
+OOZIE-1151 HbaseCredentials doesn't use properties from the credentials module
(virag)
OOZIE-1148 Set the renewer correctly for JT/RM delegation tokens (rohini via
virag)
OOZIE-1147 HCatCredentialHelper uses the wrong API for getDelegationToken
(rohini via virag)
OOZIE-1149 Update 3.3 branch POM's to 3.3.1-SNAPSHOT (virag)