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 <[email protected]> Authored: Thu Sep 10 12:59:18 2015 +0530 Committer: Ajay Yadava <[email protected]> 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); }
