Class S3ABlockManager

java.lang.Object
org.apache.hadoop.fs.impl.prefetch.BlockManager
org.apache.hadoop.fs.s3a.prefetch.S3ABlockManager
All Implemented Interfaces:
Closeable, AutoCloseable

public class S3ABlockManager extends org.apache.hadoop.fs.impl.prefetch.BlockManager
Provides read access to S3 file one block at a time. A naive implementation of a BlockManager that provides no prefetching or caching. Useful baseline for comparing performance difference against S3ACachingBlockManager.
  • Constructor Summary

    Constructors
    Constructor
    Description
    S3ABlockManager(S3ARemoteObjectReader reader, org.apache.hadoop.fs.impl.prefetch.BlockData blockData)
    Constructs an instance of S3ABlockManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
    read(ByteBuffer buffer, long startOffset, int size)
    Reads into the given buffer size bytes from the underlying file starting at startOffset.

    Methods inherited from class org.apache.hadoop.fs.impl.prefetch.BlockManager

    cancelPrefetches, get, getBlockData, release, requestCaching, requestPrefetch

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • S3ABlockManager

      public S3ABlockManager(S3ARemoteObjectReader reader, org.apache.hadoop.fs.impl.prefetch.BlockData blockData)
      Constructs an instance of S3ABlockManager.
      Parameters:
      reader - a reader that reads from S3 file.
      blockData - information about each block of the S3 file.
      Throws:
      IllegalArgumentException - if reader is null.
      IllegalArgumentException - if blockData is null.
  • Method Details

    • read

      public int read(ByteBuffer buffer, long startOffset, int size) throws IOException
      Reads into the given buffer size bytes from the underlying file starting at startOffset.
      Specified by:
      read in class org.apache.hadoop.fs.impl.prefetch.BlockManager
      Parameters:
      buffer - the buffer to read data in to.
      startOffset - the offset at which reading starts.
      size - the number bytes to read.
      Returns:
      number of bytes read.
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class org.apache.hadoop.fs.impl.prefetch.BlockManager