rdblue commented on a change in pull request #3817:
URL: https://github.com/apache/iceberg/pull/3817#discussion_r799680233



##########
File path: 
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSource.java
##########
@@ -247,6 +265,27 @@ int inferParallelism(FlinkInputFormat format, ScanContext 
context) {
       parallelism = Math.max(1, parallelism);
       return parallelism;
     }
+
+    boolean localityEnabled() {
+      Boolean localityConfig =
+          this.exposeLocality != null ? this.exposeLocality :
+              
readableConfig.get(FlinkConfigOptions.TABLE_EXEC_ICEBERG_EXPOSE_SPLIT_LOCALITY_INFO);
+
+      if (localityConfig != null && !localityConfig) {
+        return false;
+      }
+      FileIO fileIO = table.io();
+      if (fileIO instanceof HadoopFileIO) {
+        HadoopFileIO hadoopFileIO = (HadoopFileIO) fileIO;
+        try {
+          String scheme = new 
Path(table.location()).getFileSystem(hadoopFileIO.getConf()).getScheme();
+          return FILE_SYSTEM_SUPPORT_LOCALITY.contains(scheme);
+        } catch (IOException e) {
+          LOG.warn("Failed to determine whether the locality information can 
be exposed for table: {}", table, e);
+        }
+      }
+      return false;

Review comment:
       Style: this also needs a new line to separate the control flow from this 
statement.




-- 
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]

Reply via email to