falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject [03/26] falcon git commit: FALCON-2274 Job list in extension
Date Mon, 23 Oct 2017 05:52:37 GMT
FALCON-2274 Job list in extension

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 #358 from PracheerAgarwal/FALCON-2274 and squashes the following commits:

a5ac209 [Pracheer Agarwal] review comment changes
9abd11d [Pracheer Agarwal] review comment changes
53a49bd [Pracheer Agarwal] review comment changes
38f901e [Pracheer Agarwal] review comments changes
917d3d5 [Pracheer Agarwal] review comments changes
e73e97d [Pracheer Agarwal] FALCON-2274 Job list in extension
0a9c51c [Pracheer Agarwal] FALCON-2274 Job list in extension
ab1d136 [Pracheer Agarwal] FALCON-2274 Job list in extension
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 b23b0a9606d2c6e8145442d97b42506314726bc8)
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/2368bccf
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/2368bccf
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/2368bccf

Branch: refs/heads/master
Commit: 2368bccf19e164328e507df0b053a7720ac4cf6c
Parents: 7fe2c33
Author: Pracheer Agarwal <pracheer.agarwal@inmobi.com>
Authored: Thu Feb 9 16:18:33 2017 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Thu Feb 9 16:18:54 2017 +0530

----------------------------------------------------------------------
 .../main/java/org/apache/falcon/cli/FalconExtensionCLI.java  | 5 ++++-
 .../org/apache/falcon/resource/AbstractExtensionManager.java | 2 +-
 .../apache/falcon/resource/proxy/ExtensionManagerProxy.java  | 8 ++++++--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/2368bccf/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
index 293df23..05bc5f8 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
@@ -149,9 +149,12 @@ public class FalconExtensionCLI extends FalconCLI{
             validateRequiredParameter(jobName, JOB_NAME_OPT);
             result = client.deleteExtensionJob(jobName, doAsUser).getMessage();
         } else if (optionsList.contains(FalconCLIConstants.LIST_OPT)) {
+            if (extensionName == null) {
+                extensionName = "";
+            }
             ExtensionJobList jobs = client.getExtensionJobs(extensionName, doAsUser,
                     commandLine.getOptionValue(FalconCLIConstants.SORT_ORDER_OPT));
-            result = jobs != null ? jobs.toString() : "No extension job (" + extensionName
+ ") found.";
+            result = jobs.getNumJobs() != 0 ? jobs.toString() : "No extension job found.";
         } else if (optionsList.contains(INSTANCES_OPT)) {
             validateRequiredParameter(jobName, JOB_NAME_OPT);
             ExtensionInstanceList instances = client.listExtensionInstance(jobName, doAsUser,

http://git-wip-us.apache.org/repos/asf/falcon/blob/2368bccf/prism/src/main/java/org/apache/falcon/resource/AbstractExtensionManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractExtensionManager.java
b/prism/src/main/java/org/apache/falcon/resource/AbstractExtensionManager.java
index a3b6ef1..4ffeb95 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractExtensionManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractExtensionManager.java
@@ -111,7 +111,7 @@ public class AbstractExtensionManager extends AbstractSchedulableEntityManager
{
         TreeMap<String, String> jobAndExtensionNames = new TreeMap<>();
         List<ExtensionJobsBean> extensionJobs = null;
 
-        if (extensionName != null) {
+        if (StringUtils.isNoneBlank(extensionName)) {
             extensionJobs = ExtensionStore.getMetaStore().getJobsForAnExtension(extensionName);
         } else {
             extensionJobs = ExtensionStore.getMetaStore().getAllExtensionJobs();

http://git-wip-us.apache.org/repos/asf/falcon/blob/2368bccf/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 8ac5bbd..5652ca4 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
@@ -46,6 +46,8 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.xml.bind.JAXBException;
+
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.FalconWebException;
@@ -91,14 +93,16 @@ public class ExtensionManagerProxy extends AbstractExtensionManager {
 
     //SUSPEND CHECKSTYLE CHECK ParameterNumberCheck
     @GET
-    @Path("list/{extension-name}")
+    @Path("list{extension-name : (/[^/]+)?}")
     @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
     public ExtensionJobList getExtensionJobs(
             @PathParam("extension-name") String extensionName,
             @DefaultValue(ASCENDING_SORT_ORDER) @QueryParam("sortOrder") String sortOrder,
             @DefaultValue("") @QueryParam("doAs") String doAsUser) {
         checkIfExtensionServiceIsEnabled();
-        getExtensionIfExists(extensionName);
+        if (StringUtils.isNotBlank(extensionName)) {
+            getExtensionIfExists(extensionName);
+        }
         try {
             return super.getExtensionJobs(extensionName, sortOrder, doAsUser);
         } catch (Throwable e) {


Mime
View raw message