falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject falcon git commit: FALCON-1402 Validate cmd throws NPE when source cluster and any one of target cluster doesn't have overlapping dates. Contributed by Pavan Kumar Kolamuri.
Date Wed, 09 Sep 2015 10:48:31 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 5a474ffab -> 20f2acec7


FALCON-1402 Validate cmd throws NPE when source cluster and any one of target cluster doesn't
have overlapping dates. Contributed by Pavan Kumar Kolamuri.


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

Branch: refs/heads/master
Commit: 20f2acec7c0c2819da9c8005a3b3d443cebc349f
Parents: 5a474ff
Author: Ajay Yadava <ajayyadava@apache.org>
Authored: Wed Sep 9 14:43:41 2015 +0530
Committer: Ajay Yadava <ajayyadava@apache.org>
Committed: Wed Sep 9 16:17:35 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 .../oozie/feed/FeedReplicationCoordinatorBuilder.java   | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/20f2acec/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e0249a0..bc1422a 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,8 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1402 Validate cmd throws NPE when source cluster and any one of target cluster
doesn't have overlapping dates(Pavan Kumar Kolamuri via Ajay Yadava)
+
     FALCON-1365 HCatReplication job fails with AccessControlException(Sowmya Ramesh via Ajay
Yadava)
 
     FALCON-298 Feed update with replication delay creates holes(Sandeep Samudrala via Ajay
Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/20f2acec/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationCoordinatorBuilder.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationCoordinatorBuilder.java
b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationCoordinatorBuilder.java
index f5cc2c3..db08d60 100644
--- a/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationCoordinatorBuilder.java
+++ b/oozie/src/main/java/org/apache/falcon/oozie/feed/FeedReplicationCoordinatorBuilder.java
@@ -90,7 +90,10 @@ public class FeedReplicationCoordinatorBuilder extends OozieCoordinatorBuilder<F
                     // workflow is serialized to a specific dir
                     Path coordPath = new Path(buildPath, Tag.REPLICATION.name() + "/" + srcCluster.getName());
 
-                    props.add(doBuild(srcCluster, cluster, coordPath));
+                    Properties buildProps = doBuild(srcCluster, cluster, coordPath);
+                    if (buildProps != null && !buildProps.isEmpty()) {
+                        props.add(buildProps);
+                    }
                 }
             }
             return props;
@@ -107,10 +110,9 @@ public class FeedReplicationCoordinatorBuilder extends OozieCoordinatorBuilder<F
         Date targetEndDate = getEndDate(trgCluster);
 
         if (noOverlapExists(sourceStartDate, sourceEndDate,
-            targetStartDate, targetEndDate)) {
-            LOG.warn("Not creating replication coordinator, as the source cluster: {} and
target cluster: {} do "
-                + "not have overlapping dates", srcCluster.getName(), trgCluster.getName());
-            return null;
+                targetStartDate, targetEndDate)) {
+            throw new FalconException("Source cluster: " + srcCluster.getName() + " and Target
cluster: "
+                    + trgCluster.getName() + " do not have overlapping dates for replication");
         }
 
         // Different workflow for each source since hive credentials vary for each cluster


Mime
View raw message