org.apache.hadoop.hdfs.server.datanode.fsdataset
Class ReplicaOutputStreams

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.datanode.fsdataset.ReplicaOutputStreams
All Implemented Interfaces:
Closeable

public class ReplicaOutputStreams
extends Object
implements Closeable

Contains the output streams for the data and checksum of a replica.


Constructor Summary
ReplicaOutputStreams(OutputStream dataOut, OutputStream checksumOut, org.apache.hadoop.util.DataChecksum checksum)
          Create an object with a data output stream, a checksum output stream and a checksum.
 
Method Summary
 void close()
           
 org.apache.hadoop.util.DataChecksum getChecksum()
           
 OutputStream getChecksumOut()
           
 OutputStream getDataOut()
           
 void syncChecksumOut()
          Sync the checksum stream if it supports it.
 void syncDataOut()
          Sync the data stream if it supports it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicaOutputStreams

public ReplicaOutputStreams(OutputStream dataOut,
                            OutputStream checksumOut,
                            org.apache.hadoop.util.DataChecksum checksum)
Create an object with a data output stream, a checksum output stream and a checksum.

Method Detail

getDataOut

public OutputStream getDataOut()
Returns:
the data output stream.

getChecksumOut

public OutputStream getChecksumOut()
Returns:
the checksum output stream.

getChecksum

public org.apache.hadoop.util.DataChecksum getChecksum()
Returns:
the checksum.

close

public void close()
Specified by:
close in interface Closeable

syncDataOut

public void syncDataOut()
                 throws IOException
Sync the data stream if it supports it.

Throws:
IOException

syncChecksumOut

public void syncChecksumOut()
                     throws IOException
Sync the checksum stream if it supports it.

Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.