You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Andras Salamon (JIRA)" <ji...@apache.org> on 2019/02/19 11:34:00 UTC

[jira] [Created] (OOZIE-3435) Inconsistent jobtype filtering

Andras Salamon created OOZIE-3435:
-------------------------------------

             Summary: Inconsistent jobtype filtering
                 Key: OOZIE-3435
                 URL: https://issues.apache.org/jira/browse/OOZIE-3435
             Project: Oozie
          Issue Type: Bug
    Affects Versions: trunk
            Reporter: Andras Salamon


It is possible for specifying the jobtype during jobs filter in the REST API and in the command line as well. Supported jobtypes are: {{wf}}, {{coord}}, {{bundle}}

For some reason Oozie checks the jobtype using {{contains}} and {{startsWith}} also in [OozieCLI|https://github.com/apache/oozie/blob/master/client/src/main/java/org/apache/oozie/cli/OozieCLI.java#L1757-L1765]:
{noformat}
else if (jobtype.toLowerCase().contains("wf")) {
    ...
}
else if (jobtype.toLowerCase().startsWith("coord")) {
    ...
}
else if (jobtype.toLowerCase().startsWith("bundle")) {
    ...
}
{noformat}
and in [V1JobsServlet|https://github.com/apache/oozie/blob/master/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java#L302-L310]:
{noformat}
if (jobtype.contains("wf")) {
    json = getWorkflowJobs(request);
}
else if (jobtype.contains("coord")) {
    json = getCoordinatorJobs(request);
}
else if (jobtype.contains("bundle")) {
    json = getBundleJobs(request);
}
{noformat}
This has several strange side effects:
 * It is possible to filter using jobtypes like: {{wfxxx}}, {{coordxxxx}}, {{bundlexxxx, xxxwfxxx}}.
 * It is possible to filter for coordinators using {{xxxcoordxxx}} in REST API but it's not working in CLI.
 * It is possible to filter for {{coordxxxxwf}}, this will filter for workflows.
 * Filtering for {{bundlecoord}} will list the bundles in CLI and it will list the coordinators in the REST API.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)