Skip to content

Commit 1cc039e

Browse files
committed
Fix up load of hasPathCapability
Got signature wrong. Change-Id: I2923fa0eb11b4cf779eb7b7fc79dcc7917d14db1
1 parent 80dd0d8 commit 1cc039e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopFileIO.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,20 @@ public static FSDataInputStream openFile(final FileSystem fileSystem, final Path
9898
private static String readPolicies(final boolean randomIO) {
9999
return randomIO ? DynamicWrappedIO.PARQUET_READ_POLICIES : DynamicWrappedIO.SEQUENTIAL_READ_POLICIES;
100100
}
101+
102+
/**
103+
* Does a path have a given capability?
104+
* Calls {@code PathCapabilities#hasPathCapability(Path, String)},
105+
* mapping IOExceptions to false.
106+
* @param fs filesystem
107+
* @param path path to query the capability of.
108+
* @param capability non-null, non-empty string to query the path for support.
109+
* @return true if the capability is supported
110+
* under that part of the FS
111+
* false if the method is not loaded or the path lacks the capability.
112+
* @throws IllegalArgumentException invalid arguments
113+
*/
114+
public boolean hasPathCapability(Object fs, Path path, String capability) {
115+
return DynamicWrappedIO.instance().pathCapabilities_hasPathCapability(fs, path, capability);
116+
}
101117
}

parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/wrapped/io/DynamicWrappedIO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ public DynamicWrappedIO(String classname) {
175175
// path and stream capabilities
176176
pathCapabilitiesHasPathCapabilityMethod = loadStaticMethod(
177177
wrappedClass,
178-
Boolean.class,
178+
boolean.class,
179179
PATH_CAPABILITIES_HAS_PATH_CAPABILITY,
180-
FileSystem.class,
180+
Object.class,
181181
Path.class,
182182
String.class);
183183

0 commit comments

Comments
 (0)