FALCON-1409 Update API throws NullPointerException. Contributed by Sandeep Samudrala.
Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/21fc6455 Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/21fc6455 Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/21fc6455 Branch: refs/heads/0.7 Commit: 21fc6455a014f82fc69fd1d2540ff8a76c01090d Parents: 3060e5c Author: Ajay Yadava <[email protected]> Authored: Thu Aug 20 14:52:09 2015 +0530 Committer: Ajay Yadava <[email protected]> Committed: Thu Aug 20 19:49:01 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../resource/proxy/SchedulableEntityManagerProxy.java | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/21fc6455/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 15ee65a..2a1d0a6 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -89,6 +89,8 @@ Trunk (Unreleased) (Suhas Vasu) BUG FIXES + FALCON-1409 Update API throws NullPointerException(Sandeep Samudrala via Ajay Yadava) + FALCON-1407 Temporarily disable failing tests in ClusterEntityValidationIT(Ajay Yadava) FALCON-1392 FalconUnit tests fail(Pavan Kumar Kolamuri via Ajay Yadava) http://git-wip-us.apache.org/repos/asf/falcon/blob/21fc6455/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java ---------------------------------------------------------------------- diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java index aa7fd0c..d22e8a3 100644 --- a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java +++ b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java @@ -257,6 +257,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana oldColos.removeAll(mergedColos); //Old colos where delete should be called Map<String, APIResult> results = new HashMap<String, APIResult>(); + boolean result = true; if (!oldColos.isEmpty()) { results.put(FALCON_TAG + "/delete", new EntityProxy(type, entityName) { @Override @@ -299,8 +300,14 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana }.execute()); } + for (APIResult apiResult : results.values()) { + if (apiResult.getStatus() != APIResult.Status.SUCCEEDED) { + result = false; + } + } + // update only if all are updated - if (!embeddedMode && results.get(FALCON_TAG).getStatus() == APIResult.Status.SUCCEEDED) { + if (!embeddedMode && result) { results.put(PRISM_TAG, super.update(bufferedRequest, type, entityName, currentColo)); }
