Skip to content

Commit 29c1b37

Browse files
committed
ORC-1938: Update tools module to set fs.file.impl.disable.cache only for Java 22+
### What changes were proposed in this pull request? This PR aims to update `tools` module to set `fs.file.impl.disable.cache=true` only for Java 22+. ### Why are the changes needed? Recently, we successfully finished to refactor `tools` module for Java 25-ea support. Before releasing Apache ORC 2.2, we want to minimize any potential side-effects by applying new changes to the Java 22+ versions. - ORC-1926: Use `TestConf` interface in `tools` module - ORC-1927: Add Java `25-ea` test coverage for `tools` module - ORC-1931: Suppress Hadoop logs lower than ERROR level in `orc-tools` - ORC-1932: Use `setIfUnset` for `fs.defaultFS` and `fs.file.impl.disable.cache` ### How was this patch tested? Pass the CIs (with Java 25-ea tool tests) ### Was this patch authored or co-authored using generative AI tooling? No. Closes #2297 from dongjoon-hyun/ORC-1938. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent a3940f2 commit 29c1b37

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

java/tools/src/java/org/apache/orc/tools/ColumnSizes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ public static void main(Configuration conf, String[] args) throws Exception {
217217

218218
public static void main(String[] args) throws Exception {
219219
Configuration conf = new Configuration();
220-
conf.setIfUnset("fs.file.impl.disable.cache", "true");
220+
if (Runtime.version().feature() > 21) {
221+
conf.setIfUnset("fs.file.impl.disable.cache", "true");
222+
}
221223
main(conf, args);
222224
}
223225

java/tools/src/java/org/apache/orc/tools/Driver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public static void main(String[] args) throws Exception {
103103
System.exit(1);
104104
}
105105
Configuration conf = new Configuration();
106-
conf.setIfUnset("fs.file.impl.disable.cache", "true");
106+
if (Runtime.version().feature() > 21) {
107+
conf.setIfUnset("fs.file.impl.disable.cache", "true");
108+
}
107109
Properties confSettings = options.genericOptions.getOptionProperties("D");
108110
for(Map.Entry pair: confSettings.entrySet()) {
109111
conf.set(pair.getKey().toString(), pair.getValue().toString());

java/tools/src/java/org/apache/orc/tools/FileDump.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ public static void main(Configuration conf, String[] args) throws Exception {
142142

143143
public static void main(String[] args) throws Exception {
144144
Configuration conf = new Configuration();
145-
conf.setIfUnset("fs.file.impl.disable.cache", "true");
145+
if (Runtime.version().feature() > 21) {
146+
conf.setIfUnset("fs.file.impl.disable.cache", "true");
147+
}
146148
main(conf, args);
147149
}
148150

java/tools/src/java/org/apache/orc/tools/RowCount.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public static void main(Configuration conf, String[] args) throws Exception {
7373

7474
public static void main(String[] args) throws Exception {
7575
Configuration conf = new Configuration();
76-
conf.setIfUnset("fs.file.impl.disable.cache", "true");
76+
if (Runtime.version().feature() > 21) {
77+
conf.setIfUnset("fs.file.impl.disable.cache", "true");
78+
}
7779
main(conf, args);
7880
}
7981

0 commit comments

Comments
 (0)