use of org.apache.oozie.executor.jpa.BulkJPAExecutor in project oozie by apache.
the class ZKUUIDServiceWithException method testBulkJobForZKUUIDService.
public void testBulkJobForZKUUIDService() throws Exception {
Services service = Services.get();
ZKUUIDService uuid = new ZKUUIDService();
try {
setSystemProperty(UUIDService.CONF_GENERATOR, "counter");
uuid.init(service);
String bundleId = uuid.generateId(ApplicationType.BUNDLE);
BundleJobBean bundle = createBundleJob(bundleId, Job.Status.SUCCEEDED, false);
JPAService jpaService = Services.get().get(JPAService.class);
BundleJobInsertJPAExecutor bundleInsertjpa = new BundleJobInsertJPAExecutor(bundle);
jpaService.execute(bundleInsertjpa);
addCoordForBulkMonitor(bundleId);
String request = "bundle=" + bundleId;
BulkJPAExecutor bulkjpa = new BulkJPAExecutor(BundleEngine.parseBulkFilter(request), 1, 1);
try {
BulkResponseInfo response = jpaService.execute(bulkjpa);
assertEquals(response.getResponses().get(0).getBundle().getId(), bundleId);
} catch (JPAExecutorException jex) {
// should not throw exception as this case is now supported
fail();
}
} finally {
uuid.destroy();
}
}
use of org.apache.oozie.executor.jpa.BulkJPAExecutor in project oozie by apache.
the class BulkJobsXCommand method execute.
/* (non-Javadoc)
* @see org.apache.oozie.command.XCommand#execute()
*/
@Override
protected BulkResponseInfo execute() throws CommandException {
try {
JPAService jpaService = Services.get().get(JPAService.class);
BulkResponseInfo bulk = null;
if (jpaService != null) {
bulk = jpaService.execute(new BulkJPAExecutor(bulkParams, start, len));
} else {
LOG.error(ErrorCode.E0610);
}
return bulk;
} catch (XException ex) {
throw new CommandException(ex);
}
}
Aggregations