Package alluxio

Interface PositionReader

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    ObjectPositionReader

    @ThreadSafe
    public interface PositionReader
    extends java.io.Closeable
    Position read interface. All implementer should be thread-safe.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()
      Closes the positon reader and do cleanup job if any.
      default int read​(long position, byte[] buffer, int length)  
      default int read​(long position, byte[] buffer, int offset, int length)  
      default int read​(long position, ReadTargetBuffer buffer, int length)  
      default int read​(long position, io.netty.buffer.ByteBuf buffer, int length)  
      default int read​(long position, java.nio.ByteBuffer buffer, int length)  
      int readInternal​(long position, ReadTargetBuffer buffer, int length)  
    • Method Detail

      • read

        default int read​(long position,
                         byte[] buffer,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte array
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • read

        default int read​(long position,
                         byte[] buffer,
                         int offset,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte array
        offset - the offset of the buffer
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • read

        default int read​(long position,
                         java.nio.ByteBuffer buffer,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte buffer
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • read

        default int read​(long position,
                         io.netty.buffer.ByteBuf buffer,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte buf
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • read

        default int read​(long position,
                         ReadTargetBuffer buffer,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte buffer
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • readInternal

        int readInternal​(long position,
                         ReadTargetBuffer buffer,
                         int length)
                  throws java.io.IOException
        Parameters:
        position - position of the file to start reading data
        buffer - target byte buffer
        length - bytes to read
        Returns:
        bytes read, or -1 none of data is read
        Throws:
        java.io.IOException
      • close

        default void close()
                    throws java.io.IOException
        Closes the positon reader and do cleanup job if any.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException