61
61
import static org .apache .hadoop .fs .contract .ContractTestUtils .range ;
62
62
import static org .apache .hadoop .fs .contract .ContractTestUtils .returnBuffersToPoolPostRead ;
63
63
import static org .apache .hadoop .fs .contract .ContractTestUtils .validateVectoredReadResult ;
64
+ import static org .apache .hadoop .fs .s3a .Constants .AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE ;
65
+ import static org .apache .hadoop .fs .s3a .Constants .AWS_S3_VECTOR_READS_MIN_SEEK_SIZE ;
64
66
import static org .apache .hadoop .fs .statistics .IOStatisticAssertions .verifyStatisticCounterValue ;
65
67
import static org .apache .hadoop .fs .statistics .IOStatisticsLogging .ioStatisticsToPrettyString ;
68
+ import static org .apache .hadoop .io .Sizes .S_1M ;
69
+ import static org .apache .hadoop .io .Sizes .S_4K ;
66
70
import static org .apache .hadoop .test .LambdaTestUtils .interceptFuture ;
67
71
import static org .apache .hadoop .test .MoreAsserts .assertEqual ;
68
72
@@ -139,13 +143,13 @@ public void testEOFRanges416Handling() throws Exception {
139
143
public void testMinSeekAndMaxSizeConfigsPropagation () throws Exception {
140
144
Configuration conf = getFileSystem ().getConf ();
141
145
S3ATestUtils .removeBaseAndBucketOverrides (conf ,
142
- Constants . AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE ,
143
- Constants . AWS_S3_VECTOR_READS_MIN_SEEK_SIZE );
146
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE ,
147
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE );
144
148
S3ATestUtils .disableFilesystemCaching (conf );
145
149
final int configuredMinSeek = 2 * 1024 ;
146
150
final int configuredMaxSize = 10 * 1024 * 1024 ;
147
- conf .set (Constants . AWS_S3_VECTOR_READS_MIN_SEEK_SIZE , "2K" );
148
- conf .set (Constants . AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE , "10M" );
151
+ conf .set (AWS_S3_VECTOR_READS_MIN_SEEK_SIZE , "2K" );
152
+ conf .set (AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE , "10M" );
149
153
try (S3AFileSystem fs = S3ATestUtils .createTestFileSystem (conf )) {
150
154
try (FSDataInputStream fis = openVectorFile (fs )) {
151
155
int newMinSeek = fis .minSeekForVectorReads ();
@@ -162,8 +166,8 @@ public void testMinSeekAndMaxSizeConfigsPropagation() throws Exception {
162
166
public void testMinSeekAndMaxSizeDefaultValues () throws Exception {
163
167
Configuration conf = getFileSystem ().getConf ();
164
168
S3ATestUtils .removeBaseAndBucketOverrides (conf ,
165
- Constants . AWS_S3_VECTOR_READS_MIN_SEEK_SIZE ,
166
- Constants . AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE );
169
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE ,
170
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE );
167
171
try (S3AFileSystem fs = S3ATestUtils .createTestFileSystem (conf )) {
168
172
try (FSDataInputStream fis = openVectorFile (fs )) {
169
173
int minSeek = fis .minSeekForVectorReads ();
@@ -400,16 +404,25 @@ public void testMultiVectoredReadStatsCollection() throws Exception {
400
404
}
401
405
}
402
406
407
+ /**
408
+ * Create a test fs with no readahead.
409
+ * The vector IO ranges are set to the original small values,
410
+ * so ranges on small files are not coalesced.
411
+ * @return a filesystem
412
+ * @throws IOException failure to instantiate.
413
+ */
403
414
private S3AFileSystem getTestFileSystemWithReadAheadDisabled () throws IOException {
404
415
Configuration conf = getFileSystem ().getConf ();
405
416
// also resetting the min seek and max size values is important
406
417
// as this same test suite has test which overrides these params.
407
418
S3ATestUtils .removeBaseAndBucketOverrides (conf ,
408
419
Constants .READAHEAD_RANGE ,
409
- Constants . AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE ,
410
- Constants . AWS_S3_VECTOR_READS_MIN_SEEK_SIZE );
420
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE ,
421
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE );
411
422
S3ATestUtils .disableFilesystemCaching (conf );
412
423
conf .setInt (Constants .READAHEAD_RANGE , 0 );
424
+ conf .setInt (AWS_S3_VECTOR_READS_MIN_SEEK_SIZE , S_4K );
425
+ conf .setInt (AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE , S_1M );
413
426
return S3ATestUtils .createTestFileSystem (conf );
414
427
}
415
428
}
0 commit comments