@InterfaceAudience.Public @InterfaceStability.Stable public class BlockLocation extends Object implements Writable
Constructor and Description |
---|
BlockLocation()
Default Constructor
|
BlockLocation(String[] names,
String[] hosts,
long offset,
long length)
Constructor with host, name, offset and length
|
BlockLocation(String[] names,
String[] hosts,
long offset,
long length,
boolean corrupt)
Constructor with host, name, offset, length and corrupt flag
|
BlockLocation(String[] names,
String[] hosts,
String[] topologyPaths,
long offset,
long length)
Constructor with host, name, network topology, offset and length
|
BlockLocation(String[] names,
String[] hosts,
String[] topologyPaths,
long offset,
long length,
boolean corrupt)
Constructor with host, name, network topology, offset, length
and corrupt flag
|
Modifier and Type | Method and Description |
---|---|
String[] |
getHosts()
Get the list of hosts (hostname) hosting this block
|
long |
getLength()
Get the length of the block
|
String[] |
getNames()
Get the list of names (hostname:port) hosting this block
|
long |
getOffset()
Get the start offset of file associated with this block
|
String[] |
getTopologyPaths()
Get the list of network topology paths for each of the hosts.
|
boolean |
isCorrupt()
Get the corrupt flag.
|
void |
readFields(DataInput in)
Implement readFields of Writable
|
void |
setCorrupt(boolean corrupt)
Set the corrupt flag.
|
void |
setHosts(String[] hosts)
Set the hosts hosting this block
|
void |
setLength(long length)
Set the length of block
|
void |
setNames(String[] names)
Set the names (host:port) hosting this block
|
void |
setOffset(long offset)
Set the start offset of file associated with this block
|
void |
setTopologyPaths(String[] topologyPaths)
Set the network topology paths of the hosts
|
String |
toString() |
void |
write(DataOutput out)
Implement write of Writable
|
public BlockLocation()
public BlockLocation(String[] names, String[] hosts, long offset, long length)
public BlockLocation(String[] names, String[] hosts, long offset, long length, boolean corrupt)
public BlockLocation(String[] names, String[] hosts, String[] topologyPaths, long offset, long length)
public BlockLocation(String[] names, String[] hosts, String[] topologyPaths, long offset, long length, boolean corrupt)
public String[] getHosts() throws IOException
IOException
public String[] getNames() throws IOException
IOException
public String[] getTopologyPaths() throws IOException
IOException
public long getOffset()
public long getLength()
public boolean isCorrupt()
public void setOffset(long offset)
public void setLength(long length)
public void setCorrupt(boolean corrupt)
public void setHosts(String[] hosts) throws IOException
IOException
public void setNames(String[] names) throws IOException
IOException
public void setTopologyPaths(String[] topologyPaths) throws IOException
IOException
public void write(DataOutput out) throws IOException
write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.