public static ListenableFuture<SplitBatch> fetchNextBatchAsync( SplitSource splitSource, int min, int max, ConnectorPartitionHandle partitionHandle, Lifespan lifespan) { GetNextBatch getNextBatch = new GetNextBatch(splitSource, min, max, partitionHandle, lifespan); ListenableFuture<?> future = getNextBatch.fetchSplits(); return Futures.transform(future, ignored -> new SplitBatch(getNextBatch.splits, getNextBatch.noMoreSplits), directExecutor()); }