|
@@ -61,8 +61,12 @@ import static org.apache.hadoop.fs.Options.OpenFileOptions.FS_OPTION_OPENFILE_RE
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.range;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.range;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.returnBuffersToPoolPostRead;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.returnBuffersToPoolPostRead;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.validateVectoredReadResult;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.validateVectoredReadResult;
|
|
|
|
+import static org.apache.hadoop.fs.s3a.Constants.AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE;
|
|
|
|
+import static org.apache.hadoop.fs.s3a.Constants.AWS_S3_VECTOR_READS_MIN_SEEK_SIZE;
|
|
import static org.apache.hadoop.fs.statistics.IOStatisticAssertions.verifyStatisticCounterValue;
|
|
import static org.apache.hadoop.fs.statistics.IOStatisticAssertions.verifyStatisticCounterValue;
|
|
import static org.apache.hadoop.fs.statistics.IOStatisticsLogging.ioStatisticsToPrettyString;
|
|
import static org.apache.hadoop.fs.statistics.IOStatisticsLogging.ioStatisticsToPrettyString;
|
|
|
|
+import static org.apache.hadoop.io.Sizes.S_1M;
|
|
|
|
+import static org.apache.hadoop.io.Sizes.S_4K;
|
|
import static org.apache.hadoop.test.LambdaTestUtils.interceptFuture;
|
|
import static org.apache.hadoop.test.LambdaTestUtils.interceptFuture;
|
|
import static org.apache.hadoop.test.MoreAsserts.assertEqual;
|
|
import static org.apache.hadoop.test.MoreAsserts.assertEqual;
|
|
|
|
|
|
@@ -139,13 +143,13 @@ public class ITestS3AContractVectoredRead extends AbstractContractVectoredReadTe
|
|
public void testMinSeekAndMaxSizeConfigsPropagation() throws Exception {
|
|
public void testMinSeekAndMaxSizeConfigsPropagation() throws Exception {
|
|
Configuration conf = getFileSystem().getConf();
|
|
Configuration conf = getFileSystem().getConf();
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
- Constants.AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE,
|
|
|
|
- Constants.AWS_S3_VECTOR_READS_MIN_SEEK_SIZE);
|
|
|
|
|
|
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE,
|
|
|
|
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE);
|
|
S3ATestUtils.disableFilesystemCaching(conf);
|
|
S3ATestUtils.disableFilesystemCaching(conf);
|
|
final int configuredMinSeek = 2 * 1024;
|
|
final int configuredMinSeek = 2 * 1024;
|
|
final int configuredMaxSize = 10 * 1024 * 1024;
|
|
final int configuredMaxSize = 10 * 1024 * 1024;
|
|
- conf.set(Constants.AWS_S3_VECTOR_READS_MIN_SEEK_SIZE, "2K");
|
|
|
|
- conf.set(Constants.AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE, "10M");
|
|
|
|
|
|
+ conf.set(AWS_S3_VECTOR_READS_MIN_SEEK_SIZE, "2K");
|
|
|
|
+ conf.set(AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE, "10M");
|
|
try (S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf)) {
|
|
try (S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf)) {
|
|
try (FSDataInputStream fis = openVectorFile(fs)) {
|
|
try (FSDataInputStream fis = openVectorFile(fs)) {
|
|
int newMinSeek = fis.minSeekForVectorReads();
|
|
int newMinSeek = fis.minSeekForVectorReads();
|
|
@@ -162,8 +166,8 @@ public class ITestS3AContractVectoredRead extends AbstractContractVectoredReadTe
|
|
public void testMinSeekAndMaxSizeDefaultValues() throws Exception {
|
|
public void testMinSeekAndMaxSizeDefaultValues() throws Exception {
|
|
Configuration conf = getFileSystem().getConf();
|
|
Configuration conf = getFileSystem().getConf();
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
- Constants.AWS_S3_VECTOR_READS_MIN_SEEK_SIZE,
|
|
|
|
- Constants.AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE);
|
|
|
|
|
|
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE,
|
|
|
|
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE);
|
|
try (S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf)) {
|
|
try (S3AFileSystem fs = S3ATestUtils.createTestFileSystem(conf)) {
|
|
try (FSDataInputStream fis = openVectorFile(fs)) {
|
|
try (FSDataInputStream fis = openVectorFile(fs)) {
|
|
int minSeek = fis.minSeekForVectorReads();
|
|
int minSeek = fis.minSeekForVectorReads();
|
|
@@ -400,16 +404,25 @@ public class ITestS3AContractVectoredRead extends AbstractContractVectoredReadTe
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Create a test fs with no readahead.
|
|
|
|
+ * The vector IO ranges are set to the original small values,
|
|
|
|
+ * so ranges on small files are not coalesced.
|
|
|
|
+ * @return a filesystem
|
|
|
|
+ * @throws IOException failure to instantiate.
|
|
|
|
+ */
|
|
private S3AFileSystem getTestFileSystemWithReadAheadDisabled() throws IOException {
|
|
private S3AFileSystem getTestFileSystemWithReadAheadDisabled() throws IOException {
|
|
Configuration conf = getFileSystem().getConf();
|
|
Configuration conf = getFileSystem().getConf();
|
|
// also resetting the min seek and max size values is important
|
|
// also resetting the min seek and max size values is important
|
|
// as this same test suite has test which overrides these params.
|
|
// as this same test suite has test which overrides these params.
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
S3ATestUtils.removeBaseAndBucketOverrides(conf,
|
|
Constants.READAHEAD_RANGE,
|
|
Constants.READAHEAD_RANGE,
|
|
- Constants.AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE,
|
|
|
|
- Constants.AWS_S3_VECTOR_READS_MIN_SEEK_SIZE);
|
|
|
|
|
|
+ AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE,
|
|
|
|
+ AWS_S3_VECTOR_READS_MIN_SEEK_SIZE);
|
|
S3ATestUtils.disableFilesystemCaching(conf);
|
|
S3ATestUtils.disableFilesystemCaching(conf);
|
|
conf.setInt(Constants.READAHEAD_RANGE, 0);
|
|
conf.setInt(Constants.READAHEAD_RANGE, 0);
|
|
|
|
+ conf.setInt(AWS_S3_VECTOR_READS_MIN_SEEK_SIZE, S_4K);
|
|
|
|
+ conf.setInt(AWS_S3_VECTOR_READS_MAX_MERGED_READ_SIZE, S_1M);
|
|
return S3ATestUtils.createTestFileSystem(conf);
|
|
return S3ATestUtils.createTestFileSystem(conf);
|
|
}
|
|
}
|
|
}
|
|
}
|