org.apache.hadoop.hdfs.server.datanode
Interface ReplicaInPipelineInterface

All Superinterfaces:
org.apache.hadoop.hdfs.server.datanode.Replica
All Known Implementing Classes:
ReplicaBeingWritten, ReplicaInPipeline

public interface ReplicaInPipelineInterface
extends org.apache.hadoop.hdfs.server.datanode.Replica

This defines the interface of a replica in Pipeline that's being written to


Method Summary
 ReplicaOutputStreams createStreams(boolean isCreate, org.apache.hadoop.util.DataChecksum requestedChecksum)
          Create output streams for writing to this replica, one for block file and one for CRC file
 long getBytesAcked()
          Get the number of bytes acked
 org.apache.hadoop.hdfs.server.datanode.ChunkChecksum getLastChecksumAndDataLen()
          gets the last chunk checksum and the length of the block corresponding to that checksum
 void setBytesAcked(long bytesAcked)
          Set the number bytes that have acked
 void setLastChecksumAndDataLen(long dataLength, byte[] lastChecksum)
          store the checksum for the last chunk along with the data length
 void setNumBytes(long bytesReceived)
          Set the number of bytes received
 
Methods inherited from interface org.apache.hadoop.hdfs.server.datanode.Replica
getBlockId, getBytesOnDisk, getGenerationStamp, getNumBytes, getState, getVisibleLength
 

Method Detail

setNumBytes

void setNumBytes(long bytesReceived)
Set the number of bytes received

Parameters:
bytesReceived - number of bytes received

getBytesAcked

long getBytesAcked()
Get the number of bytes acked

Returns:
the number of bytes acked

setBytesAcked

void setBytesAcked(long bytesAcked)
Set the number bytes that have acked

Parameters:
bytesAcked -

setLastChecksumAndDataLen

void setLastChecksumAndDataLen(long dataLength,
                               byte[] lastChecksum)
store the checksum for the last chunk along with the data length

Parameters:
dataLength - number of bytes on disk
lastChecksum - - checksum bytes for the last chunk

getLastChecksumAndDataLen

org.apache.hadoop.hdfs.server.datanode.ChunkChecksum getLastChecksumAndDataLen()
gets the last chunk checksum and the length of the block corresponding to that checksum


createStreams

ReplicaOutputStreams createStreams(boolean isCreate,
                                   org.apache.hadoop.util.DataChecksum requestedChecksum)
                                   throws IOException
Create output streams for writing to this replica, one for block file and one for CRC file

Parameters:
isCreate - if it is for creation
requestedChecksum - the checksum the writer would prefer to use
Returns:
output streams for writing
Throws:
IOException - if any error occurs


Copyright © 2013 Apache Software Foundation. All Rights Reserved.