org.apache.hadoop.hdfs.protocol
Class LocatedBlock

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.LocatedBlock
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
BlockRecoveryCommand.RecoveringBlock

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class LocatedBlock
extends Object
implements org.apache.hadoop.io.Writable

A LocatedBlock is a pair of Block, DatanodeInfo[] objects. It tells where to find a Block.


Constructor Summary
LocatedBlock()
           
LocatedBlock(Block b, DatanodeInfo[] locs)
           
LocatedBlock(Block b, DatanodeInfo[] locs, long startOffset)
           
LocatedBlock(Block b, DatanodeInfo[] locs, long startOffset, boolean corrupt)
           
 
Method Summary
 BlockAccessToken getAccessToken()
           
 Block getBlock()
           
 long getBlockSize()
           
 DatanodeInfo[] getLocations()
           
 long getStartOffset()
           
 boolean isCorrupt()
           
static LocatedBlock read(DataInput in)
          Read LocatedBlock from in.
 void readFields(DataInput in)
           
 void setAccessToken(BlockAccessToken token)
           
 String toString()
          
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocatedBlock

public LocatedBlock()

LocatedBlock

public LocatedBlock(Block b,
                    DatanodeInfo[] locs)

LocatedBlock

public LocatedBlock(Block b,
                    DatanodeInfo[] locs,
                    long startOffset)

LocatedBlock

public LocatedBlock(Block b,
                    DatanodeInfo[] locs,
                    long startOffset,
                    boolean corrupt)
Method Detail

getAccessToken

public BlockAccessToken getAccessToken()

setAccessToken

public void setAccessToken(BlockAccessToken token)

getBlock

public Block getBlock()

getLocations

public DatanodeInfo[] getLocations()

getStartOffset

public long getStartOffset()

getBlockSize

public long getBlockSize()

isCorrupt

public boolean isCorrupt()

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

read

public static LocatedBlock read(DataInput in)
                         throws IOException
Read LocatedBlock from in.

Throws:
IOException

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2009 The Apache Software Foundation