HADOOP-18380. fs.s3a.prefetch.block.size to be read through longBytesOption (#4762)

Contributed by Viraj Jasani.
This commit is contained in:
Viraj Jasani 2022-08-23 02:49:04 -07:00 committed by Steve Loughran
parent 4ce763a322
commit f00d77fda4
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0

View File

@ -535,8 +535,13 @@ public void initialize(URI name, Configuration originalConf)
enableMultiObjectsDelete = conf.getBoolean(ENABLE_MULTI_DELETE, true);
this.prefetchEnabled = conf.getBoolean(PREFETCH_ENABLED_KEY, PREFETCH_ENABLED_DEFAULT);
this.prefetchBlockSize = intOption(
conf, PREFETCH_BLOCK_SIZE_KEY, PREFETCH_BLOCK_DEFAULT_SIZE, PREFETCH_BLOCK_DEFAULT_SIZE);
long prefetchBlockSizeLong =
longBytesOption(conf, PREFETCH_BLOCK_SIZE_KEY, PREFETCH_BLOCK_DEFAULT_SIZE,
PREFETCH_BLOCK_DEFAULT_SIZE);
if (prefetchBlockSizeLong > (long) Integer.MAX_VALUE) {
throw new IOException("S3A prefetch block size exceeds int limit");
}
this.prefetchBlockSize = (int) prefetchBlockSizeLong;
this.prefetchBlockCount =
intOption(conf, PREFETCH_BLOCK_COUNT_KEY, PREFETCH_BLOCK_DEFAULT_COUNT, 1);