@Override public Future<Void> writeResult(SegmentedScanResult result){
  Future<Void> jobSubmission=null;
  List<BatchWriteItemRequest> batches=splitResultIntoBatches(result.getScanResult(),tableName);
  Iterator<BatchWriteItemRequest> batchesIterator=batches.iterator();
  while (batchesIterator.hasNext()) {
    try {
      jobSubmission=exec.submit(new DynamoDBConsumerWorker(batchesIterator.next(),client,rateLimiter,tableName));
    }
 catch (    NullPointerException npe) {
      throw new NullPointerException("Thread pool not initialized for LogStashExecutor");
    }
  }
  return jobSubmission;
}

@ Override public Future < Void > writeResult ( SegmentedScanResult result ) { Future < Void > jobSubmission = null ; List < BatchWriteItemRequest > batches = splitResultIntoBatches ( result . getScanResult ( ) , tableName ) ; Iterator < BatchWriteItemRequest > batchesIterator = batches . iterator ( ) ; while ( batchesIterator . hasNext ( ) ) { try { jobSubmission = exec . submit ( new DynamoDBConsumerWorker ( batchesIterator . next ( ) , client , rateLimiter , tableName ) ) ; } catch ( NullPointerException npe ) { throw new NullPointerException ( "Thread pool not initialized for LogStashExecutor" ) ; } } return jobSubmission ; }
calls splitresultintobatches to turn the segmentedscanresult into several batchwriteitemrequests and then submits them as individual jobs to the executorservice .
