falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shweth...@apache.org
Subject git commit: FALCON-213 Validating Storage Exists (table) should be called only from the server (not from prism). Contributed by Venkatesh Seetharam
Date Fri, 27 Dec 2013 05:54:43 GMT
Updated Branches:
  refs/heads/master a123c0497 -> aa8383b77


FALCON-213 Validating Storage Exists (table) should be called only from the server (not from
prism). Contributed by  Venkatesh Seetharam


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

Branch: refs/heads/master
Commit: aa8383b7732583e0f6c783c2ec70f0a471baa8a1
Parents: a123c04
Author: Shwetha GS <shwethags@gmail.com>
Authored: Fri Dec 27 11:24:27 2013 +0530
Committer: Shwetha GS <shwethags@gmail.com>
Committed: Fri Dec 27 11:24:27 2013 +0530

----------------------------------------------------------------------
 CHANGES.txt                                      |  2 ++
 .../falcon/entity/parser/FeedEntityParser.java   | 19 ++++++++-----------
 2 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/aa8383b7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index de454bb..23315e3 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -133,6 +133,8 @@ Release Version: 0.4-incubating
 
   BUG FIXES
 
+    FALCON-213: Validating Storage Exists (table) should be called only from the server (not
from prism)
+
     FALCON-24: Allow re-run of timedout instances
 
     FALCON-42: Simplify Build and Installation Guide

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/aa8383b7/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java b/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java
index 8d7903b..5c1d9ad 100644
--- a/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java
+++ b/common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java
@@ -344,23 +344,20 @@ public class FeedEntityParser extends EntityParser<Feed> {
     }
 
     private void validateStorageExists(Feed feed) throws FalconException {
-        StringBuilder buffer = new StringBuilder();
         for (Cluster cluster : feed.getClusters().getClusters()) {
+            org.apache.falcon.entity.v0.cluster.Cluster clusterEntity =
+                    EntityUtil.getEntity(EntityType.CLUSTER, cluster.getName());
+            if (!EntityUtil.responsibleFor(clusterEntity.getColo())) {
+                continue;
+            }
+
             final Storage storage = FeedHelper.createStorage(cluster, feed);
             if (!storage.exists()) {
                 // this is only true for table, filesystem always returns true
                 CatalogStorage catalogStorage = (CatalogStorage) storage;
-                buffer.append("Table [")
-                        .append(catalogStorage.getTable())
-                        .append("] does not exist for feed: ")
-                        .append(feed.getName())
-                        .append(", cluster: ")
-                        .append(cluster.getName());
+                throw new ValidationException("Table [" + catalogStorage.getTable()
+                        + "] does not exist for feed: " + feed.getName() + ", cluster: "
+ cluster.getName());
             }
         }
-
-        if (buffer.length() > 0) {
-            throw new ValidationException(buffer.toString());
-        }
     }
 }


Mime
View raw message