Skip to content

Commit 58008e1

Browse files
kelrjernst
kel
authored andcommitted
Remove redundant argument for buildConfiguration of s3 plugin (#28281)
1 parent c0ffea8 commit 58008e1

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/InternalAwsS3Service.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public synchronized AmazonS3 client(Settings repositorySettings) {
7373
logger.debug("creating S3 client with client_name [{}], endpoint [{}]", clientName, clientSettings.endpoint);
7474

7575
AWSCredentialsProvider credentials = buildCredentials(logger, deprecationLogger, clientSettings, repositorySettings);
76-
ClientConfiguration configuration = buildConfiguration(clientSettings, repositorySettings);
76+
ClientConfiguration configuration = buildConfiguration(clientSettings);
7777

7878
client = new AmazonS3Client(credentials, configuration);
7979

@@ -86,7 +86,7 @@ public synchronized AmazonS3 client(Settings repositorySettings) {
8686
}
8787

8888
// pkg private for tests
89-
static ClientConfiguration buildConfiguration(S3ClientSettings clientSettings, Settings repositorySettings) {
89+
static ClientConfiguration buildConfiguration(S3ClientSettings clientSettings) {
9090
ClientConfiguration clientConfiguration = new ClientConfiguration();
9191
// the response metadata cache is only there for diagnostics purposes,
9292
// but can force objects from every response to the old generation.

plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AwsS3ServiceImplTests.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void assertCredentials(Settings singleRepositorySettings, Settings setti
9595
}
9696

9797
public void testAWSDefaultConfiguration() {
98-
launchAWSConfigurationTest(Settings.EMPTY, Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, 3,
98+
launchAWSConfigurationTest(Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, 3,
9999
ClientConfiguration.DEFAULT_THROTTLE_RETRIES, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT);
100100
}
101101

@@ -110,38 +110,37 @@ public void testAWSConfigurationWithAwsSettings() {
110110
.put("s3.client.default.proxy.port", 8080)
111111
.put("s3.client.default.read_timeout", "10s")
112112
.build();
113-
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTP, "aws_proxy_host", 8080, "aws_proxy_username",
113+
launchAWSConfigurationTest(settings, Protocol.HTTP, "aws_proxy_host", 8080, "aws_proxy_username",
114114
"aws_proxy_password", 3, ClientConfiguration.DEFAULT_THROTTLE_RETRIES, 10000);
115115
}
116116

117117
public void testRepositoryMaxRetries() {
118118
Settings settings = Settings.builder()
119119
.put("s3.client.default.max_retries", 5)
120120
.build();
121-
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTPS, null, -1, null,
121+
launchAWSConfigurationTest(settings, Protocol.HTTPS, null, -1, null,
122122
null, 5, ClientConfiguration.DEFAULT_THROTTLE_RETRIES, 50000);
123123
}
124124

125125
public void testRepositoryThrottleRetries() {
126126
final boolean throttling = randomBoolean();
127127

128128
Settings settings = Settings.builder().put("s3.client.default.use_throttle_retries", throttling).build();
129-
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, 3, throttling, 50000);
129+
launchAWSConfigurationTest(settings, Protocol.HTTPS, null, -1, null, null, 3, throttling, 50000);
130130
}
131131

132132
private void launchAWSConfigurationTest(Settings settings,
133-
Settings singleRepositorySettings,
134-
Protocol expectedProtocol,
135-
String expectedProxyHost,
136-
int expectedProxyPort,
137-
String expectedProxyUsername,
138-
String expectedProxyPassword,
139-
Integer expectedMaxRetries,
140-
boolean expectedUseThrottleRetries,
141-
int expectedReadTimeout) {
133+
Protocol expectedProtocol,
134+
String expectedProxyHost,
135+
int expectedProxyPort,
136+
String expectedProxyUsername,
137+
String expectedProxyPassword,
138+
Integer expectedMaxRetries,
139+
boolean expectedUseThrottleRetries,
140+
int expectedReadTimeout) {
142141

143142
S3ClientSettings clientSettings = S3ClientSettings.getClientSettings(settings, "default");
144-
ClientConfiguration configuration = InternalAwsS3Service.buildConfiguration(clientSettings, singleRepositorySettings);
143+
ClientConfiguration configuration = InternalAwsS3Service.buildConfiguration(clientSettings);
145144

146145
assertThat(configuration.getResponseMetadataCacheSize(), is(0));
147146
assertThat(configuration.getProtocol(), is(expectedProtocol));

0 commit comments

Comments
 (0)