You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by sr...@apache.org on 2013/08/08 16:58:13 UTC

git commit: FALCON-78 Falcon error when prism on one hadoop version and server on another. Contributed by Shwetha GS

Updated Branches:
  refs/heads/master 7118f1668 -> 58b2a7c60


FALCON-78 Falcon error when prism on one hadoop version and server on another. Contributed by Shwetha GS


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

Branch: refs/heads/master
Commit: 58b2a7c6075a84f81d080a6b21df4812311085f8
Parents: 7118f16
Author: srikanth.sundarrajan <sr...@inmobi.com>
Authored: Thu Aug 8 20:27:19 2013 +0530
Committer: srikanth.sundarrajan <sr...@inmobi.com>
Committed: Thu Aug 8 20:27:19 2013 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  6 +++--
 .../entity/parser/ClusterEntityParser.java      |  9 +++++++-
 .../entity/parser/ProcessEntityParser.java      | 23 ++++++++++++++++----
 common/src/test/resources/deploy.properties     | 19 ++++++++++++++++
 4 files changed, 50 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/58b2a7c6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 95200cf..95e8b3a 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,11 +9,13 @@ Trunk (Unreleased)
   IMPROVEMENTS
 
   OPTIMIZATIONS
-
-  BUG FIXES
     FALCON-67 Remove ant dependency in oozie workflows. (Shwetha GS via
     Srikanth Sundarrajan)
 
+  BUG FIXES
+    FALCON-78 Falcon error when prism on one hadoop version and server 
+    on another. (Shwetha GS via Srikanth Sundarrajan)
+
     FALCON-61 The identifier regex for oozie bundle,coordinator, workflow
     pattern is incorrect. (Suhas V via Srikanth Sundarrajan)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/58b2a7c6/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 8011dce..381d321 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
@@ -22,6 +22,7 @@ import org.apache.falcon.entity.ClusterHelper;
 import org.apache.falcon.entity.store.StoreAccessException;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.cluster.Cluster;
+import org.apache.falcon.util.DeploymentUtil;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -46,6 +47,13 @@ public class ClusterEntityParser extends EntityParser<Cluster> {
                     "Cannot get valid scheme for namenode from write interface of cluster: "
                             + cluster.getName());
         }
+
+        //No filesystem validations in prism or other falcon servers. Only the falcon server for which
+        // the cluster belongs to should check filesystem
+        if (DeploymentUtil.isPrism() || !cluster.getColo().equals(DeploymentUtil.getCurrentColo())) {
+            return;
+        }
+
         try {
             Configuration conf = new Configuration();
             conf.set("fs.default.name", ClusterHelper.getStorageUrl(cluster));
@@ -56,5 +64,4 @@ public class ClusterEntityParser extends EntityParser<Cluster> {
                     + ClusterHelper.getStorageUrl(cluster), e);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/58b2a7c6/common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java b/common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java
index ba618ef..75d7374 100644
--- a/common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java
+++ b/common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java
@@ -18,21 +18,31 @@
 
 package org.apache.falcon.entity.parser;
 
+import java.net.ConnectException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+
 import org.apache.falcon.FalconException;
 import org.apache.falcon.entity.ClusterHelper;
 import org.apache.falcon.entity.store.ConfigurationStore;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.cluster.Cluster;
 import org.apache.falcon.entity.v0.feed.Feed;
-import org.apache.falcon.entity.v0.process.*;
+import org.apache.falcon.entity.v0.process.Input;
+import org.apache.falcon.entity.v0.process.Inputs;
+import org.apache.falcon.entity.v0.process.LateInput;
+import org.apache.falcon.entity.v0.process.Output;
+import org.apache.falcon.entity.v0.process.Outputs;
 import org.apache.falcon.entity.v0.process.Process;
+import org.apache.falcon.util.DeploymentUtil;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
-import java.net.ConnectException;
-import java.util.*;
-
 /**
  * Concrete Parser which has XML parsing and validation logic for Process XML.
  */
@@ -87,6 +97,11 @@ public class ProcessEntityParser extends EntityParser<Process> {
     }
 
     private void validateHDFSpaths(Process process, String clusterName) throws FalconException {
+        //No filesystem checks in prism
+        if (DeploymentUtil.isPrism()) {
+            return;
+        }
+
         org.apache.falcon.entity.v0.cluster.Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER,
                 clusterName);
         String workflowPath = process.getWorkflow().getPath();

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/58b2a7c6/common/src/test/resources/deploy.properties
----------------------------------------------------------------------
diff --git a/common/src/test/resources/deploy.properties b/common/src/test/resources/deploy.properties
new file mode 100644
index 0000000..74e1ba3
--- /dev/null
+++ b/common/src/test/resources/deploy.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
+*.domain=unittest