use of org.apache.oozie.LocalOozieClient in project oozie by apache.
the class SubWorkflowActionExecutor method getWorkflowClient.
protected OozieClient getWorkflowClient(Context context, String oozieUri) {
OozieClient oozieClient;
if (oozieUri.equals(LOCAL)) {
WorkflowJobBean workflow = (WorkflowJobBean) context.getWorkflow();
String user = workflow.getUser();
String group = workflow.getGroup();
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(user);
oozieClient = new LocalOozieClient(dagEngine);
} else {
// TODO we need to add authToken to the WC for the remote case
oozieClient = new OozieClient(oozieUri);
}
return oozieClient;
}
use of org.apache.oozie.LocalOozieClient in project oozie by apache.
the class LocalOozie method getClient.
/**
* Return a {@link org.apache.oozie.client.OozieClient} for LocalOozie configured for a given user.
* <p>
* The following methods of the client are NOP in the returned instance:
* {@link org.apache.oozie.client.OozieClient#validateWSVersion},
* {@link org.apache.oozie.client.OozieClient#setHeader},
* {@link org.apache.oozie.client.OozieClient#getHeader},
* {@link org.apache.oozie.client.OozieClient#removeHeader},
* {@link org.apache.oozie.client.OozieClient#getHeaderNames},
* {@link org.apache.oozie.client.OozieClient#setSystemMode(OozieClient.SYSTEM_MODE)},
* {@link org.apache.oozie.client.OozieClient#getHeaders},
* {@link org.apache.oozie.client.OozieClient#getClientBuildVersion}.
*
* @param user user name to use in LocalOozie for running workflows.
* @return a {@link org.apache.oozie.client.OozieClient} for LocalOozie configured for the given user.
*/
public static OozieClient getClient(String user) {
if (!localOozieActive) {
throw new IllegalStateException("LocalOozie is not initialized");
}
ParamChecker.notEmpty(user, "user");
DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(user);
return new LocalOozieClient(dagEngine);
}
Aggregations