falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sowmya...@apache.org
Subject falcon git commit: FALCON-1460 Move getHiveCredentials method to HiveUtil. Contributed by Ajay Yadava.
Date Wed, 16 Sep 2015 22:51:26 GMT
Repository: falcon
Updated Branches:
  refs/heads/master e0c08e767 -> ccdcd2e6f


FALCON-1460 Move getHiveCredentials method to HiveUtil. Contributed by Ajay Yadava.


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

Branch: refs/heads/master
Commit: ccdcd2e6fe0c8a57b1296f212147f96c04cfd410
Parents: e0c08e7
Author: Sowmya Ramesh <sramesh@hortonworks.com>
Authored: Wed Sep 16 15:51:22 2015 -0700
Committer: Sowmya Ramesh <sramesh@hortonworks.com>
Committed: Wed Sep 16 15:51:22 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |   2 +
 .../falcon/catalog/HiveCatalogService.java      |   2 +-
 .../org/apache/falcon/entity/ClusterHelper.java |   4 +
 .../java/org/apache/falcon/entity/HiveUtil.java |  62 +++++++++++
 .../entity/parser/ClusterEntityParser.java      |   4 +-
 .../apache/falcon/security/SecurityUtil.java    |   6 +-
 .../org/apache/falcon/entity/HiveUtilTest.java  | 103 +++++++++++++++++++
 .../apache/falcon/oozie/OozieEntityBuilder.java |  31 +-----
 .../OozieOrchestrationWorkflowBuilder.java      |   7 +-
 .../feed/FeedReplicationWorkflowBuilder.java    |   5 +-
 .../feed/FeedRetentionWorkflowBuilder.java      |   3 +-
 .../feed/OozieFeedWorkflowBuilderTest.java      |   2 +-
 .../OozieProcessWorkflowBuilderTest.java        |   3 +-
 13 files changed, 192 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fad2d49..d431546 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,8 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1460 Move getHiveCredentials method to ClusterHelper(Ajay Yadava via Sowmya Ramesh)
+
     FALCON-1342 Do not allow duplicate properties in entities(Balu Vellanki via Sowmya Ramesh)
 
     FALCON-1461 NPE in DateValidator validate(Raghav Kumar Gautam via Sowmya Ramesh)

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/main/java/org/apache/falcon/catalog/HiveCatalogService.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/catalog/HiveCatalogService.java b/common/src/main/java/org/apache/falcon/catalog/HiveCatalogService.java
index 7f96827..b988c3e 100644
--- a/common/src/main/java/org/apache/falcon/catalog/HiveCatalogService.java
+++ b/common/src/main/java/org/apache/falcon/catalog/HiveCatalogService.java
@@ -163,7 +163,7 @@ public class HiveCatalogService extends AbstractCatalogService {
                                                      HiveConf hcatConf,
                                                      UserGroupInformation proxyUGI) throws
