@ThreadSafe public final class UfsInputStreamCache extends Object
BlockReader
to read a block directly from UFS, and
optionally cache the block to the Alluxio worker if the whole block it is read.Constructor and Description |
---|
UfsInputStreamCache()
Constructs a new UFS input stream cache.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
acquire(UnderFileSystem ufs,
String path,
long fileId,
OpenOptions openOptions)
Acquires an input stream.
|
void |
release(InputStream inputStream)
Releases an input stream.
|
public UfsInputStreamCache()
public void release(InputStream inputStream) throws IOException
inputStream
- the input stream to releaseIOException
- when input stream fails to closepublic InputStream acquire(UnderFileSystem ufs, String path, long fileId, OpenOptions openOptions) throws IOException
ufs
- the under file systempath
- the path to the under storage filefileId
- the file idopenOptions
- the open optionsIOException
- if the input stream fails to openCopyright © 2023. All Rights Reserved.