Class HadoopDataOutputStream

java.lang.Object
java.io.OutputStream
org.apache.flink.core.fs.FSDataOutputStream
org.apache.flink.runtime.fs.hdfs.HadoopDataOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class HadoopDataOutputStream extends org.apache.flink.core.fs.FSDataOutputStream
Concrete implementation of the FSDataOutputStream for Hadoop's input streams. This supports all file systems supported by Hadoop, such as HDFS and S3 (S3a/S3n).
  • Constructor Details

    • HadoopDataOutputStream

      public HadoopDataOutputStream(org.apache.hadoop.fs.FSDataOutputStream fdos)
  • Method Details

    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class org.apache.flink.core.fs.FSDataOutputStream
      Throws:
      IOException
    • getPos

      public long getPos() throws IOException
      Specified by:
      getPos in class org.apache.flink.core.fs.FSDataOutputStream
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class org.apache.flink.core.fs.FSDataOutputStream
      Throws:
      IOException
    • sync

      public void sync() throws IOException
      Specified by:
      sync in class org.apache.flink.core.fs.FSDataOutputStream
      Throws:
      IOException
    • getHadoopOutputStream

      public org.apache.hadoop.fs.FSDataOutputStream getHadoopOutputStream()
      Gets the wrapped Hadoop output stream.
      Returns:
      The wrapped Hadoop output stream.