presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/RaptorSplitManager.java/RaptorSplitManager/batchSupplier
class RaptorSplitManager:        private Supplier<ConnectorSplitBatch> batchSupplier(int maxSize)
        {
            return () -> {
                ImmutableList.Builder<ConnectorSplit> list = ImmutableList.builder();
                for (int i = 0; i < maxSize; i++) {
                    if (Thread.currentThread().isInterrupted()) {
                        throw new RuntimeException("Split batch fetch was interrupted");
                    }
                    if (!iterator.hasNext()) {
                        break;
                    }
                    list.add(createSplit(iterator.next()));
                }
                return new ConnectorSplitBatch(list.build(), isFinished());
            };
        }