/** * Return the info of the workflow jobs that match the filter. * <p/> * It returns the first 100 jobs that match the filter. * * @param filter job filter. Refer to the {@link OozieClient} for the filter syntax. * @return a list with the workflow jobs info, without node details. * @throws OozieClientException thrown if the jobs info could not be retrieved. */ public List<WorkflowJob> getJobsInfo(String filter) throws OozieClientException { return getJobsInfo(filter, 1, 50); }
/** * Return the info of the workflow jobs that match the filter. * <p/> * It returns the first 100 jobs that match the filter. * * @param filter job filter. Refer to the {@link OozieClient} for the filter syntax. * @return a list with the workflow jobs info, without node details. * @throws OozieClientException thrown if the jobs info could not be retrieved. */ public List<WorkflowJob> getJobsInfo(String filter) throws OozieClientException { return getJobsInfo(filter, 1, 50); }
/** * Return the info of the workflow jobs that match the filter. * <p> * It returns the first 100 jobs that match the filter. * * @param filter job filter. Refer to the {@link OozieClient} for the filter syntax. * @return a list with the workflow jobs info, without node details. * @throws OozieClientException thrown if the jobs info could not be retrieved. */ public List<WorkflowJob> getJobsInfo(String filter) throws OozieClientException { return getJobsInfo(filter, 1, 50); }
/** * Return the info of the workflow jobs that match the filter. * <p> * It returns the first 100 jobs that match the filter. * * @param filter job filter. Refer to the {@link OozieClient} for the filter syntax. * @return a list with the workflow jobs info, without node details. * @throws OozieClientException thrown if the jobs info could not be retrieved. */ public List<WorkflowJob> getJobsInfo(String filter) throws OozieClientException { return getJobsInfo(filter, 1, 50); }
OozieClient wc = new OozieClient(oozieUrl); wc.getJobsInfo("name=x"); wc.getJobsInfo("user=x"); wc.getJobsInfo("group=x"); wc.getJobsInfo("status=RUNNING"); wc.getJobsInfo("name=x;name=y"); wc.getJobsInfo("name="); fail(); wc.getJobsInfo("x=x"); fail(); wc.getJobsInfo("status=X"); fail();
public Void call() throws Exception { String oozieUrl = getContextURL(); OozieClient wc = new OozieClient(oozieUrl); List<WorkflowJob> list = wc.getJobsInfo(null); assertEquals(MockDagEngineService.INIT_WF_COUNT, list.size()); for (int i = 0; i < MockDagEngineService.INIT_WF_COUNT; i++) { assertNotNull(list.get(i).getAppPath()); assertEquals(MockDagEngineService.JOB_ID + i + MockDagEngineService.JOB_ID_END, list.get(i).getId()); } MockDagEngineService.reset(); list = wc.getJobsInfo("name=x", 3, 4); assertEquals(MockDagEngineService.INIT_WF_COUNT, list.size()); for (int i = 0; i < MockDagEngineService.INIT_WF_COUNT; i++) { assertNotNull(list.get(i).getAppPath()); assertEquals(MockDagEngineService.JOB_ID + i + MockDagEngineService.JOB_ID_END, list.get(i).getId()); } return null; } });
public void testGetJobsInfo() { OozieClient client = LocalOozie.getCoordClient(); try { client.getJobsInfo("foo"); fail("OozieClientException expected."); } catch (OozieClientException oce) { assertEquals(ErrorCode.E0301.toString(), oce.getErrorCode()); } try { client.getJobsInfo("foo", 0, 5); fail("OozieClientException expected."); } catch (OozieClientException oce) { assertEquals(ErrorCode.E0301.toString(), oce.getErrorCode()); } try { client.getJobInfo("foo-id"); fail("OozieClientException expected."); } catch (OozieClientException oce) { assertEquals(ErrorCode.E0301.toString(), oce.getErrorCode()); } }