falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-2275 making instances API unsupported for extensions
Date Wed, 08 Feb 2017 08:51:15 GMT
Repository: falcon
Updated Branches:
  refs/heads/0.11 0825d80a6 -> 1565bde41


FALCON-2275 making instances API unsupported for extensions

Author: Pracheer Agarwal <pracheer.agarwal@inmobi.com>
Author: Pracheer Agarwal <pracheeragarwal@gmail.com>
Author: Pracheer Agarwal <pr@im2216-x0.corp.inmobi.com>

Reviewers: @sandeepSamudrala,@pallavi-rao

Closes #359 from PracheerAgarwal/FALCON-2275 and squashes the following commits:

3f83942 [Pracheer Agarwal] review comments changes
90aef9a [Pracheer Agarwal] FALCON-2275 making instances API unsupported for extensions
af6e719 [Pracheer Agarwal] FALCON-2275 making instances API unsupported for extensions
ba60452 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
ed65aa0 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9ff05df [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9c2f0a5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9cd8c17 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
778c579 [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e39808d [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a932633 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
fda3b28 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a93d71a [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e3728d5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
066c8e2 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
b20f044 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
7f572a1 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
46042fd [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
daa3ffc [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions
622cae4 [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions

(cherry picked from commit 4db747682281a6e1cb55a6d4d812da6e5199e8c6)
Signed-off-by: Pallavi Rao <pallavi.rao@inmobi.com>


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

Branch: refs/heads/0.11
Commit: 1565bde416e8908954195beeec5812590f2336f4
Parents: 0825d80
Author: Pracheer Agarwal <pracheer.agarwal@inmobi.com>
Authored: Wed Feb 8 14:20:44 2017 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Wed Feb 8 14:21:06 2017 +0530

----------------------------------------------------------------------
 .../resource/proxy/ExtensionManagerProxy.java   | 28 +++-----------------
 .../falcon/resource/ExtensionManager.java       |  6 ++---
 2 files changed, 6 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/1565bde4/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
b/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
index 61aa39a..8ac5bbd 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
@@ -26,8 +26,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -69,7 +67,6 @@ import org.apache.falcon.resource.APIResult;
 import org.apache.falcon.resource.AbstractExtensionManager;
 import org.apache.falcon.resource.ExtensionInstanceList;
 import org.apache.falcon.resource.ExtensionJobList;
-import org.apache.falcon.resource.InstancesResult;
 import org.apache.falcon.security.CurrentUser;
 import org.apache.falcon.service.Services;
 import org.apache.falcon.util.DeploymentUtil;
@@ -124,28 +121,9 @@ public class ExtensionManagerProxy extends AbstractExtensionManager {
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") Integer resultsPerPage,
             @DefaultValue("") @QueryParam("doAs") String doAsUser) {
-        checkIfExtensionServiceIsEnabled();
-        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
-        try {
-            List<Entity> entities = getEntityList("", "", "", TAG_PREFIX_EXTENSION_JOB
+ jobName, "", doAsUser);
-            if (entities.isEmpty()) {
-                return new ExtensionInstanceList(0);
-            }
-
-            HashSet<String> fieldSet = new HashSet<>(Arrays.asList(fields.toUpperCase().split(",")));
-            ExtensionInstanceList instances = new ExtensionInstanceList(entities.size());
-            for (Entity entity : entities) {
-                InstancesResult entityInstances = super.getStatus(
-                        entity.getEntityType().name(), entity.getName(), nominalStart, nominalEnd,
-                        null, null, "STATUS:" + instanceStatus, orderBy, sortOrder, offset,
resultsPerPage, null);
-                instances.addEntitySummary(new ExtensionInstanceList.EntitySummary(
-                        getEntityElement(entity, fieldSet), entityInstances.getInstances()));
-            }
-            return instances;
-        } catch (FalconException | IOException e) {
-            LOG.error("Error when listing instances of extension job: " + jobName + ": ",
e);
-            throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR);
-        }
+        LOG.error("instances is not supported on Falcon extensions. Use Falcon instance api
on individual entities.");
+        throw FalconWebException.newAPIException("instances is not supported on Falcon extensions.
Use Falcon instance "
+                + "api on individual entities.");
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/falcon/blob/1565bde4/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java b/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
index 9534d44..78ddba0 100644
--- a/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
+++ b/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
@@ -127,9 +127,9 @@ public class ExtensionManager extends AbstractExtensionManager {
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") Integer resultsPerPage,
             @DefaultValue("") @QueryParam("doAs") String doAsUser) {
-        LOG.error("instances is not supported on Server.Please run your operation on Prism
");
-        throw FalconWebException.newAPIException("instances is not supported on Server. Please
run your "
-                + "operation on Prism.");
+        LOG.error("instances is not supported on Falcon extensions. Use Falcon instance api
on individual entities.");
+        throw FalconWebException.newAPIException("instances is not supported on Falcon extensions.
Use Falcon instance "
+                + "api on individual entities.");
     }
 
     @GET


Mime
View raw message