falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [1/3] falcon git commit: FALCON-1415 Hive DR process fail if there are no events available from source table. Contributed by Peeyush Bishnoi.
Date Thu, 10 Sep 2015 09:45:36 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 7624b2c8b -> 407bb8595


FALCON-1415 Hive DR process fail if there are no events available from source table. Contributed
by Peeyush Bishnoi.


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

Branch: refs/heads/master
Commit: 1c97955da6da4966bf0a58d6270cb00982dc56e1
Parents: 7624b2c
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Thu Sep 10 12:59:18 2015 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Thu Sep 10 12:59:18 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../java/org/apache/falcon/hive/LastReplicatedEvents.java   | 9 ++++++++-
 .../java/org/apache/falcon/hive/MetaStoreEventSourcer.java  | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/1c97955d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 45ead3f..613405b 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,7 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1415 Hive DR process fail if there are no events available from source table(Peeyush
Bishnoi via Ajay Yadava)
 
     FALCON-1371 Status of scheduled Process entity is shown as submitted in corner case(Balu
Vellanki via Sowmya Ramesh)
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/1c97955d/addons/hivedr/src/main/java/org/apache/falcon/hive/LastReplicatedEvents.java
----------------------------------------------------------------------
diff --git a/addons/hivedr/src/main/java/org/apache/falcon/hive/LastReplicatedEvents.java
b/addons/hivedr/src/main/java/org/apache/falcon/hive/LastReplicatedEvents.java
index 94f936c..bae6c9e 100644
--- a/addons/hivedr/src/main/java/org/apache/falcon/hive/LastReplicatedEvents.java
+++ b/addons/hivedr/src/main/java/org/apache/falcon/hive/LastReplicatedEvents.java
@@ -19,6 +19,7 @@
 package org.apache.falcon.hive;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.falcon.hive.exception.HiveReplicationException;
 import org.apache.falcon.hive.util.DRStatusStore;
 import org.apache.falcon.hive.util.DelimiterUtils;
@@ -132,7 +133,13 @@ public class LastReplicatedEvents {
                 eventId = ReplicationUtils.getLastReplicationId(table);
             }
         }
-        LOG.info("Last saved eventId : {}", eventId);
+
+        if ((StringUtils.isEmpty(tableName))) {
+            LOG.info("Last replicated eventId for DB : {} is {}", dbName, eventId);
+        } else {
+            LOG.info("Last replicated eventId for DB : {} Table : {} is {}", dbName, tableName,
eventId);
+        }
+
         return eventId;
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/1c97955d/addons/hivedr/src/main/java/org/apache/falcon/hive/MetaStoreEventSourcer.java
----------------------------------------------------------------------
diff --git a/addons/hivedr/src/main/java/org/apache/falcon/hive/MetaStoreEventSourcer.java
b/addons/hivedr/src/main/java/org/apache/falcon/hive/MetaStoreEventSourcer.java
index 6f3fe8f..0e12e89 100644
--- a/addons/hivedr/src/main/java/org/apache/falcon/hive/MetaStoreEventSourcer.java
+++ b/addons/hivedr/src/main/java/org/apache/falcon/hive/MetaStoreEventSourcer.java
@@ -95,6 +95,7 @@ public class MetaStoreEventSourcer implements EventSourcer {
                 inputOptions.getMaxEvents(), dbName, null);
         if (replicationTaskIter == null || !replicationTaskIter.hasNext()) {
             LOG.info("No events for db: {}", dbName);
+            return;
         }
         processEvents(dbName, null, inputOptions, replicationTaskIter);
     }
@@ -106,6 +107,7 @@ public class MetaStoreEventSourcer implements EventSourcer {
         );
         if (replicationTaskIter == null || !replicationTaskIter.hasNext()) {
             LOG.info("No events for db.table: {}.{}", dbName, tableName);
+            return;
         }
         processEvents(dbName, tableName, inputOptions, replicationTaskIter);
     }


Mime
View raw message