org.apache.hadoop.hdfs.server.protocol
Class BlocksWithLocations

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations
All Implemented Interfaces:
org.apache.hadoop.io.Writable

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

A class to implement an array of BlockLocations It provide efficient customized serialization/deserialization methods in stead of using the default array (de)serialization provided by RPC


Nested Class Summary
static class BlocksWithLocations.BlockWithLocations
          A class to keep track of a block and its locations
 
Constructor Summary
BlocksWithLocations(BlocksWithLocations.BlockWithLocations[] blocks)
          Constructor with one parameter
 
Method Summary
 BlocksWithLocations.BlockWithLocations[] getBlocks()
          getter
 void readFields(DataInput in)
          deserialization method
 void write(DataOutput out)
          serialization method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlocksWithLocations

public BlocksWithLocations(BlocksWithLocations.BlockWithLocations[] blocks)
Constructor with one parameter

Method Detail

getBlocks

public BlocksWithLocations.BlockWithLocations[] getBlocks()
getter


write

public void write(DataOutput out)
           throws IOException
serialization method

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
deserialization method

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2009 The Apache Software Foundation