DatabaseClient client = currentClientList.get(clientIndex); batch = batch.withJobBatchNumber(currentBatchNumber) .withClient(client) .withJobResultsSoFar(resultsSoFar.addAndGet(uris.size())) .withItems(uris.toArray(new String[uris.size()]));
QueryBatchImpl batch = new QueryBatchImpl() .withItems(new String[0]) .withClient(clientList.get().get(0)) .withBatcher(batcher) .withTimestamp(Calendar.getInstance())
QueryBatchImpl batch = new QueryBatchImpl() .withBatcher(batcher) .withClient(client) .withTimestamp(queryStart) .withJobTicket(getJobTicket())
).lines().collect(Collectors.toList()); QueryBatchImpl processedBatch = new QueryBatchImpl() .withClient( batch.getClient() ) .withItems( responseUris.toArray(new String[responseUris.size()]) ) .withTimestamp( batch.getTimestamp() )
@Override public void retryListener(QueryBatch batch, QueryBatchListener queryBatchListener) { // We get the batch and modify the client alone in order to make use // of the new forest client in case if the original host is unavailable. DatabaseClient client = null; Forest[] forests = batch.getBatcher().getForestConfig().listForests(); for(Forest forest : forests) { if(forest.equals(batch.getForest())) client = getMoveMgr().getForestClient(forest); } QueryBatchImpl retryBatch = new QueryBatchImpl() .withClient( client ) .withBatcher( batch.getBatcher() ) .withTimestamp( batch.getTimestamp() ) .withServerTimestamp( batch.getServerTimestamp() ) .withItems( batch.getItems() ) .withJobTicket( batch.getJobTicket() ) .withJobBatchNumber( batch.getJobBatchNumber() ) .withJobResultsSoFar( batch.getJobResultsSoFar() ) .withForestBatchNumber( batch.getForestBatchNumber() ) .withForestResultsSoFar( batch.getForestResultsSoFar() ) .withForest( batch.getForest() ) .withJobTicket( batch.getJobTicket() ); queryBatchListener.processEvent(retryBatch); }