public final class HadoopBlockLocation extends Object implements BlockLocation
BlockLocation
interface for the Hadoop Distributed File System.Constructor and Description |
---|
HadoopBlockLocation(org.apache.hadoop.fs.BlockLocation blockLocation)
Creates a new block location.
|
Modifier and Type | Method and 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.
|
public HadoopBlockLocation(org.apache.hadoop.fs.BlockLocation blockLocation)
blockLocation
- the original HDFS block locationpublic String[] getHosts() throws IOException
BlockLocation
getHosts
in interface BlockLocation
IOException
- thrown if the list of hosts could not be retrievedpublic long getLength()
BlockLocation
getLength
in interface BlockLocation
public long getOffset()
BlockLocation
getOffset
in interface BlockLocation
public int compareTo(BlockLocation o)
compareTo
in interface Comparable<BlockLocation>
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.