@ThreadSafe public class FuseFileInStream extends Object implements FuseFileStream
FuseFileStream
for read only operations against an Alluxio uri.FuseFileStream.Factory
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream.
|
static FuseFileInStream |
create(FileSystem fileSystem,
AlluxioURI uri,
Optional<URIStatus> status)
Creates a
FuseFileInStream . |
void |
flush()
Flushes the stream.
|
long |
getFileLength()
Gets the file length.
|
int |
read(ByteBuffer buf,
long size,
long offset)
Reads data from the stream.
|
void |
truncate(long size)
Truncates the file to the given size.
|
void |
write(ByteBuffer buf,
long size,
long offset)
Writes data to the stream.
|
public static FuseFileInStream create(FileSystem fileSystem, AlluxioURI uri, Optional<URIStatus> status)
FuseFileInStream
.fileSystem
- the file systemuri
- the alluxio uristatus
- the uri status, null if not uri does not existFuseFileInStream
public int read(ByteBuffer buf, long size, long offset)
FuseFileStream
read
in interface FuseFileStream
buf
- the byte buffer to read data tosize
- the size to readoffset
- the offset of the target stream to begin readingpublic void write(ByteBuffer buf, long size, long offset)
FuseFileStream
write
in interface FuseFileStream
buf
- the byte buffer to read data from and write to the streamsize
- the size to writeoffset
- the offset to writepublic long getFileLength()
FuseFileStream
getFileLength
in interface FuseFileStream
public void flush()
FuseFileStream
flush
in interface FuseFileStream
public void truncate(long size) throws UnsupportedOperationException
FuseFileStream
truncate
in interface FuseFileStream
size
- the truncate sizeUnsupportedOperationException
public void close()
FuseFileStream
close
in interface FuseFileStream
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.