Package org.apache.flink.runtime.fs.hdfs
Class HadoopBlockLocation
- java.lang.Object
-
- org.apache.flink.runtime.fs.hdfs.HadoopBlockLocation
-
- All Implemented Interfaces:
Comparable<BlockLocation>
,BlockLocation
public final class HadoopBlockLocation extends Object implements BlockLocation
Implementation of theBlockLocation
interface for the Hadoop Distributed File System.
-
-
Constructor Summary
Constructors Constructor Description HadoopBlockLocation(org.apache.hadoop.fs.BlockLocation blockLocation)
Creates a new block location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(BlockLocation o)
String[]
getHosts()
Get the list of hosts (hostname) hosting this block.long
getLength()
Get the length of the block.long
getOffset()
Get the start offset of the file associated with this block.
-
-
-
Method Detail
-
getHosts
public String[] getHosts() throws IOException
Description copied from interface:BlockLocation
Get the list of hosts (hostname) hosting this block.- Specified by:
getHosts
in interfaceBlockLocation
- Returns:
- A list of hosts (hostname) hosting this block.
- Throws:
IOException
- thrown if the list of hosts could not be retrieved
-
getLength
public long getLength()
Description copied from interface:BlockLocation
Get the length of the block.- Specified by:
getLength
in interfaceBlockLocation
- Returns:
- the length of the block
-
getOffset
public long getOffset()
Description copied from interface:BlockLocation
Get the start offset of the file associated with this block.- Specified by:
getOffset
in interfaceBlockLocation
- Returns:
- The start offset of the file associated with this block.
-
compareTo
public int compareTo(BlockLocation o)
- Specified by:
compareTo
in interfaceComparable<BlockLocation>
-
-