IOException {
         if (UserGroupInformation.isSecurityEnabled()) {
-            String metaStoreServicePrincipal = conf.get(SecurityUtil.HIVE_METASTORE_PRINCIPAL);
+            String metaStoreServicePrincipal = conf.get(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
             hcatConf.set(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL.varname,
                 metaStoreServicePrincipal);
             hcatConf.set(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL.varname, "true");

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/main/java/org/apache/falcon/entity/ClusterHelper.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/ClusterHelper.java b/common/src/main/java/org/apache/falcon/entity/ClusterHelper.java
index 87b0fba..41c9369 100644
--- a/common/src/main/java/org/apache/falcon/entity/ClusterHelper.java
+++ b/common/src/main/java/org/apache/falcon/entity/ClusterHelper.java
@@ -43,6 +43,8 @@ public final class ClusterHelper {
     public static final String WORKINGDIR = "working";
     public static final String NO_USER_BROKER_URL = "NA";
 
+
+
     private ClusterHelper() {
     }
 
@@ -124,6 +126,8 @@ public final class ClusterHelper {
         return normalizedPath.substring(0, normalizedPath.length() - 1);
     }
 
+
+
     public static Location getLocation(Cluster cluster, ClusterLocationType clusterLocationType)
{
         for (Location loc : cluster.getLocations().getLocations()) {
             if (loc.getName().equals(clusterLocationType)) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/main/java/org/apache/falcon/entity/HiveUtil.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/HiveUtil.java b/common/src/main/java/org/apache/falcon/entity/HiveUtil.java
new file mode 100644
index 0000000..f4029e4
--- /dev/null
+++ b/common/src/main/java/org/apache/falcon/entity/HiveUtil.java
@@ -0,0 +1,62 @@
+/**
+ * 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.falcon.entity;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.apache.falcon.security.SecurityUtil;
+
+import java.util.Properties;
+
+/**
+ * Hive Utilities.
+ */
+public final class HiveUtil {
+    public static final String METASTOREURIS = "hive.metastore.uris";
+    public static final String METASTROE_URI = "hcat.metastore.uri";
+    public static final String NODE = "hcatNode";
+    public static final String METASTORE_UGI = "hive.metastore.execute.setugi";
+
+    private HiveUtil() {
+
+    }
+
+    public static Properties getHiveCredentials(Cluster cluster) {
+        String metaStoreUrl = ClusterHelper.getRegistryEndPoint(cluster);
+        if (StringUtils.isBlank(metaStoreUrl)) {
+            throw new IllegalStateException(
+                    "Registry interface is not defined in cluster: " + cluster.getName());
+        }
+
+        Properties hiveCredentials = new Properties();
+        hiveCredentials.put(METASTOREURIS, metaStoreUrl);
+        hiveCredentials.put(METASTORE_UGI, "true");
+        hiveCredentials.put(NODE, metaStoreUrl.replace("thrift", "hcat"));
+        hiveCredentials.put(METASTROE_URI, metaStoreUrl);
+
+        if (SecurityUtil.isSecurityEnabled()) {
+            String principal = ClusterHelper
+                    .getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
+            hiveCredentials.put(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL, principal);
+            hiveCredentials.put(SecurityUtil.METASTORE_PRINCIPAL, principal);
+            hiveCredentials.put(SecurityUtil.METASTORE_USE_THRIFT_SASL, "true");
+        }
+        return hiveCredentials;
+    }
+}

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/main/java/org/apache/falcon/entity/parser/ClusterEntityParser.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/parser/ClusterEntityParser.java
b/common/src/main/java/org/apache/falcon/entity/parser/ClusterEntityParser.java
index 6a8ec25..6bfcb98 100644
--- a/common/src/main/java/org/apache/falcon/entity/parser/ClusterEntityParser.java
+++ b/common/src/main/java/org/apache/falcon/entity/parser/ClusterEntityParser.java
@@ -215,10 +215,10 @@ public class ClusterEntityParser extends EntityParser<Cluster>
{
         try {
             Configuration clusterConf = ClusterHelper.getConfiguration(cluster);
             if (UserGroupInformation.isSecurityEnabled()) {
-                String metaStorePrincipal = clusterConf.get(SecurityUtil.HIVE_METASTORE_PRINCIPAL);
+                String metaStorePrincipal = clusterConf.get(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
                 Validate.notEmpty(metaStorePrincipal,
                         "Cluster definition missing required metastore credential property:
"
-                                + SecurityUtil.HIVE_METASTORE_PRINCIPAL);
+                                + SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
             }
 
             if (!CatalogServiceFactory.getCatalogService().isAlive(clusterConf, catalogUrl))
{

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/main/java/org/apache/falcon/security/SecurityUtil.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/security/SecurityUtil.java b/common/src/main/java/org/apache/falcon/security/SecurityUtil.java
index 123a1a2..c187358 100644
--- a/common/src/main/java/org/apache/falcon/security/SecurityUtil.java
+++ b/common/src/main/java/org/apache/falcon/security/SecurityUtil.java
@@ -56,7 +56,11 @@ public final class SecurityUtil {
      * Constant for the configuration property that indicates the Name node principal.
      * This is used to talk to Hive Meta Store during parsing and validations only.
      */
-    public static final String HIVE_METASTORE_PRINCIPAL = "hive.metastore.kerberos.principal";
+    public static final String HIVE_METASTORE_KERBEROS_PRINCIPAL = "hive.metastore.kerberos.principal";
+
+    public static final String METASTORE_USE_THRIFT_SASL = "hive.metastore.sasl.enabled";
+
+    public static final String METASTORE_PRINCIPAL = "hcat.metastore.principal";
 
     private static final Logger LOG = LoggerFactory.getLogger(SecurityUtil.class);
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/common/src/test/java/org/apache/falcon/entity/HiveUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/HiveUtilTest.java b/common/src/test/java/org/apache/falcon/entity/HiveUtilTest.java
new file mode 100644
index 0000000..c37cebd
--- /dev/null
+++ b/common/src/test/java/org/apache/falcon/entity/HiveUtilTest.java
@@ -0,0 +1,103 @@
+/**
+ * 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.falcon.entity;
+
+import junit.framework.Assert;
+import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.apache.falcon.entity.v0.cluster.Interface;
+import org.apache.falcon.entity.v0.cluster.Interfaces;
+import org.apache.falcon.entity.v0.cluster.Interfacetype;
+import org.apache.falcon.entity.v0.cluster.Property;
+import org.apache.falcon.security.SecurityUtil;
+import org.apache.falcon.util.StartupProperties;
+import org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler;
+import org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler;
+import org.testng.annotations.Test;
+
+import java.util.Properties;
+
+/**
+ * Tests for HiveUtil.
+ */
+public class HiveUtilTest {
+
+    @Test
+    public void testGetHiveCredentialsWithoutKerberos() {
+        StartupProperties.get().setProperty(SecurityUtil.AUTHENTICATION_TYPE, PseudoAuthenticationHandler.TYPE);
+        Cluster cluster = new Cluster();
+        String metaStoreUrl = "thrift://localhost:19083";
+
+        // set registry interface
+        Interfaces interfaces = new Interfaces();
+        Interface registry = new Interface();
+        registry.setEndpoint(metaStoreUrl);
+        registry.setType(Interfacetype.REGISTRY);
+        registry.setVersion("0.1");
+        interfaces.getInterfaces().add(registry);
+        cluster.setInterfaces(interfaces);
+
+        Properties expected = new Properties();
+        expected.put(HiveUtil.METASTORE_UGI, "true");
+        expected.put(HiveUtil.NODE, metaStoreUrl.replace("thrift", "hcat"));
+        expected.put(HiveUtil.METASTROE_URI, metaStoreUrl);
+        expected.put(HiveUtil.METASTOREURIS, metaStoreUrl);
+
+        Properties actual = HiveUtil.getHiveCredentials(cluster);
+        Assert.assertTrue(actual.equals(expected));
+    }
+
+    @Test
+    public void testGetHiveCredentialsWithKerberos() {
+        StartupProperties.get().setProperty(SecurityUtil.AUTHENTICATION_TYPE, KerberosAuthenticationHandler.TYPE);
+        Cluster cluster = new Cluster();
+        String metaStoreUrl = "thrift://localhost:19083";
+        String principal = "kerberosPrincipal";
+
+        // set registry interface
+        Interfaces interfaces = new Interfaces();
+        Interface registry = new Interface();
+        registry.setEndpoint(metaStoreUrl);
+        registry.setType(Interfacetype.REGISTRY);
+        registry.setVersion("0.1");
+        interfaces.getInterfaces().add(registry);
+        cluster.setInterfaces(interfaces);
+
+        // set security properties
+        org.apache.falcon.entity.v0.cluster.Properties props = new org.apache.falcon.entity.v0.cluster.Properties();
+        Property principal2 = new Property();
+        principal2.setName(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
+        principal2.setValue(principal);
+        props.getProperties().add(principal2);
+        cluster.setProperties(props);
+        Properties expected = new Properties();
+        expected.put(SecurityUtil.METASTORE_USE_THRIFT_SASL, "true");
+        expected.put(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL, principal);
+        expected.put(SecurityUtil.METASTORE_PRINCIPAL, principal);
+        expected.put(HiveUtil.METASTORE_UGI, "true");
+        expected.put(HiveUtil.NODE, metaStoreUrl.replace("thrift", "hcat"));
+        expected.put(HiveUtil.METASTROE_URI, metaStoreUrl);
+        expected.put(HiveUtil.METASTOREURIS, metaStoreUrl);
+
+        Properties actual = HiveUtil.getHiveCredentials(cluster);
+        Assert.assertTrue(actual.equals(expected));
+    }
+
+
+}
+

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/main/java/org/apache/falcon/oozie/OozieEntityBuilder.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/oozie/OozieEntityBuilder.java b/oozie/src/main/java/org/apache/falcon/oozie/OozieEntityBuilder.java
index f9230da..491cd81 100644
--- a/oozie/src/main/java/org/apache/falcon/oozie/OozieEntityBuilder.java
+++ b/oozie/src/main/java/org/apache/falcon/oozie/OozieEntityBuilder.java
@@ -24,6 +24,7 @@ import org.apache.falcon.FalconException;
 import org.apache.falcon.entity.CatalogStorage;
 import org.apache.falcon.entity.ClusterHelper;
 import org.apache.falcon.entity.EntityUtil;
+import org.apache.falcon.entity.HiveUtil;
 import org.apache.falcon.entity.v0.Entity;
 import org.apache.falcon.entity.v0.cluster.Cluster;
 import org.apache.falcon.entity.v0.cluster.ClusterLocationType;
@@ -69,9 +70,6 @@ import java.util.Properties;
 public abstract class OozieEntityBuilder<T extends Entity> {
     public static final Logger LOG = LoggerFactory.getLogger(OozieEntityBuilder.class);
 
-    public static final String METASTOREURIS = "hive.metastore.uris";
-    public static final String METASTORE_KERBEROS_PRINCIPAL = "hive.metastore.kerberos.principal";
-    public static final String METASTORE_USE_THRIFT_SASL = "hive.metastore.sasl.enabled";
 
     public static final String ENTITY_PATH = "ENTITY_PATH";
     public static final String ENTITY_NAME = "ENTITY_NAME";
@@ -180,33 +178,8 @@ public abstract class OozieEntityBuilder<T extends Entity> {
         return properties;
     }
 
-    protected Properties getHiveCredentials(Cluster cluster) {
-        String metaStoreUrl = ClusterHelper.getRegistryEndPoint(cluster);
-        if (metaStoreUrl == null) {
-            throw new IllegalStateException(
-                    "Registry interface is not defined in cluster: " + cluster.getName());
-        }
-
-        Properties hiveCredentials = new Properties();
-        hiveCredentials.put(METASTOREURIS, metaStoreUrl);
-        hiveCredentials.put("hive.metastore.execute.setugi", "true");
-        hiveCredentials.put("hcatNode", metaStoreUrl.replace("thrift", "hcat"));
-        hiveCredentials.put("hcat.metastore.uri", metaStoreUrl);
-
-        if (isSecurityEnabled) {
-            String principal = ClusterHelper
-                    .getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_PRINCIPAL);
-            hiveCredentials.put(METASTORE_KERBEROS_PRINCIPAL, principal);
-            hiveCredentials.put(METASTORE_USE_THRIFT_SASL, "true");
-            hiveCredentials.put("hcat.metastore.principal", principal);
-        }
-
-        return hiveCredentials;
-    }
-
     protected Configuration getHiveCredentialsAsConf(Cluster cluster) {
-        Properties hiveCredentials = getHiveCredentials(cluster);
-
+        Properties hiveCredentials = HiveUtil.getHiveCredentials(cluster);
         Configuration hiveConf = new Configuration(false);
         for (Entry<Object, Object> entry : hiveCredentials.entrySet()) {
             hiveConf.set((String)entry.getKey(), (String)entry.getValue());

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java
b/oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java
index 671ae6b..3213a70 100644
--- a/oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java
+++ b/oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java
@@ -25,6 +25,7 @@ import org.apache.falcon.LifeCycle;
 import org.apache.falcon.Tag;
 import org.apache.falcon.entity.ClusterHelper;
 import org.apache.falcon.entity.EntityUtil;
+import org.apache.falcon.entity.HiveUtil;
 import org.apache.falcon.entity.v0.Entity;
 import org.apache.falcon.entity.v0.cluster.Cluster;
 import org.apache.falcon.entity.v0.cluster.ClusterLocationType;
@@ -389,9 +390,9 @@ public abstract class OozieOrchestrationWorkflowBuilder<T extends Entity>
extend
         credential.setName(credentialName);
         credential.setType("hcat");
 
-        credential.getProperty().add(createProperty("hcat.metastore.uri", metaStoreUrl));
-        credential.getProperty().add(createProperty("hcat.metastore.principal",
-                ClusterHelper.getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_PRINCIPAL)));
+        credential.getProperty().add(createProperty(HiveUtil.METASTROE_URI, metaStoreUrl));
+        credential.getProperty().add(createProperty(SecurityUtil.METASTORE_PRINCIPAL,
+                ClusterHelper.getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL)));
 
         return credential;
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationWorkflowBuilder.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationWorkflowBuilder.java
b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationWorkflowBuilder.java
index 4dc55ff..a7c19cd 100644
--- a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationWorkflowBuilder.java
+++ b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationWorkflowBuilder.java
@@ -24,6 +24,7 @@ import org.apache.falcon.Tag;
 import org.apache.falcon.entity.ClusterHelper;
 import org.apache.falcon.entity.EntityUtil;
 import org.apache.falcon.entity.FeedHelper;
+import org.apache.falcon.entity.HiveUtil;
 import org.apache.falcon.entity.store.ConfigurationStore;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.cluster.Cluster;
@@ -65,8 +66,8 @@ public abstract class FeedReplicationWorkflowBuilder extends OozieOrchestrationW
         props.putAll(createDefaultConfiguration(cluster));
         if (EntityUtil.isTableStorageType(cluster, entity)) {
             // todo: kludge send source hcat creds for coord dependency check to pass
-            props.putAll(getHiveCredentials(srcCluster));
-            props.putAll(getHiveCredentials(cluster));
+            props.putAll(HiveUtil.getHiveCredentials(srcCluster));
+            props.putAll(HiveUtil.getHiveCredentials(cluster));
         }
         props.putAll(getWorkflowProperties(entity));
         props.putAll(FeedHelper.getUserWorkflowProperties(getLifecycle()));

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedRetentionWorkflowBuilder.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedRetentionWorkflowBuilder.java
b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedRetentionWorkflowBuilder.java
index b56f0dd..f953557 100644
--- a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedRetentionWorkflowBuilder.java
+++ b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedRetentionWorkflowBuilder.java
@@ -23,6 +23,7 @@ import org.apache.falcon.LifeCycle;
 import org.apache.falcon.Tag;
 import org.apache.falcon.entity.EntityUtil;
 import org.apache.falcon.entity.FeedHelper;
+import org.apache.falcon.entity.HiveUtil;
 import org.apache.falcon.entity.Storage;
 import org.apache.falcon.entity.v0.cluster.Cluster;
 import org.apache.falcon.entity.v0.feed.Feed;
@@ -76,7 +77,7 @@ public class FeedRetentionWorkflowBuilder extends OozieOrchestrationWorkflowBuil
         if (EntityUtil.isTableStorageType(cluster, entity)) {
             setupHiveCredentials(cluster, buildPath, workflow);
             // todo: kludge send source hcat creds for coord dependency check to pass
-            props.putAll(getHiveCredentials(cluster));
+            props.putAll(HiveUtil.getHiveCredentials(cluster));
         }
 
         marshal(cluster, workflow, buildPath);

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/test/java/org/apache/falcon/oozie/feed/OozieFeedWorkflowBuilderTest.java
----------------------------------------------------------------------
diff --git a/oozie/src/test/java/org/apache/falcon/oozie/feed/OozieFeedWorkflowBuilderTest.java
b/oozie/src/test/java/org/apache/falcon/oozie/feed/OozieFeedWorkflowBuilderTest.java
index 2f7787d..7d0174a 100644
--- a/oozie/src/test/java/org/apache/falcon/oozie/feed/OozieFeedWorkflowBuilderTest.java
+++ b/oozie/src/test/java/org/apache/falcon/oozie/feed/OozieFeedWorkflowBuilderTest.java
@@ -109,7 +109,7 @@ public class OozieFeedWorkflowBuilderTest extends AbstractTestBase {
 
         org.apache.falcon.entity.v0.cluster.Property property =
                 new org.apache.falcon.entity.v0.cluster.Property();
-        property.setName(OozieOrchestrationWorkflowBuilder.METASTORE_KERBEROS_PRINCIPAL);
+        property.setName(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
         property.setValue("hive/_HOST");
 
         srcCluster = (Cluster) storeEntity(EntityType.CLUSTER, SRC_CLUSTER_PATH, srcHdfsUrl);

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccdcd2e6/oozie/src/test/java/org/apache/falcon/oozie/process/OozieProcessWorkflowBuilderTest.java
----------------------------------------------------------------------
diff --git a/oozie/src/test/java/org/apache/falcon/oozie/process/OozieProcessWorkflowBuilderTest.java
b/oozie/src/test/java/org/apache/falcon/oozie/process/OozieProcessWorkflowBuilderTest.java
index d727ca3..e8d6cdd 100644
--- a/oozie/src/test/java/org/apache/falcon/oozie/process/OozieProcessWorkflowBuilderTest.java
+++ b/oozie/src/test/java/org/apache/falcon/oozie/process/OozieProcessWorkflowBuilderTest.java
@@ -43,7 +43,6 @@ import org.apache.falcon.entity.v0.process.Validity;
 import org.apache.falcon.entity.v0.process.Workflow;
 import org.apache.falcon.hadoop.HadoopClientFactory;
 import org.apache.falcon.oozie.OozieEntityBuilder;
-import org.apache.falcon.oozie.OozieOrchestrationWorkflowBuilder;
 import org.apache.falcon.oozie.bundle.BUNDLEAPP;
 import org.apache.falcon.oozie.bundle.CONFIGURATION;
 import org.apache.falcon.oozie.coordinator.COORDINATORAPP;
@@ -118,7 +117,7 @@ public class OozieProcessWorkflowBuilderTest extends AbstractTestBase
{
         cluster = store.get(EntityType.CLUSTER, "corp");
         org.apache.falcon.entity.v0.cluster.Property property =
                 new org.apache.falcon.entity.v0.cluster.Property();
-        property.setName(OozieOrchestrationWorkflowBuilder.METASTORE_KERBEROS_PRINCIPAL);
+        property.setName(SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL);
         property.setValue("hive/_HOST");
         cluster.getProperties().getProperties().add(property);
 


Mime
View raw message