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 fileIOExceptionpublic long getBlockSizeByte()
throws IOException
IOExceptionpublic ClientBlockInfo getClientBlockInfo(int blockIndex) throws IOException
blockIndex - The index of the block in the file.IOExceptionpublic long getCreationTimeMs()
throws IOException
IOExceptionpublic int getDiskReplication()
public InStream getInStream(ReadType readType) throws IOException
readType - the InStream's read typeIOExceptionpublic String getLocalFilename(int blockIndex) throws IOException
blockIndex - The index of the block in the file.IOExceptionpublic List<String> getLocationHosts() throws IOException
IOExceptionpublic int getNumberOfBlocks()
throws IOException
IOExceptionpublic OutStream getOutStream(WriteType writeType) throws IOException
writeType - the OutStream's write typeIOExceptionpublic String getPath() throws IOException
IOExceptionpublic Object getUFSConf()
public boolean isComplete()
throws IOException
IOExceptionpublic boolean isDirectory()
throws IOException
IOExceptionpublic boolean isFile()
throws IOException
IOExceptionpublic boolean isInMemory()
throws IOException
IOExceptionpublic long length()
throws IOException
IOExceptionpublic boolean needPin()
throws IOException
IOExceptionpublic boolean promoteBlock(int blockIndex)
throws IOException
blockIndex - the index of the blockIOExceptionpublic TachyonByteBuffer readByteBuffer(int blockIndex) throws IOException
blockIndex - The block index of the current file to read.IOExceptionpublic boolean recache()
throws IOException
IOExceptionpublic boolean rename(TachyonURI path) throws IOException
path - the new nameIOExceptionpublic void setUFSConf(Object conf)
conf - The configuration object accepted by ufs.Copyright © 2015. All Rights Reserved.