use of org.apache.oozie.store.StoreException in project oozie by apache.
the class TestCoordELExtensions method checkCoordAction.
protected CoordinatorActionBean checkCoordAction(String actionId) throws StoreException {
try {
CoordinatorActionBean action = getCoordinatorAction(actionId);
assertEquals("file://#testDir/2009/03/06/00/_SUCCESS#file://#testDir/2009/03/05/23/_SUCCESS", action.getMissingDependencies());
return action;
} catch (Exception se) {
se.printStackTrace();
fail("Action ID " + actionId + " was not stored properly in db");
}
return null;
}
use of org.apache.oozie.store.StoreException in project oozie by apache.
the class OozieDBExportCLI method queryAllDBTables.
private static void queryAllDBTables(String filename) throws StoreException, IOException {
EntityManager manager = null;
ZipOutputStream zos = null;
File file = null;
try {
file = new File(filename);
zos = new ZipOutputStream(new FileOutputStream(file));
zos.setLevel(1);
manager = Services.get().get(JPAService.class).getEntityManager();
manager.setFlushMode(FlushModeType.COMMIT);
int infoSize = exportTableToJSON(manager.createNativeQuery(GET_DB_VERSION), zos, OOZIEDB_SYS_INFO_JSON);
System.out.println(infoSize + " rows exported from OOZIE_SYS");
int wfjSize = exportTableToJSON(manager.createQuery(GET_WORKFLOW_JOBS), zos, OOZIEDB_WF_JSON);
System.out.println(wfjSize + " rows exported from WF_JOBS");
int wfaSize = exportTableToJSON(manager.createQuery(GET_WORKFLOW_ACTIONS), zos, OOZIEDB_AC_JSON);
System.out.println(wfaSize + " rows exported from WF_ACTIONS");
int cojSize = exportTableToJSON(manager.createQuery(GET_COORD_JOBS), zos, OOZIEDB_CJ_JSON);
System.out.println(cojSize + " rows exported from COORD_JOBS");
int coaSize = exportTableToJSON(manager.createQuery(GET_COORD_ACTIONS), zos, OOZIEDB_CA_JSON);
System.out.println(coaSize + " rows exported from COORD_ACTIONS");
int bnjSize = exportTableToJSON(manager.createQuery(GET_BUNDLE_JOBS), zos, OOZIEDB_BNJ_JSON);
System.out.println(bnjSize + " rows exported from BUNDLE_JOBS");
int bnaSize = exportTableToJSON(manager.createQuery(GET_BUNDLE_ACIONS), zos, OOZIEDB_BNA_JSON);
System.out.println(bnaSize + " rows exported from BUNDLE_ACTIONS");
int slaRegSize = exportTableToJSON(manager.createQuery(GET_SLA_REGISTRATIONS), zos, OOZIEDB_SLAREG_JSON);
System.out.println(slaRegSize + " rows exported from SLA_REGISTRATION");
int ssSize = exportTableToJSON(manager.createQuery(GET_SLA_SUMMARYS), zos, OOZIEDB_SLASUM_JSON);
System.out.println(ssSize + " rows exported from SLA_SUMMARY");
} catch (Exception e) {
System.err.println("Error during dump creation: " + e.getMessage());
System.err.println();
e.printStackTrace(System.err);
System.err.println();
if (file != null) {
file.delete();
}
System.exit(1);
} finally {
IOUtils.closeSafely(zos);
if (manager != null) {
manager.close();
}
}
}
Aggregations