Source:
<code>public static HiveSplitSource allAtOnce( ConnectorSession session, String databaseName, String tableName, TupleDomain<? extends ColumnHandle> compactEffectivePredicate, int maxInitialSplits, int maxOutstandingSplits, DataSize maxOutstandingSplitsSize, HiveSplitLoader splitLoader, Executor executor, CounterStat highMemorySplitSourceCounter) { AtomicReference<State> stateReference = new AtomicReference<>(State.initial()); return new HiveSplitSource( session, databaseName, tableName, compactEffectivePredicate, new PerBucket() { private final AsyncQueue<InternalHiveSplit> queue = new AsyncQueue<>(maxOutstandingSplits, executor); @Override public ListenableFuture<?> offer(OptionalInt bucketNumber, InternalHiveSplit connectorSplit) { return queue.offer(connectorSplit); } @Override public ListenableFuture<List<ConnectorSplit>> borrowBatchAsync(OptionalInt bucketNumber, int maxSize, Function<List<InternalHiveSplit>, BorrowResult<InternalHiveSplit, List<ConnectorSplit>>> function) { checkArgument(!bucketNumber.isPresent()); return queue.borrowBatchAsync(maxSize, function); } @Override public void finish() { queue.finish(); } @Override public boolean isFinished(OptionalInt bucketNumber) { checkArgument(!bucketNumber.isPresent()); return queue.isFinished(); } @Override public int rewind(OptionalInt bucketNumber) { <START> throw new UnsupportedOperationException("rewind is not supported for unrewindable split source"); <END> } }, maxInitialSplits, maxOutstandingSplitsSize, splitLoader, stateReference, highMemorySplitSourceCounter); }</code><technical_language>rewind is supported for bucketed split source</technical_language>

Target:
public static HiveSplitSource allAtOnce( ConnectorSession session, String databaseName, String tableName, TupleDomain<? extends ColumnHandle> compactEffectivePredicate, int maxInitialSplits, int maxOutstandingSplits, DataSize maxOutstandingSplitsSize, HiveSplitLoader splitLoader, Executor executor, CounterStat highMemorySplitSourceCounter) { AtomicReference<State> stateReference = new AtomicReference<>(State.initial()); return new HiveSplitSource( session, databaseName, tableName, compactEffectivePredicate, new PerBucket() { private final AsyncQueue<InternalHiveSplit> queue = new AsyncQueue<>(maxOutstandingSplits, executor); @Override public ListenableFuture<?> offer(OptionalInt bucketNumber, InternalHiveSplit connectorSplit) { return queue.offer(connectorSplit); } @Override public ListenableFuture<List<ConnectorSplit>> borrowBatchAsync(OptionalInt bucketNumber, int maxSize, Function<List<InternalHiveSplit>, BorrowResult<InternalHiveSplit, List<ConnectorSplit>>> function) { checkArgument(!bucketNumber.isPresent()); return queue.borrowBatchAsync(maxSize, function); } @Override public void noMoreSplits() { queue.finish(); } @Override public boolean isFinished(OptionalInt bucketNumber) { checkArgument(!bucketNumber.isPresent()); return queue.isFinished(); } @Override public int rewind(OptionalInt bucketNumber) { throw new UnsupportedOperationException("rewind is not supported for non bucketed split source"); } }, maxInitialSplits, maxOutstandingSplitsSize, splitLoader, stateReference, highMemorySplitSourceCounter); }