@Test public void testExecuteWithNoPredicateSuccess() throws Exception { String result = "{\"id\":1,\"state\":\"starting\",\"appId\":null," + "\"appInfo\":{\"driverLogUrl\":null," + "\"sparkUiUrl\":null},\"log\":[]}"; JobExecutionContext context = mock(JobExecutionContext.class); JobInstanceBean instance = createJobInstance(); GriffinMeasure measure = createGriffinMeasure("measureName"); JobDetail jd = createJobDetail(JsonUtil.toJson(measure), ""); given(context.getJobDetail()).willReturn(jd); given(jobInstanceRepo.findByPredicateName(Matchers.anyString())) .willReturn(instance); sparkSubmitJob.execute(context); verify(context, times(1)).getJobDetail(); verify(jobInstanceRepo, times(1)).findByPredicateName( Matchers.anyString()); }
@Override public void execute(JobExecutionContext context) { JobDetail jd = context.getJobDetail(); try { if (isNeedLivyQueue) { livyTaskSubmitHelper.addTaskToWaitingQueue(jd); } else { saveJobInstance(jd); } } catch (Exception e) { LOGGER.error("Post spark task ERROR.", e); } }
SparkSubmitJob implements Job { @Override public void execute(JobExecutionContext context) { JobDetail jd = context.getJobDetail(); try { if (isNeedLivyQueue) { livyTaskSubmitHelper.addTaskToWaitingQueue(jd); } else { saveJobInstance(jd); } } catch (Exception e) { LOGGER.error("Post spark task ERROR.", e); } } }
SparkSubmitJob implements Job { @Override public void execute(JobExecutionContext context) { JobDetail jd = context.getJobDetail(); try { if (isNeedLivyQueue) { livyTaskSubmitHelper.addTaskToWaitingQueue(jd); } else { saveJobInstance(jd); } } catch (Exception e) { LOGGER.error("Post spark task ERROR.", e); } }  }
SparkSubmitJob implements Job { @Override public void execute(JobExecutionContext context) { JobDetail jd = context.getJobDetail(); try { if (isNeedLivyQueue) { livyTaskSubmitHelper.addTaskToWaitingQueue(jd); } else { saveJobInstance(jd); } } catch (Exception e) { LOGGER.error("Post spark task ERROR.", e); } }  @Override void execute(JobExecutionContext context); }
SparkSubmitJob implements Job { @Override public void execute(JobExecutionContext context) { JobDetail jd = context.getJobDetail(); try { if (isNeedLivyQueue) { livyTaskSubmitHelper.addTaskToWaitingQueue(jd); } else { saveJobInstance(jd); } } catch (Exception e) { LOGGER.error("Post spark task ERROR.", e); } }  @Override void execute(JobExecutionContext context);  }