public CompletableThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> queue) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, queue, new CompletableRejectedExecutionHandler()); // now that super() has been called we can reference "this" to add it to // the RejectedExecutionHandler ((CompletableRejectedExecutionHandler) getRejectedExecutionHandler()).setThreadPool(this); }
@Override public WriteBatcher withJobId(String jobId) { requireNotInitialized(); super.withJobId(jobId); return this; }
@Override public QueryBatcher withJobName(String jobName) { requireNotStarted(); super.withJobName(jobName); return this; }
public JobReport getJobReport(JobTicket ticket) { if ( ticket instanceof JobTicketImpl ) { JobTicketImpl ticketImpl = (JobTicketImpl) ticket; if ( ticketImpl.getJobType() == JobType.WRITE_BATCHER ) { return new JobReportImpl(ticketImpl.getWriteBatcher()); } else if ( ticketImpl.getJobType() == JobType.QUERY_BATCHER ) { return new JobReportImpl(ticketImpl.getQueryBatcher()); } } return null; }
@Override public QueryBatcher newQueryBatcher(Iterator<String> iterator) { if ( iterator == null ) throw new IllegalArgumentException("iterator must not be null"); return newQueryBatcher(new QueryBatcherImpl(iterator, this, getForestConfig())); }
@Override public boolean awaitCompletion(long timeout, TimeUnit unit) throws InterruptedException { requireJobStarted(); return threadPool.awaitTermination(timeout, unit); }
@Override public WriteBatcher withThreadCount(int threadCount) { requireNotInitialized(); super.withThreadCount(threadCount); return this; }
@Override public QueryBatcher withBatchSize(int batchSize) { requireNotStarted(); super.withBatchSize(batchSize); return this; }
@Override public QueryBatcher withJobId(String jobId) { requireNotStarted(); super.withJobId(jobId); return this; }
@Override public WriteBatcher withJobName(String jobName) { requireNotInitialized(); super.withJobName(jobName); return this; }
@Override public WriteBatcher withBatchSize(int batchSize) { requireNotInitialized(); super.withBatchSize(batchSize); return this; }
@Override public DatabaseClient getPrimaryClient() { return ((DataMovementManagerImpl) getMoveMgr()).getPrimaryClient(); }
@Override public DatabaseClient getPrimaryClient() { return getMoveMgr().getPrimaryClient(); }
@Override public JobTicket getJobTicket() { requireJobStarted(); return jobTicket; }
@Override public Calendar getJobEndTime() { if(! this.isStopped()) { return null; } else { return jobEndTime; } }
@Override public QueryBatcher newQueryBatcher(RawCombinedQueryDefinition query) { return newQueryBatcherImpl(query); } @Override
@Override public QueryBatchImpl withItems(String[] items) { super.withItems(items); return this; }
@Override public QueryBatchImpl withTimestamp(Calendar timestamp) { super.withTimestamp(timestamp); return this; }
@Override public QueryBatchImpl withJobBatchNumber(long jobBatchNumber) { super.withJobBatchNumber(jobBatchNumber); return this; }
@Override public QueryBatchImpl withJobTicket(JobTicket jobTicket) { super.withJobTicket(jobTicket); return this; }