T1 - the concrete input stream subclassT2 - the concrete output stream subclass@NotThreadSafe
public final class OpenFileEntry<T1 extends java.io.InputStream,T2 extends java.io.OutputStream>
extends java.lang.Object
implements java.io.Closeable
AlluxioFuseFileSystem) to check that.
This mechanism is preferred over more complex sub-classing to avoid useless casts or type checks
for every read/write call, which happen quite often.| Constructor and Description |
|---|
OpenFileEntry(long id,
java.lang.String path,
T1 in,
T2 out)
Constructs a new
OpenFileEntry for an Alluxio file. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying open streams.
|
long |
getId() |
T1 |
getIn()
Gets the opened input stream for this open file entry.
|
T2 |
getOut()
Gets the opened output stream for this open file entry.
|
java.lang.String |
getPath() |
long |
getWriteOffset() |
void |
setPath(java.lang.String path)
Sets the path of the file.
|
void |
setWriteOffset(long offset)
Sets the offset of the next write.
|
public OpenFileEntry(long id,
java.lang.String path,
T1 in,
T2 out)
OpenFileEntry for an Alluxio file.id - the id of the filepath - the path of the filein - the input stream of the fileout - the output stream of the filepublic long getId()
public java.lang.String getPath()
@Nullable public T1 getIn()
null
if the file is not open for reading.@Nullable public T2 getOut()
null
if the file is not open for writing.public long getWriteOffset()
public void setPath(java.lang.String path)
path - the new path of the filepublic void setWriteOffset(long offset)
offset - the new offset of the next writepublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2021. All Rights Reserved.