Interface HadoopShims.ZeroCopyReaderShim

All Superinterfaces:
AutoCloseable, Closeable
Enclosing interface:
HadoopShims

public static interface HadoopShims.ZeroCopyReaderShim extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the underlying stream.
    readBuffer(int maxLength, boolean verifyChecksums)
    Get a ByteBuffer from the FSDataInputStream - this can be either a HeapByteBuffer or an MappedByteBuffer.
    void
    Release all ByteBuffers obtained from readBuffer on this ZeroCopyReaderShim.
    void
    Deprecated.
    Use releaseAllBuffers() instead.
  • Method Details

    • readBuffer

      ByteBuffer readBuffer(int maxLength, boolean verifyChecksums) throws IOException
      Get a ByteBuffer from the FSDataInputStream - this can be either a HeapByteBuffer or an MappedByteBuffer. Also move the in stream by that amount. The data read can be small than maxLength.
      Returns:
      ByteBuffer read from the stream,
      Throws:
      IOException
    • releaseBuffer

      @Deprecated void releaseBuffer(ByteBuffer buffer)
      Deprecated.
      Use releaseAllBuffers() instead. This method was incorrectly used by upper level code and shouldn't be used anymore.
      Release a ByteBuffer obtained from a readBuffer on this ZeroCopyReaderShim.
    • releaseAllBuffers

      void releaseAllBuffers()
      Release all ByteBuffers obtained from readBuffer on this ZeroCopyReaderShim.
    • close

      void close() throws IOException
      Close the underlying stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException