use of org.apache.oozie.client.BundleJob in project oozie by apache.
the class OozieCLI method printBundleJobs.
@VisibleForTesting
void printBundleJobs(List<BundleJob> jobs, String timeZoneId, boolean verbose) throws IOException {
if (jobs != null && jobs.size() > 0) {
if (verbose) {
System.out.println("Job ID" + VERBOSE_DELIMITER + "Bundle Name" + VERBOSE_DELIMITER + "Bundle Path" + VERBOSE_DELIMITER + "User" + VERBOSE_DELIMITER + "Group" + VERBOSE_DELIMITER + "Status" + VERBOSE_DELIMITER + "Kickoff" + VERBOSE_DELIMITER + "Pause" + VERBOSE_DELIMITER + "Created" + VERBOSE_DELIMITER + "Console URL");
System.out.println(RULER);
for (BundleJob job : jobs) {
System.out.println(maskIfNull(job.getId()) + VERBOSE_DELIMITER + maskIfNull(job.getAppName()) + VERBOSE_DELIMITER + maskIfNull(job.getAppPath()) + VERBOSE_DELIMITER + maskIfNull(job.getUser()) + VERBOSE_DELIMITER + maskIfNull(job.getGroup()) + VERBOSE_DELIMITER + job.getStatus() + VERBOSE_DELIMITER + maskDate(job.getKickoffTime(), timeZoneId, verbose) + VERBOSE_DELIMITER + maskDate(job.getPauseTime(), timeZoneId, verbose) + VERBOSE_DELIMITER + maskDate(job.getCreatedTime(), timeZoneId, verbose) + VERBOSE_DELIMITER + maskIfNull(job.getConsoleUrl()));
System.out.println(RULER);
}
} else {
System.out.println(String.format(BUNDLE_JOBS_FORMATTER, "Job ID", "Bundle Name", "Status", "Kickoff", "Created", "User", "Group"));
System.out.println(RULER);
for (BundleJob job : jobs) {
System.out.println(String.format(BUNDLE_JOBS_FORMATTER, maskIfNull(job.getId()), maskIfNull(job.getAppName()), job.getStatus(), maskDate(job.getKickoffTime(), timeZoneId, verbose), maskDate(job.getCreatedTime(), timeZoneId, verbose), maskIfNull(job.getUser()), maskIfNull(job.getGroup())));
System.out.println(RULER);
}
}
} else {
System.out.println("No Jobs match your criteria!");
}
}
use of org.apache.oozie.client.BundleJob in project oozie by apache.
the class TestOozieCLIMethods method createBulkResponse.
private static BulkResponse createBulkResponse(DataObject dtObject) {
BulkResponse bulkResponse = mock(BulkResponse.class);
BundleJob bundleJob = createBundleJob(dtObject);
when(bulkResponse.getBundle()).thenReturn(bundleJob);
CoordinatorAction coordinatorAction = createCoordinatorAction(dtObject);
when(bulkResponse.getAction()).thenReturn(coordinatorAction);
CoordinatorJob coordinatorJob = createCoordinatorJob(dtObject);
when(bulkResponse.getCoordinator()).thenReturn(coordinatorJob);
return bulkResponse;
}
Aggregations