/** * Run the Gobblin job. This call will block until the job is done. * @return a {@link JobExecutionResult} containing the result of the execution. */ @NotOnCli public JobExecutionResult run() throws InterruptedException, TimeoutException, ExecutionException { JobExecutionDriver jobDriver = runAsync(); return jobDriver.get(this.jobTimeout.getTimeout(), this.jobTimeout.getTimeUnit()); }
@Override public void onJobLaunch(JobExecutionDriver jobDriver) { if (this.filter.apply(jobDriver.getJobExecutionState().getJobSpec())) { this.delegate.onJobLaunch(jobDriver); } }
@Override public void run() { try { JobExecutionMonitor monitor = _jobLauncher.launchJob(new ResolvedJobSpec(_jobSpec, _instanceDriver)); if (!(monitor instanceof JobLauncherExecutionDriver.JobExecutionMonitorAndDriver)) { throw new UnsupportedOperationException(JobLauncherExecutionDriver.JobExecutionMonitorAndDriver.class.getName() + " is expected."); } JobExecutionDriver driver = ((JobLauncherExecutionDriver.JobExecutionMonitorAndDriver) monitor).getDriver(); _callbacksDispatcher.onJobLaunch(driver); driver.registerStateListener(new JobStateTracker()); ExecutorsUtils.newThreadFactory(Optional.of(_log), Optional.of("gobblin-instance-driver")).newThread(driver).start(); } catch (Throwable t) { _log.error("Job launch failed: " + t, t); } } }
private void checkLaunchJob(StandardGobblinInstanceLauncher instanceLauncher, JobSpec js1, GobblinInstanceDriver instance) throws TimeoutException, InterruptedException, ExecutionException { JobExecutionDriver jobDriver = null; JobExecutionMonitor monitor = instance.getJobLauncher().launchJob(js1); if (monitor instanceof JobLauncherExecutionDriver.JobExecutionMonitorAndDriver) { jobDriver = ((JobLauncherExecutionDriver.JobExecutionMonitorAndDriver) monitor).getDriver(); } new Thread(jobDriver).run(); JobExecutionResult jobResult = jobDriver.get(5, TimeUnit.SECONDS); Assert.assertTrue(jobResult.isSuccessful()); instanceLauncher.stopAsync(); instanceLauncher.awaitTerminated(5, TimeUnit.SECONDS); Assert.assertEquals(instance.getMetrics().getUpFlag().getValue().intValue(), 0); Assert.assertEquals(instance.getMetrics().getUptimeMs().getValue().longValue(), 0); }
@Override public void onJobLaunch(JobExecutionDriver jobDriver) { if (this.filter.apply(jobDriver.getJobExecutionState().getJobSpec())) { this.delegate.onJobLaunch(jobDriver); } }
@Override public void run() { try { JobExecutionMonitor monitor = _jobLauncher.launchJob(new ResolvedJobSpec(_jobSpec, _instanceDriver)); if (!(monitor instanceof JobLauncherExecutionDriver.JobExecutionMonitorAndDriver)) { throw new UnsupportedOperationException(JobLauncherExecutionDriver.JobExecutionMonitorAndDriver.class.getName() + " is expected."); } JobExecutionDriver driver = ((JobLauncherExecutionDriver.JobExecutionMonitorAndDriver) monitor).getDriver(); _callbacksDispatcher.onJobLaunch(driver); driver.registerStateListener(new JobStateTracker()); ExecutorsUtils.newThreadFactory(Optional.of(_log), Optional.of("gobblin-instance-driver")).newThread(driver).start(); } catch (Throwable t) { _log.error("Job launch failed: " + t, t); } } }
eventBus.post(new MySource.NextWorkUnit()); JobExecutionResult result = driver.get(5, TimeUnit.SECONDS); Assert.assertTrue(result.isSuccessful());
JobExecutionResult jobResult = jobDriver.get(5, TimeUnit.SECONDS);
JobExecutionResult jobResult = jobDriver.get(5, TimeUnit.SECONDS);
JobExecutionResult jobResult = jobDriver.get(5, TimeUnit.SECONDS);
/** * Run the Gobblin job. This call will block until the job is done. * @return a {@link JobExecutionResult} containing the result of the execution. */ @NotOnCli public JobExecutionResult run() throws InterruptedException, TimeoutException, ExecutionException { JobExecutionDriver jobDriver = runAsync(); return jobDriver.get(this.jobTimeout.getTimeout(), this.jobTimeout.getTimeUnit()); }