falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject git commit: Fixes unit test issues introduced by after FALCON-107 after merging with origin/master.
Date Tue, 24 Sep 2013 00:05:43 GMT
Updated Branches:
  refs/heads/FALCON-85 d1c5eafe0 -> a11f41636


Fixes unit test issues introduced by after FALCON-107 after merging with origin/master.


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

Branch: refs/heads/FALCON-85
Commit: a11f416365c6f5a500d6282b26c1633c0c154706
Parents: d1c5eaf
Author: Venkatesh Seetharam <venkatesh@apache.org>
Authored: Mon Sep 23 17:04:51 2013 -0700
Committer: Venkatesh Seetharam <venkatesh@apache.org>
Committed: Mon Sep 23 17:04:51 2013 -0700

----------------------------------------------------------------------
 .../org/apache/falcon/entity/FeedHelper.java    | 20 ++++++++++++++++++++
 .../falcon/converter/OozieFeedMapper.java       |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a11f4163/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
index 364aeb0..a35ee68 100644
--- a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
+++ b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
@@ -112,6 +112,26 @@ public final class FeedHelper {
         throw new FalconException("Both catalog and locations are not defined.");
     }
 
+    public static Storage createReadOnlyStorage(org.apache.falcon.entity.v0.cluster.Cluster
clusterEntity,
+                                                Feed feed) throws FalconException {
+        Cluster feedCluster = getCluster(feed, clusterEntity.getName());
+        final List<Location> locations = getLocations(feedCluster, feed);
+        if (locations != null) {
+            return new FileSystemStorage(ClusterHelper.getReadOnlyStorageUrl(clusterEntity),
locations);
+        }
+
+        try {
+            final CatalogTable table = getTable(feedCluster, feed);
+            if (table != null) {
+                return new CatalogStorage(clusterEntity, feed);
+            }
+        } catch (URISyntaxException e) {
+            throw new FalconException(e);
+        }
+
+        throw new FalconException("Both catalog and locations are not defined.");
+    }
+
     public static Storage createStorage(String type, String storageUriTemplate)
         throws URISyntaxException {
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a11f4163/feed/src/main/java/org/apache/falcon/converter/OozieFeedMapper.java
----------------------------------------------------------------------
diff --git a/feed/src/main/java/org/apache/falcon/converter/OozieFeedMapper.java b/feed/src/main/java/org/apache/falcon/converter/OozieFeedMapper.java
index c97ccf1..bb0958c 100644
--- a/feed/src/main/java/org/apache/falcon/converter/OozieFeedMapper.java
+++ b/feed/src/main/java/org/apache/falcon/converter/OozieFeedMapper.java
@@ -265,7 +265,8 @@ public class OozieFeedMapper extends AbstractOozieEntityMapper<Feed>
{
             SYNCDATASET inputDataset = (SYNCDATASET) replicationCoord.getDatasets().getDatasetOrAsyncDataset().get(0);
             SYNCDATASET outputDataset = (SYNCDATASET) replicationCoord.getDatasets().getDatasetOrAsyncDataset().get(1);
 
-            inputDataset.setUriTemplate(FeedHelper.createStorage(srcCluster, feed).getUriTemplate(LocationType.DATA));
+            final Storage srcStorage = FeedHelper.createReadOnlyStorage(srcCluster, feed);
+            inputDataset.setUriTemplate(srcStorage.getUriTemplate(LocationType.DATA));
             outputDataset.setUriTemplate(FeedHelper.createStorage(feed).getUriTemplate(LocationType.DATA));
             setDatasetValues(inputDataset, feed, srcCluster);
             setDatasetValues(outputDataset, feed, srcCluster);


Mime
View raw message