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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

package org.apache.doris.regression.suite

import com.amazonaws.auth.AWSStaticCredentialsProvider
import com.amazonaws.auth.BasicAWSCredentials
import com.amazonaws.client.builder.AwsClientBuilder
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.AmazonS3ClientBuilder

import static java.util.concurrent.TimeUnit.SECONDS

import com.google.common.base.Strings
Expand Down Expand Up @@ -96,6 +102,8 @@ class Suite implements GroovyInterceptable {
final List<Future> lazyCheckFutures = new Vector<>()
static Boolean isTrinoConnectorDownloaded = false

private AmazonS3 s3Client = null

Suite(String name, String group, SuiteContext context, SuiteCluster cluster) {
this.name = name
this.group = group
Expand Down Expand Up @@ -984,6 +992,16 @@ class Suite implements GroovyInterceptable {
return s3Url
}

synchronized AmazonS3 getS3Client() {
if (s3Client == null) {
def credentials = new BasicAWSCredentials(getS3AK(), getS3SK())
def endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(getS3Endpoint(), getS3Region())
s3Client = AmazonS3ClientBuilder.standard().withEndpointConfiguration(endpointConfiguration)
.withCredentials(new AWSStaticCredentialsProvider(credentials)).build()
}
return s3Client
}

String getJdbcPassword() {
String sk = context.config.otherConfigs.get("jdbcPassword");
return sk
Expand Down
Loading