Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

FALCON-2274 Job list in extension #358

Closed
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
622cae4
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz Dec 20, 2016
daa3ffc
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz Dec 20, 2016
46042fd
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz Dec 23, 2016
7f572a1
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 2, 2017
b20f044
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 4, 2017
066c8e2
Merge branch 'master' of https://github.com/apache/falcon
Jan 5, 2017
e3728d5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal Jan 6, 2017
a93d71a
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal Jan 6, 2017
fda3b28
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 7, 2017
a932633
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal Jan 10, 2017
e39808d
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 22, 2017
778c579
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz Jan 22, 2017
9cd8c17
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 23, 2017
9c2f0a5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 30, 2017
9ff05df
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 31, 2017
ed65aa0
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 2, 2017
ba60452
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 2, 2017
ab1d136
FALCON-2274 Job list in extension
PracheerAgarwal-zz Feb 7, 2017
0a9c51c
FALCON-2274 Job list in extension
PracheerAgarwal-zz Feb 7, 2017
e73e97d
FALCON-2274 Job list in extension
PracheerAgarwal-zz Feb 7, 2017
917d3d5
review comments changes
PracheerAgarwal-zz Feb 9, 2017
38f901e
review comments changes
PracheerAgarwal-zz Feb 9, 2017
53a49bd
review comment changes
PracheerAgarwal-zz Feb 9, 2017
9abd11d
review comment changes
PracheerAgarwal-zz Feb 9, 2017
a5ac209
review comment changes
PracheerAgarwal-zz Feb 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public class FalconClient extends AbstractFalconClient {
private static final String DO_AS_OPT = "doAs";
private static final String JOB_NAME_OPT = "jobName";
public static final String ENTITIES_OPT = "entities";
public static final String EXTENSION_NAME_OPT = "extension-name";
/**
* Name of the HTTP cookie used for the authentication token between the client and the server.
*/
Expand Down Expand Up @@ -1026,7 +1027,8 @@ public APIResult enumerateExtensions() {
@Override
public ExtensionJobList getExtensionJobs(String extensionName, String sortOrder, String doAsUser) {
ClientResponse clientResponse = new ResourceBuilder()
.path(ExtensionOperations.LIST.path, extensionName)
.path(ExtensionOperations.LIST.path)
.addQueryParam(EXTENSION_NAME_OPT, extensionName)
.addQueryParam(DO_AS_OPT, doAsUser)
.addQueryParam(SORT_ORDER, sortOrder)
.call(ExtensionOperations.LIST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ public class ExtensionManagerProxy extends AbstractExtensionManager {

//SUSPEND CHECKSTYLE CHECK ParameterNumberCheck
@GET
@Path("list/{extension-name}")
@Path("list")
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
public ExtensionJobList getExtensionJobs(
@PathParam("extension-name") String extensionName,
@QueryParam("extension-name") String extensionName,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why query param? Path param is REST compliant and is in-line with other APIs too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this API is used for two use case, one to get the jobs for an extension and other to get all jobs irrespective of registered extension.
In the second case, we were not passing anything in extension-name, means null.. which resulted in error from FalconClient that the given parameter is null. So I changed it to QueryParam.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand the intent. Can you see if we can do something like what we do for entity listing. Entity type is part of the path, but, is optional.

@DefaultValue(ASCENDING_SORT_ORDER) @QueryParam("sortOrder") String sortOrder,
@DefaultValue("") @QueryParam("doAs") String doAsUser) {
checkIfExtensionServiceIsEnabled();
getExtensionIfExists(extensionName);
if(extensionName != null) {
getExtensionIfExists(extensionName);
}
try {
return super.getExtensionJobs(extensionName, sortOrder, doAsUser);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to modify getExtensionJobs to use StringUtils.isNotBlank? Because now, extensionName will not be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart catch. Ack.

} catch (Throwable e) {
Expand Down