Search in sources :

Example 1 with LocalOozieClientCoord

use of org.apache.oozie.LocalOozieClientCoord in project oozie by apache.

the class LocalOozie method getClientCoord.

/**
 * 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 coordinator.
 * @return a {@link org.apache.oozie.client.OozieClient} for LocalOozie
 *         configured for the given user.
 */
public static OozieClient getClientCoord(String user) {
    if (!localOozieActive) {
        throw new IllegalStateException("LocalOozie is not initialized");
    }
    ParamChecker.notEmpty(user, "user");
    CoordinatorEngine coordEngine = Services.get().get(CoordinatorEngineService.class).getCoordinatorEngine(user);
    return new LocalOozieClientCoord(coordEngine);
}
Also used : CoordinatorEngine(org.apache.oozie.CoordinatorEngine) LocalOozieClientCoord(org.apache.oozie.LocalOozieClientCoord) CoordinatorEngineService(org.apache.oozie.service.CoordinatorEngineService)

Aggregations

CoordinatorEngine (org.apache.oozie.CoordinatorEngine)1 LocalOozieClientCoord (org.apache.oozie.LocalOozieClientCoord)1 CoordinatorEngineService (org.apache.oozie.service.CoordinatorEngineService)1