Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions src/demo/java/com/scylladb/alternator/demo/Demo2.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,19 @@ public static void main(String[] args) {
ddb = getTraditionalClient(URI.create(endpoint), myCredentials);
}

// run DescribeEndpoints several times
for (int i = 0; i < 10; i++) {
DescribeEndpointsRequest request = DescribeEndpointsRequest.builder().build();
DescribeEndpointsResponse response = ddb.describeEndpoints(request);
System.out.println(response);
try {
// run DescribeEndpoints several times
for (int i = 0; i < 10; i++) {
DescribeEndpointsRequest request = DescribeEndpointsRequest.builder().build();
DescribeEndpointsResponse response = ddb.describeEndpoints(request);
System.out.println(response);
}
} finally {
ddb.close();
}
// FIXME: The AWS SDK leaves behind an IdleConnectionReaper thread,
// which causes mvn to hang waiting for it to shut down (which it
// won't). Perhaps if we hold the HttpClient object and close() it,
// it will get rid of this reaper object.
// https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/client/builder/SdkSyncClientBuilder.html#httpClient-software.amazon.awssdk.http.SdkHttpClient-
// explains that with httpClient(), "This client must be closed by the
// user when it is ready to be disposed. The SDK will not close the
// HTTP client when the service client is closed." Maybe we should
// use httpClientBuilder() instead, which doesn't have this problem?

System.out.println("Done");
System.exit(0);
}

// A hack to disable SSL certificate checks. Useful when running with
Expand Down
Loading