/** * Remove a HTTP header from the workflow client instance. * * @param name header name. */ public void removeHeader(String name) { headers.remove(notEmpty(name, "name")); }
/** * Create a Workflow client instance. * * @param oozieUrl URL of the Oozie instance it will interact with. */ public OozieClient(String oozieUrl) { this.baseUrl = notEmpty(oozieUrl, "oozieUrl"); if (!this.baseUrl.endsWith("/")) { this.baseUrl += "/"; } }
/** * Get the value of a set HTTP header from the workflow instance. * * @param name header name. * @return header value, <code>null</code> if not set. */ public String getHeader(String name) { return headers.get(notEmpty(name, "name")); }
/** * Create a Workflow client instance. * * @param oozieUrl URL of the Oozie instance it will interact with. */ public OozieClient(String oozieUrl) { this.baseUrl = notEmpty(oozieUrl, "oozieUrl"); if (!this.baseUrl.endsWith("/")) { this.baseUrl += "/"; } }
/** * The equivalent to <file> tag in oozie's workflow xml. * * @param conf Configuration object. * @param file file HDFS path. A "#..." symbolic string can be appended to the path to specify symbolic link name. * For example, "/user/oozie/parameter_file#myparams". If no "#..." is specified, file name will be used as * symbolic link name. */ public void addFile(Properties conf, String file) { OozieClient.notEmpty(file, "file"); String files = conf.getProperty(FILES); conf.setProperty(FILES, files == null ? file : files + "," + file); }
JobMetadata(String jobId, String logRetrievalType, String logRetrievalScope, String metaType, String logFilter, PrintStream ps) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, metaType, RestConstants.JOB_LOG_TYPE_PARAM, logRetrievalType, RestConstants.JOB_LOG_SCOPE_PARAM, logRetrievalScope, RestConstants.LOG_FILTER_OPTION, logFilter)); printStream = ps; }
CoordJobInfo(String jobId, String filter, int start, int len, String order) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.JOB_SHOW_INFO, RestConstants.JOB_FILTER_PARAM, filter, RestConstants.OFFSET_PARAM, Integer.toString(start), RestConstants.LEN_PARAM, Integer.toString(len), RestConstants.ORDER_PARAM, order)); }
public UpdateCoord(String jobId, Properties conf, String jobActionDryrun, String showDiff) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_COORD_UPDATE, RestConstants.JOB_ACTION_DRYRUN, jobActionDryrun, RestConstants.JOB_ACTION_SHOWDIFF, showDiff)); this.conf = conf; }
JobInfo(String jobId, int start, int len) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.JOB_SHOW_INFO, RestConstants.OFFSET_PARAM, Integer.toString(start), RestConstants.LEN_PARAM, Integer.toString(len))); }
CoordIgnore(String jobId, String rerunType, String scope) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_IGNORE, RestConstants.JOB_COORD_RANGE_TYPE_PARAM, rerunType, RestConstants.JOB_COORD_SCOPE_PARAM, scope)); }
public CoordActionMissingDependencies(String jobId, String actionList, String dates, PrintStream ps) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.COORD_ACTION_MISSING_DEPENDENCIES, RestConstants.JOB_COORD_SCOPE_ACTION_LIST, actionList, RestConstants.JOB_COORD_SCOPE_DATE, dates)); this.printStream = ps; }
BundleRerun(String jobId, String coordScope, String dateScope, boolean refresh, boolean noCleanup) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_BUNDLE_ACTION_RERUN, RestConstants.JOB_BUNDLE_RERUN_COORD_SCOPE_PARAM, coordScope, RestConstants.JOB_BUNDLE_RERUN_DATE_SCOPE_PARAM, dateScope, RestConstants.JOB_COORD_RERUN_REFRESH_PARAM, Boolean.toString(refresh), RestConstants.JOB_COORD_RERUN_NOCLEANUP_PARAM, Boolean.toString(noCleanup))); }
BundleRerun(String jobId, String coordScope, String dateScope, boolean refresh, boolean noCleanup) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_BUNDLE_ACTION_RERUN, RestConstants.JOB_BUNDLE_RERUN_COORD_SCOPE_PARAM, coordScope, RestConstants.JOB_BUNDLE_RERUN_DATE_SCOPE_PARAM, dateScope, RestConstants.JOB_COORD_RERUN_REFRESH_PARAM, Boolean.toString(refresh), RestConstants.JOB_COORD_RERUN_NOCLEANUP_PARAM, Boolean.toString(noCleanup))); }
public CoordActionMissingDependencies(String jobId, String actionList, String dates, PrintStream ps) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.COORD_ACTION_MISSING_DEPENDENCIES, RestConstants.JOB_COORD_SCOPE_ACTION_LIST, actionList, RestConstants.JOB_COORD_SCOPE_DATE, dates)); this.printStream = ps; }
JobInfo(String jobId, int start, int len) { super("GET", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.JOB_SHOW_INFO, RestConstants.OFFSET_PARAM, Integer.toString(start), RestConstants.LEN_PARAM, Integer.toString(len))); }
WorkflowActionInfo(String actionId) { super("GET", RestConstants.JOB, notEmpty(actionId, "id"), prepareParams(RestConstants.JOB_SHOW_PARAM, RestConstants.JOB_SHOW_INFO)); }
/** * Set a HTTP header to be used in the WS requests by the workflow instance. * * @param name header name. * @param value header value. */ public void setHeader(String name, String value) { headers.put(notEmpty(name, "name"), notNull(value, "value")); }
CoordActionsKill(String jobId, String rangeType, String scope) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_KILL, RestConstants.JOB_COORD_RANGE_TYPE_PARAM, rangeType, RestConstants.JOB_COORD_SCOPE_PARAM, scope)); }
UpdateSLA(String action, String jobIds, String coordActions, String dates, String coords, String newSlaParams) { super("PUT", RestConstants.JOB, notEmpty(jobIds, "jobIds"), prepareParams(RestConstants.ACTION_PARAM, action, RestConstants.JOB_COORD_SCOPE_ACTION_LIST, coordActions, RestConstants.JOB_COORD_SCOPE_DATE, dates, RestConstants.COORDINATORS_PARAM, coords, RestConstants.JOB_CHANGE_VALUE, newSlaParams)); }
JobSubmit(String jobId, Properties conf) { super("PUT", RestConstants.JOB, notEmpty(jobId, "jobId"), prepareParams(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_RERUN, RestConstants.USER_PARAM, getUserName())); this.conf = notNull(conf, "conf"); this.generatedXml = null; }