Skip to content

Commit ae323a4

Browse files
committed
Merge pull request elastic#208 from rmuir/disable_response_metadata_cache
Disable response metadata cache.
2 parents 3aab63c + d8283ab commit ae323a4

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</parent>
3333

3434
<properties>
35-
<amazonaws.version>1.9.23</amazonaws.version>
35+
<amazonaws.version>1.9.34</amazonaws.version>
3636
</properties>
3737

3838
<dependencies>

src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public synchronized AmazonEC2 client() {
6262
}
6363

6464
ClientConfiguration clientConfiguration = new ClientConfiguration();
65+
// the response metadata cache is only there for diagnostics purposes,
66+
// but can force objects from every response to the old generation.
67+
clientConfiguration.setResponseMetadataCacheSize(0);
6568
String protocol = settings.get("cloud.aws.protocol", "https").toLowerCase();
6669
protocol = settings.get("cloud.aws.ec2.protocol", protocol).toLowerCase();
6770
if ("http".equals(protocol)) {

src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ private synchronized AmazonS3 getClient(String endpoint, String protocol, String
8989
}
9090

9191
ClientConfiguration clientConfiguration = new ClientConfiguration();
92+
// the response metadata cache is only there for diagnostics purposes,
93+
// but can force objects from every response to the old generation.
94+
clientConfiguration.setResponseMetadataCacheSize(0);
9295
if (protocol == null) {
9396
protocol = settings.get("cloud.aws.protocol", "https").toLowerCase();
9497
protocol = settings.get("cloud.aws.s3.protocol", protocol).toLowerCase();

src/test/java/org/elasticsearch/cloud/aws/AmazonS3Wrapper.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,26 @@ public void deleteBucket(String bucketName) throws AmazonClientException, Amazon
257257
delegate.deleteBucket(bucketName);
258258
}
259259

260+
@Override
261+
public void setBucketReplicationConfiguration(String bucketName, BucketReplicationConfiguration configuration) throws AmazonServiceException, AmazonClientException {
262+
delegate.setBucketReplicationConfiguration(bucketName, configuration);
263+
}
264+
265+
@Override
266+
public void setBucketReplicationConfiguration(SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws AmazonServiceException, AmazonClientException {
267+
delegate.setBucketReplicationConfiguration(setBucketReplicationConfigurationRequest);
268+
}
269+
270+
@Override
271+
public BucketReplicationConfiguration getBucketReplicationConfiguration(String bucketName) throws AmazonServiceException, AmazonClientException {
272+
return delegate.getBucketReplicationConfiguration(bucketName);
273+
}
274+
275+
@Override
276+
public void deleteBucketReplicationConfiguration(String bucketName) throws AmazonServiceException, AmazonClientException {
277+
delegate.deleteBucketReplicationConfiguration(bucketName);
278+
}
279+
260280
@Override
261281
public PutObjectResult putObject(PutObjectRequest putObjectRequest) throws AmazonClientException, AmazonServiceException {
262282
return delegate.putObject(putObjectRequest);

0 commit comments

Comments
 (0)