Copilot commented on code in PR #3569:
URL: https://github.com/apache/fluss/pull/3569#discussion_r3607514253
##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/utils/FlinkConnectorOptionsUtils.java:
##########
@@ -202,14 +203,26 @@ public static long parseTimestamp(String timestampStr,
String optionKey, ZoneId
public static String getClientScannerIoTmpDir(
Configuration flussConf,
org.apache.flink.configuration.Configuration flinkConfig) {
if (!flussConf.contains(CLIENT_SCANNER_IO_TMP_DIR)) {
- if (flinkConfig.contains(TMP_DIRS)) {
- // pass flink io tmp dir to fluss client.
- return new File(flinkConfig.get(CoreOptions.TMP_DIRS),
"/fluss").getAbsolutePath();
- }
+ return getFlinkIoTmpDir(flinkConfig);
}
return flussConf.getString(CLIENT_SCANNER_IO_TMP_DIR);
}
+ public static String getFlinkIoTmpDir(
+ org.apache.flink.configuration.Configuration flinkConfig) {
+ if (flinkConfig.contains(TMP_DIRS)) {
+ return new File(flinkConfig.get(CoreOptions.TMP_DIRS),
"/fluss").getAbsolutePath();
+ }
+ return System.getProperty("java.io.tmpdir") + "/fluss";
+ }
Review Comment:
`getFlinkIoTmpDir` builds the child path using `new File(parent, "/fluss")`.
Because the child starts with a leading '/', Java treats it as an absolute path
and ignores the parent directory on Unix-like systems, which can yield `/fluss`
instead of `<tmp>/fluss` and defeats the intent of using Flink's tmp dirs.
--
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]