Skip to content
Snippets Groups Projects
Commit b23c261f authored by ivan's avatar ivan
Browse files

[s3] added maxConnections to Client configuration

parent aa1f2aac
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,9 @@ Running the command:
the workload A will be executed with 50/50 updates/reads.
#### S3 Storage Configuration Parameters
The parameters to configure the S3 client can be set using the file "s3-binding/conf/s3.properties". This is highly advisable for the parameters s3.accessKeyId and s3.secretKey. All the other parameters can be set also on the command line. Here the list of all the parameters that is possible to configure:
- `table`
- This should be a S3 Storage bucket name and it replace the standard table name assigned by YCSB.
......@@ -48,3 +51,13 @@ the workload A will be executed with 50/50 updates/reads.
- `s3.maxErrorRetry`
- This is the maxErrorRetry parameter for the S3Client.
- `s3.protocol`
- This is the protocol parameter for the S3Client. The default value is HTTPS.
- `s3.sse`
- This parameter set to true activates the Server Side Encryption.
- `s3.ssec`
- This parameter if not null activates the SSE-C client side encryption. The value passed with this parameter is the client key used to encrpyt the files.
......@@ -19,5 +19,13 @@ s3.sse=false
# activating the SSE-C client side encryption if used
#s3.ssec=U2CccCI40he2mZtg2aCEzofP7nQsfy4nP14VSYu6bFA=
# set the protocol to use for the Client, default is HTTP
s3.protocol=HTTPS
# set the protocol to use for the Client, default is HTTPS
#s3.protocol=HTTPS
# set the maxConnections to use for the Client, it should be not less than the
# threads since only one client is created and shared between threads
#s3.maxConnections=
# set the maxErrorRetry parameter to use for the Client
#s3.maxErrorRetry=
......@@ -149,6 +149,7 @@ public class S3Client extends DB {
String endPoint = null;
String region = null;
String maxErrorRetry = null;
String maxConnections = null;
String protocol = null;
BasicAWSCredentials s3Credentials;
ClientConfiguration clientConfig;
......@@ -185,6 +186,10 @@ public class S3Client extends DB {
if (maxErrorRetry == null){
maxErrorRetry = propsCL.getProperty("s3.maxErrorRetry", "15");
}
maxConnections = props.getProperty("s3.maxConnections");
if (maxConnections == null){
maxConnections = propsCL.getProperty("s3.maxConnections");
}
protocol = props.getProperty("s3.protocol");
if (protocol == null){
protocol = propsCL.getProperty("s3.protocol", "HTTP");
......@@ -208,9 +213,14 @@ public class S3Client extends DB {
s3Credentials = new BasicAWSCredentials(accessKeyId, secretKey);
clientConfig = new ClientConfiguration();
clientConfig.setMaxErrorRetry(Integer.parseInt(maxErrorRetry));
if(protocol.equals("HTTPS")) {
if(protocol.equals("HTTP")) {
clientConfig.setProtocol(Protocol.HTTP);
} else {
clientConfig.setProtocol(Protocol.HTTPS);
}
if(maxConnections != null) {
clientConfig.setMaxConnections(Integer.parseInt(maxConnections));
}
s3Client = new AmazonS3Client(s3Credentials, clientConfig);
s3Client.setRegion(Region.getRegion(Regions.fromName(region)));
s3Client.setEndpoint(endPoint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment