fixes compilation errors in tests

This commit is contained in:
Ahmar Suhail 2022-05-19 13:17:26 +01:00 committed by Steve Loughran
parent 9abc77b19e
commit 3c06960a31
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
2 changed files with 14 additions and 4 deletions

View File

@ -27,6 +27,7 @@ import java.nio.file.Path;
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.CountingChangeTracker;
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 final class Fakes {
statistics,
statisticsContext,
fileStatus,
S3AInputPolicy.Random, // seekPolicy
CHANGE_POLICY,
1L, // readAheadRange
NoopSpan.INSTANCE, // auditSpan
futurePool,
prefetchBlockSize,
prefetchBlockCount);
@ -181,6 +179,11 @@ public final class Fakes {
return object;
}
@Override
public <T> CompletableFuture<T> submit(CallableRaisingIOE<T> operation) {
return null;
}
@Override
public GetObjectRequest newGetRequest(String key) {
return new GetObjectRequest(bucket, key);

View File

@ -22,6 +22,7 @@ package org.apache.hadoop.fs.s3a.read;
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 com.amazonaws.services.s3.model.S3Object;
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 @@ class MockS3File extends S3File {
return null;
}
@Override
public <T> CompletableFuture<T> submit(CallableRaisingIOE<T> operation) {
return null;
}
@Override
public GetObjectRequest newGetRequest(String key) {
return new GetObjectRequest(bucketName, key);