@Override public QueryBatcherJobTicket run(DatabaseClient databaseClient) { QueryBatcherJobTicket ticket = super.run(databaseClient); if (ticket.getQueryBatcher().isStopped()) { try { if (fileFooter != null) { fileWriter.write(fileFooter); } } catch (IOException ie) { throw new RuntimeException(ie); } finally { try { this.fileWriter.close(); } catch (IOException e) { throw new RuntimeException(e); } } } return ticket; }
failureEventsCount = failureBatchesCount; successEventsCount = queryJobSuccessListener.getSuccessEventsCount(); isJobComplete = batcher.isStopped(); reportTimestamp = Calendar.getInstance(); jobStartTime = batcher.getJobStartTime();
assertEquals(threadCount, queryBatcher.getThreadCount()); assertEquals(queryBatcherJobId, queryBatcher.getJobId()); assertFalse("Job should not be stopped yet", queryBatcher.isStopped()); moveMgr.stopJob(ticket.getBatcher()); assertTrue("Job should be stopped now", queryBatcher.isStopped()); assertEquals("Batch JobTicket should match JobTicket from startJob", ticket, batchTicket.get());