Skip to content

Commit 439a273

Browse files
committed
Spotless
1 parent 84a9e2e commit 439a273

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
import software.amazon.awssdk.services.s3.model.ListMultipartUploadsRequest;
1515
import software.amazon.awssdk.services.s3.model.MultipartUpload;
1616

17-
import com.amazonaws.http.AmazonHttpClient;
18-
import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
1917
import com.amazonaws.services.s3.model.ListMultipartUploadsRequest;
2018
import com.amazonaws.services.s3.model.MultipartUpload;
21-
import com.sun.net.httpserver.Headers;
2219
import com.sun.net.httpserver.HttpExchange;
2320
import com.sun.net.httpserver.HttpHandler;
2421

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RetryingInputStreamTests.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111

1212
import software.amazon.awssdk.core.ResponseInputStream;
1313
import software.amazon.awssdk.http.AbortableInputStream;
14+
import software.amazon.awssdk.services.s3.S3Client;
1415
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
16+
import software.amazon.awssdk.services.s3.model.GetObjectResponse;
17+
import software.amazon.awssdk.services.s3.model.S3Exception;
1518

1619
import org.elasticsearch.common.io.Streams;
1720
import org.elasticsearch.core.Nullable;
1821
import org.elasticsearch.repositories.blobstore.RequestedRangeNotSatisfiedException;
1922
import org.elasticsearch.rest.RestStatus;
2023
import org.elasticsearch.test.ESTestCase;
2124

22-
import software.amazon.awssdk.services.s3.S3Client;
23-
import software.amazon.awssdk.services.s3.model.GetObjectResponse;
24-
import software.amazon.awssdk.services.s3.model.S3Exception;
25-
2625
import java.io.ByteArrayInputStream;
2726
import java.io.IOException;
2827
import java.util.Arrays;
@@ -144,22 +143,20 @@ private S3RetryingInputStream createInputStream(final byte[] data, @Nullable fin
144143

145144
// NOMERGE: I think blobStore.getMetricPublisher(operation, purpose) needs to be defined, to fix the NPE. I didn't get that far.
146145
// TODO NOMERGE: revisit AbortableInputStream, I just threw it on to see if that fixed the NPE.
147-
ResponseInputStream<GetObjectResponse> objectResponse =
148-
new ResponseInputStream<>(
149-
GetObjectResponse.builder().build(),//.contentLength(length.longValue()).build(),
150-
AbortableInputStream.create(new ByteArrayInputStream(data, position, length))
151-
);
146+
ResponseInputStream<GetObjectResponse> objectResponse = new ResponseInputStream<>(
147+
GetObjectResponse.builder().build(),// .contentLength(length.longValue()).build(),
148+
AbortableInputStream.create(new ByteArrayInputStream(data, position, length))
149+
);
152150
when(client.getObject(any(GetObjectRequest.class))).thenReturn(objectResponse);
153151
return new S3RetryingInputStream(randomPurpose(), blobStore, "_blob", position, Math.addExact(position, length - 1));
154152
}
155153

156154
// NOMERGE: I think blobStore.getMetricPublisher(operation, purpose) needs to be defined, to fix the NPE. I didn't get that far.
157155
// TODO NOMERGE: revisit AbortableInputStream, I just threw it on to see if that fixed the NPE.
158-
ResponseInputStream<GetObjectResponse> objectResponse =
159-
new ResponseInputStream<>(
160-
GetObjectResponse.builder().build(),//.contentLength(Long.valueOf(data.length)).build(),
161-
AbortableInputStream.create(new ByteArrayInputStream(data))
162-
);
156+
ResponseInputStream<GetObjectResponse> objectResponse = new ResponseInputStream<>(
157+
GetObjectResponse.builder().build(),// .contentLength(Long.valueOf(data.length)).build(),
158+
AbortableInputStream.create(new ByteArrayInputStream(data))
159+
);
163160
when(client.getObject(any(GetObjectRequest.class))).thenReturn(objectResponse);
164161
return new S3RetryingInputStream(randomPurpose(), blobStore, "_blob");
165162
}

0 commit comments

Comments
 (0)