Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,7 @@ public void initialize(URI name, Configuration originalConf)

this.prefetchEnabled = conf.getBoolean(PREFETCH_ENABLED_KEY, PREFETCH_ENABLED_DEFAULT);
long prefetchBlockSizeLong =
longBytesOption(conf, PREFETCH_BLOCK_SIZE_KEY, PREFETCH_BLOCK_DEFAULT_SIZE,
PREFETCH_BLOCK_DEFAULT_SIZE);
longBytesOption(conf, PREFETCH_BLOCK_SIZE_KEY, PREFETCH_BLOCK_DEFAULT_SIZE, 1);
if (prefetchBlockSizeLong > (long) Integer.MAX_VALUE) {
throw new IOException("S3A prefatch block size exceeds int limit");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Multiple blocks may be read in parallel.
|`fs.s3a.prefetch.block.size` |Size of a block |`8M` |
|`fs.s3a.prefetch.block.count` |Number of blocks to prefetch |`8` |

Although, default size of the block for prefetching the input stream is 8 MB,
minimum size allowed to set is 1 byte for a block.
User should set the block size with the understanding that smaller block sizes increases the number of blocks.
Thus, smaller block size affects the performance by increasing the overhead for reading and prefetching
each block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although, default size of the block for prefetching the input stream is 8 MB,
minimum size allowed to set is 1 byte for a block.
User should set the block size with the understanding that smaller block sizes increases the number of blocks.
Thus, smaller block size affects the performance by increasing the overhead for reading and prefetching
each block.
The default size of a block is 8MB, and the minimum allowed block size is 1 byte.
Decreasing block size will increase the number of blocks to be read for a file.
A smaller block size may negatively impact performance as the number of prefetches required will increase.


### Key Components

`S3PrefetchingInputStream` - When prefetching is enabled, S3AFileSystem will return an instance of
Expand Down