From b75b72b8e203e447b60c3f7e1305aed5cff48d2c Mon Sep 17 00:00:00 2001 From: Ahmar Suhail Date: Thu, 19 May 2022 13:17:26 +0100 Subject: [PATCH] fixes compilation errors in tests --- .../java/org/apache/hadoop/fs/s3a/read/Fakes.java | 11 +++++++---- .../org/apache/hadoop/fs/s3a/read/MockS3File.java | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/Fakes.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/Fakes.java index 1b02c495bc477..f394119df80cc 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/Fakes.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/Fakes.java @@ -27,6 +27,7 @@ import java.nio.file.Paths; import java.util.Map; import java.util.Random; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; @@ -56,6 +57,7 @@ import org.apache.hadoop.fs.s3a.statistics.impl.EmptyS3AStatisticsContext; import org.apache.hadoop.io.retry.RetryPolicies; import org.apache.hadoop.io.retry.RetryPolicy; +import org.apache.hadoop.util.functional.CallableRaisingIOE; /** * Provides 'fake' implementations of S3InputStream variants. @@ -128,10 +130,6 @@ public static S3AReadOpContext createReadContext( statistics, statisticsContext, fileStatus, - S3AInputPolicy.Random, // seekPolicy - CHANGE_POLICY, - 1L, // readAheadRange - NoopSpan.INSTANCE, // auditSpan futurePool, prefetchBlockSize, prefetchBlockCount); @@ -181,6 +179,11 @@ public S3Object getObject(GetObjectRequest request) { return object; } + @Override + public CompletableFuture submit(CallableRaisingIOE operation) { + return null; + } + @Override public GetObjectRequest newGetRequest(String key) { return new GetObjectRequest(bucket, key); diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/MockS3File.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/MockS3File.java index 91523026e9aa9..b265eea931d34 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/MockS3File.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/read/MockS3File.java @@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.util.concurrent.CompletableFuture; import com.amazonaws.services.s3.model.GetObjectRequest; import com.amazonaws.services.s3.model.S3Object; @@ -29,6 +30,7 @@ import org.apache.hadoop.fs.common.Validate; import org.apache.hadoop.fs.s3a.S3AInputStream; import org.apache.hadoop.fs.s3a.statistics.impl.EmptyS3AStatisticsContext; +import org.apache.hadoop.util.functional.CallableRaisingIOE; /** * A mock s3 file with some fault injection. @@ -92,6 +94,11 @@ public S3Object getObject(GetObjectRequest request) { return null; } + @Override + public CompletableFuture submit(CallableRaisingIOE operation) { + return null; + } + @Override public GetObjectRequest newGetRequest(String key) { return new GetObjectRequest(bucketName, key);