falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suh...@apache.org
Subject falcon git commit: FALCON-1099 FeedReplicator: throws NPE. Contributed by Sowmya Ramesh
Date Wed, 25 Mar 2015 09:37:08 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 693e8af52 -> d718ad737


FALCON-1099 FeedReplicator: throws NPE. Contributed by Sowmya Ramesh


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

Branch: refs/heads/master
Commit: d718ad737d63399e545a187d71420f106620913d
Parents: 693e8af
Author: Suhas Vasu <suhas.v@inmobi.com>
Authored: Wed Mar 25 15:06:47 2015 +0530
Committer: Suhas Vasu <suhas.v@inmobi.com>
Committed: Wed Mar 25 15:06:47 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 .../org/apache/falcon/replication/FeedReplicator.java     | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/d718ad73/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 41382d4..7a52e95 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -117,6 +117,8 @@ Trunk (Unreleased)
    (Suhas vasu)
 
   BUG FIXES
+   FALCON-1099 FeedReplicator: throws NPE (Sowmya Ramesh via Suhas Vasu)
+
    FALCON-1064 Build hangs at the following test: JMSMessageProducerTest
    (Sowmya Ramesh via Suhas Vasu)
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/d718ad73/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
----------------------------------------------------------------------
diff --git a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
index 9e55ffb..aa58aa9 100644
--- a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
+++ b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
@@ -69,10 +69,14 @@ public class FeedReplicator extends Configured implements Tool {
         final boolean includePathSet = (includePathConf != null)
                 && !IGNORE.equalsIgnoreCase(includePathConf);
 
+        String availabilityFlagOpt = cmd.getOptionValue("availabilityFlag");
+        if (StringUtils.isEmpty(availabilityFlagOpt)) {
+            availabilityFlagOpt = "NA";
+        }
         String availabilityFlag = EntityUtil.SUCCEEDED_FILE_NAME;
         if (cmd.getOptionValue("falconFeedStorageType").equals(Storage.TYPE.FILESYSTEM.name()))
{
-            availabilityFlag = cmd.getOptionValue("availabilityFlag").equals("NA")
-                    ? availabilityFlag : cmd.getOptionValue("availabilityFlag");
+            availabilityFlag = "NA".equals(availabilityFlagOpt)
+                    ? availabilityFlag : availabilityFlagOpt;
         }
 
         conf.set("falcon.feed.availability.flag", availabilityFlag);
@@ -136,7 +140,7 @@ public class FeedReplicator extends Configured implements Tool {
     }
 
     private List<Path> getPaths(String[] paths) {
-        List<Path> listPaths = new ArrayList<Path>();
+        List<Path> listPaths = new ArrayList<>();
         for (String path : paths) {
             listPaths.add(new Path(path));
         }


Mime
View raw message