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
ConstructorsConstructorDescriptionS3ABlockManager(S3ARemoteObjectReader reader, org.apache.hadoop.fs.impl.prefetch.BlockData blockData) Constructs an instance ofS3ABlockManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intread(ByteBuffer buffer, long startOffset, int size) Reads into the givenbuffersizebytes from the underlying file starting atstartOffset.Methods inherited from class org.apache.hadoop.fs.impl.prefetch.BlockManager
cancelPrefetches, get, getBlockData, release, requestCaching, requestPrefetch
-
Constructor Details
-
S3ABlockManager
public S3ABlockManager(S3ARemoteObjectReader reader, org.apache.hadoop.fs.impl.prefetch.BlockData blockData) Constructs an instance ofS3ABlockManager.- 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
Reads into the givenbuffersizebytes from the underlying file starting atstartOffset.- Specified by:
readin classorg.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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.hadoop.fs.impl.prefetch.BlockManager
-