org.apache.hadoop.hdfs.protocol
Class DataTransferProtocol.Receiver

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.DataTransferProtocol.Receiver
Enclosing interface:
DataTransferProtocol

public abstract static class DataTransferProtocol.Receiver
extends Object

Receiver


Constructor Summary
DataTransferProtocol.Receiver()
           
 
Method Summary
protected abstract  void opBlockChecksum(DataInputStream in, long blockId, long blockGs, BlockAccessToken accesstoken)
          Abstract OP_BLOCK_CHECKSUM method.
protected abstract  void opCopyBlock(DataInputStream in, long blockId, long blockGs, BlockAccessToken accesstoken)
          Abstract OP_COPY_BLOCK method.
protected abstract  void opReadBlock(DataInputStream in, long blockId, long blockGs, long offset, long length, String client, BlockAccessToken accesstoken)
          Abstract OP_READ_BLOCK method.
protected abstract  void opReplaceBlock(DataInputStream in, long blockId, long blockGs, String sourceId, DatanodeInfo src, BlockAccessToken accesstoken)
          Abstract OP_REPLACE_BLOCK method.
protected abstract  void opWriteBlock(DataInputStream in, long blockId, long blockGs, int pipelineSize, DataTransferProtocol.BlockConstructionStage stage, long newGs, long minBytesRcvd, long maxBytesRcvd, String client, DatanodeInfo src, DatanodeInfo[] targets, BlockAccessToken accesstoken)
          Abstract OP_WRITE_BLOCK method.
protected  void processOp(DataTransferProtocol.Op op, DataInputStream in)
          Process op by the corresponding method.
protected  DataTransferProtocol.Op readOp(DataInputStream in)
          Read an Op.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTransferProtocol.Receiver

public DataTransferProtocol.Receiver()
Method Detail

readOp

protected final DataTransferProtocol.Op readOp(DataInputStream in)
                                        throws IOException
Read an Op. It also checks protocol version.

Throws:
IOException

processOp

protected final void processOp(DataTransferProtocol.Op op,
                               DataInputStream in)
                        throws IOException
Process op by the corresponding method.

Throws:
IOException

opReadBlock

protected abstract void opReadBlock(DataInputStream in,
                                    long blockId,
                                    long blockGs,
                                    long offset,
                                    long length,
                                    String client,
                                    BlockAccessToken accesstoken)
                             throws IOException
Abstract OP_READ_BLOCK method. Read a block.

Throws:
IOException

opWriteBlock

protected abstract void opWriteBlock(DataInputStream in,
                                     long blockId,
                                     long blockGs,
                                     int pipelineSize,
                                     DataTransferProtocol.BlockConstructionStage stage,
                                     long newGs,
                                     long minBytesRcvd,
                                     long maxBytesRcvd,
                                     String client,
                                     DatanodeInfo src,
                                     DatanodeInfo[] targets,
                                     BlockAccessToken accesstoken)
                              throws IOException
Abstract OP_WRITE_BLOCK method. Write a block.

Throws:
IOException

opReplaceBlock

protected abstract void opReplaceBlock(DataInputStream in,
                                       long blockId,
                                       long blockGs,
                                       String sourceId,
                                       DatanodeInfo src,
                                       BlockAccessToken accesstoken)
                                throws IOException
Abstract OP_REPLACE_BLOCK method. It is used for balancing purpose; send to a destination

Throws:
IOException

opCopyBlock

protected abstract void opCopyBlock(DataInputStream in,
                                    long blockId,
                                    long blockGs,
                                    BlockAccessToken accesstoken)
                             throws IOException
Abstract OP_COPY_BLOCK method. It is used for balancing purpose; send to a proxy source.

Throws:
IOException

opBlockChecksum

protected abstract void opBlockChecksum(DataInputStream in,
                                        long blockId,
                                        long blockGs,
                                        BlockAccessToken accesstoken)
                                 throws IOException
Abstract OP_BLOCK_CHECKSUM method. Get the checksum of a block

Throws:
IOException


Copyright © 2009 The Apache Software Foundation