public class TachyonFile extends Object implements Comparable<TachyonFile>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TachyonFile o) |
boolean |
equals(Object obj) |
long |
getBlockId(int blockIndex)
Return the block id of a block in the file, specified by blockIndex
|
long |
getBlockSizeByte()
Return the block's size of this file
|
ClientBlockInfo |
getClientBlockInfo(int blockIndex)
Get a ClientBlockInfo by the file id and block index
|
long |
getCreationTimeMs()
Return the creation time of this file
|
int |
getDiskReplication() |
InStream |
getInStream(ReadType readType)
Return the InStream of this file, use the specified read type.
|
String |
getLocalFilename(int blockIndex)
Returns the local filename for the block if that file exists on the local file system.
|
List<String> |
getLocationHosts()
Return the net address of all the location hosts
|
int |
getNumberOfBlocks()
Return the number of blocks the file has.
|
OutStream |
getOutStream(WriteType writeType)
Return the OutStream of this file, use the specified write type.
|
String |
getPath()
Return the path of this file in the Tachyon file system
|
Object |
getUFSConf()
To get the configuration object for UnderFileSystem.
|
int |
hashCode() |
boolean |
isComplete()
Return whether this file is complete or not
|
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
isInMemory()
Return whether the file is in memory or not.
|
long |
length() |
boolean |
needPin() |
boolean |
promoteBlock(int blockIndex)
Promote block back to top layer after access
|
TachyonByteBuffer |
readByteBuffer(int blockIndex)
Advanced API.
|
boolean |
recache() |
boolean |
rename(TachyonURI path)
Rename this file
|
void |
setUFSConf(Object conf)
To set the configuration object for UnderFileSystem.
|
String |
toString() |
public int compareTo(TachyonFile o)
compareTo
in interface Comparable<TachyonFile>
public long getBlockId(int blockIndex) throws IOException
blockIndex
- the index of the block in this fileIOException
public long getBlockSizeByte() throws IOException
IOException
public ClientBlockInfo getClientBlockInfo(int blockIndex) throws IOException
blockIndex
- The index of the block in the file.IOException
public long getCreationTimeMs() throws IOException
IOException
public int getDiskReplication()
public InStream getInStream(ReadType readType) throws IOException
readType
- the InStream's read typeIOException
public String getLocalFilename(int blockIndex) throws IOException
blockIndex
- The index of the block in the file.IOException
public List<String> getLocationHosts() throws IOException
IOException
public int getNumberOfBlocks() throws IOException
IOException
public OutStream getOutStream(WriteType writeType) throws IOException
writeType
- the OutStream's write typeIOException
public String getPath() throws IOException
IOException
public Object getUFSConf()
public boolean isComplete() throws IOException
IOException
public boolean isDirectory() throws IOException
IOException
public boolean isFile() throws IOException
IOException
public boolean isInMemory() throws IOException
IOException
public long length() throws IOException
IOException
public boolean needPin() throws IOException
IOException
public boolean promoteBlock(int blockIndex) throws IOException
blockIndex
- the index of the blockIOException
public TachyonByteBuffer readByteBuffer(int blockIndex) throws IOException
blockIndex
- The block index of the current file to read.IOException
public boolean recache() throws IOException
IOException
public boolean rename(TachyonURI path) throws IOException
path
- the new nameIOException
public void setUFSConf(Object conf)
conf
- The configuration object accepted by ufs.Copyright © 2015. All Rights Reserved.