hililiwei commented on a change in pull request #3817:
URL: https://github.com/apache/iceberg/pull/3817#discussion_r776912948
##########
File path:
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitGenerator.java
##########
@@ -22,25 +22,36 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.List;
+import java.util.stream.IntStream;
import org.apache.iceberg.CombinedScanTask;
import org.apache.iceberg.Table;
import org.apache.iceberg.TableProperties;
import org.apache.iceberg.TableScan;
import org.apache.iceberg.expressions.Expression;
+import org.apache.iceberg.hadoop.Util;
import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
class FlinkSplitGenerator {
private FlinkSplitGenerator() {
}
- static FlinkInputSplit[] createInputSplits(Table table, ScanContext context)
{
+ static FlinkInputSplit[] createInputSplits(Table table, ScanContext context,
boolean localityPreferred) {
List<CombinedScanTask> tasks = tasks(table, context);
- FlinkInputSplit[] splits = new FlinkInputSplit[tasks.size()];
- for (int i = 0; i < tasks.size(); i++) {
- splits[i] = new FlinkInputSplit(i, tasks.get(i));
- }
- return splits;
+
+ return IntStream.range(0, tasks.size()).parallel().mapToObj(i -> {
Review comment:
I read the Tasks, and it was well-designed and so impressive. Thanks for
guidance.
##########
File path:
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSplitGenerator.java
##########
@@ -22,25 +22,36 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.List;
+import java.util.stream.IntStream;
import org.apache.iceberg.CombinedScanTask;
import org.apache.iceberg.Table;
import org.apache.iceberg.TableProperties;
import org.apache.iceberg.TableScan;
import org.apache.iceberg.expressions.Expression;
+import org.apache.iceberg.hadoop.Util;
import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
class FlinkSplitGenerator {
private FlinkSplitGenerator() {
}
- static FlinkInputSplit[] createInputSplits(Table table, ScanContext context)
{
+ static FlinkInputSplit[] createInputSplits(Table table, ScanContext context,
boolean localityPreferred) {
List<CombinedScanTask> tasks = tasks(table, context);
- FlinkInputSplit[] splits = new FlinkInputSplit[tasks.size()];
- for (int i = 0; i < tasks.size(); i++) {
- splits[i] = new FlinkInputSplit(i, tasks.get(i));
- }
- return splits;
+
+ return IntStream.range(0, tasks.size()).parallel().mapToObj(i -> {
Review comment:
I read the `Tasks`, and it was well-designed and so impressive. Thanks
for guidance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]