@InterfaceAudience.Public @InterfaceStability.Unstable public final class WrappedIO extends Object
The intent is to avoid the need for complex reflection operations including wrapping of parameter classes, direct instantiation of new classes etc.
Modifier and Type | Method and Description |
---|---|
static List<Map.Entry<Path,String>> |
bulkDelete_delete(FileSystem fs,
Path base,
Collection<Path> paths)
Delete a list of files/objects.
|
static int |
bulkDelete_pageSize(FileSystem fs,
Path path)
Get the maximum number of objects/files to delete in a single request.
|
static void |
byteBufferPositionedReadable_readFully(InputStream in,
long position,
ByteBuffer buf)
Delegate to
ByteBufferPositionedReadable.read(long, ByteBuffer) . |
static boolean |
byteBufferPositionedReadable_readFullyAvailable(InputStream in)
Probe to see if the input stream is an instance of ByteBufferPositionedReadable.
|
static Path |
fileSystem_getEnclosingRoot(FileSystem fs,
Path path)
Return path of the enclosing root for a given path.
|
static FSDataInputStream |
fileSystem_openFile(FileSystem fs,
Path path,
String policy,
FileStatus status,
Long length,
Map<String,String> options)
OpenFile assistant, easy reflection-based access to
FileSystem.openFile(Path) and blocks
awaiting the operation completion. |
static boolean |
pathCapabilities_hasPathCapability(Object fs,
Path path,
String capability)
Does a path have a given capability?
Calls
PathCapabilities.hasPathCapability(Path, String) ,
mapping IOExceptions to false. |
static boolean |
streamCapabilities_hasCapability(Object object,
String capability)
Does an object implement
StreamCapabilities and, if so,
what is the result of the probe for the capability?
Calls StreamCapabilities.hasCapability(String) , |
public static int bulkDelete_pageSize(FileSystem fs, Path path)
fs
- filesystempath
- path to delete under.UnsupportedOperationException
- bulk delete under that path is not supported.IllegalArgumentException
- path not valid.UncheckedIOException
- if an IOE was raised.public static List<Map.Entry<Path,String>> bulkDelete_delete(FileSystem fs, Path base, Collection<Path> paths)
base
.fs
- filesystembase
- path to delete under.paths
- list of paths which must be absolute and under the base path.UnsupportedOperationException
- bulk delete under that path is not supported.UncheckedIOException
- if an IOE was raised.IllegalArgumentException
- if a path argument is invalid.public static boolean pathCapabilities_hasPathCapability(Object fs, Path path, String capability)
PathCapabilities.hasPathCapability(Path, String)
,
mapping IOExceptions to false.fs
- filesystempath
- path to query the capability of.capability
- non-null, non-empty string to query the path for support.IllegalArgumentException
- invalid argumentspublic static boolean streamCapabilities_hasCapability(Object object, String capability)
StreamCapabilities
and, if so,
what is the result of the probe for the capability?
Calls StreamCapabilities.hasCapability(String)
,object
- object to probecapability
- capability string@InterfaceStability.Stable public static FSDataInputStream fileSystem_openFile(FileSystem fs, Path path, String policy, @Nullable FileStatus status, @Nullable Long length, @Nullable Map<String,String> options)
FileSystem.openFile(Path)
and blocks
awaiting the operation completion.fs
- filesystempath
- pathpolicy
- read policystatus
- optional file statuslength
- optional file lengthoptions
- nullable map of other optionsUncheckedIOException
- if an IOE was raised.public static Path fileSystem_getEnclosingRoot(FileSystem fs, Path path) throws IOException
fs
- filesystempath
- file path to find the enclosing root path forIOException
- early checks like failure to resolve path cause IO failurespublic static void byteBufferPositionedReadable_readFully(InputStream in, long position, ByteBuffer buf)
ByteBufferPositionedReadable.read(long, ByteBuffer)
.in
- input streamposition
- position within filebuf
- the ByteBuffer to receive the results of the read operation.
Note: that is the default behaviour of FSDataInputStream.readFully(long, ByteBuffer)
.public static boolean byteBufferPositionedReadable_readFullyAvailable(InputStream in)
in
- input streamCopyright © 2024 Apache Software Foundation. All rights reserved.