shangxinli commented on code in PR #14176:
URL: https://github.com/apache/iceberg/pull/14176#discussion_r2379062858
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkPlanningUtil.java:
##########
@@ -43,12 +44,21 @@ public static String[][] fetchBlockLocations(
FileIO io, List<? extends ScanTaskGroup<?>> taskGroups) {
String[][] locations = new String[taskGroups.size()][];
- Tasks.range(taskGroups.size())
- .stopOnFailure()
- .executeWith(ThreadPools.getWorkerPool())
- .run(index -> locations[index] = Util.blockLocations(io,
taskGroups.get(index)));
+ final ExecutorService workerPool =
+ ThreadPools.newWorkerPool("iceberg-local-plan-worker-pool",
ThreadPools.WORKER_THREAD_POOL_SIZE);
- return locations;
+ try {
+ Tasks.range(taskGroups.size())
+ .stopOnFailure()
+ .executeWith(workerPool)
+ .run(
Review Comment:
Nitpick: The lambda can be simplified since it's just a single statement.
No need for the extra braces and line breaks.
.run(index -> locations[index] = Util.blockLocations(io,
taskGroups.get(index)));
--
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]