use of io.trino.spi.connector.ConnectorSplitSource.ConnectorSplitBatch in project trino by trinodb.
the class TestBackgroundHiveSplitLoader method drainSplits.
private static List<HiveSplit> drainSplits(HiveSplitSource source) throws Exception {
ImmutableList.Builder<HiveSplit> splits = ImmutableList.builder();
while (!source.isFinished()) {
ConnectorSplitBatch batch;
try {
batch = source.getNextBatch(NOT_PARTITIONED, 100).get();
} catch (ExecutionException e) {
throwIfUnchecked(e.getCause());
throw e;
}
batch.getSplits().stream().map(HiveSplit.class::cast).forEach(splits::add);
}
return splits.build();
}
Aggregations