Class S3ACachingBlockManager

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

public class S3ACachingBlockManager extends org.apache.hadoop.fs.impl.prefetch.CachingBlockManager
Provides access to S3 file one block at a time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    S3ACachingBlockManager(org.apache.hadoop.fs.impl.prefetch.BlockManagerParameters blockManagerParameters, S3ARemoteObjectReader reader)
    Constructs an instance of a S3ACachingBlockManager.
  • 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.CachingBlockManager

    cachePut, cancelPrefetches, createCache, get, numAvailable, numCached, numCachingErrors, numReadErrors, release, requestCaching, requestPrefetch, toString

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

    getBlockData

    Methods inherited from class java.lang.Object

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

    • S3ACachingBlockManager

      public S3ACachingBlockManager(@Nonnull org.apache.hadoop.fs.impl.prefetch.BlockManagerParameters blockManagerParameters, S3ARemoteObjectReader reader)
      Constructs an instance of a S3ACachingBlockManager.
      Parameters:
      blockManagerParameters - params for block manager.
      reader - reader that reads from S3 file.
      Throws:
      IllegalArgumentException - if reader is null.
  • Method Details

    • getReader

      protected S3ARemoteObjectReader getReader()
    • 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.CachingBlockManager