Skip to content

Commit 91a5709

Browse files
committed
Use Runtime.availableProcessors() as a default value for concurrentConnections
1 parent b7d36f4 commit 91a5709

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/src/main/java/com/instaclustr/esop/impl/AbstractOperationRequest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public abstract class AbstractOperationRequest extends OperationRequest {
2222
converter = StorageLocationTypeConverter.class,
2323
description = "Location to which files will be backed up or restored from, in form " +
2424
"cloudProvider://bucketName/clusterId/datacenterId/nodeId or file:///some/path/bucketName/clusterId/datacenterId/nodeId. " +
25-
"'cloudProvider' is one of 's3', 'oracle', 'ceph', 'minio', 'azure' or 'gcp'.",
25+
"'cloudProvider' is one of 's3', 'azure' or 'gcp'.",
2626
required = true)
2727
@JsonSerialize(using = StorageLocationSerializer.class)
2828
@JsonDeserialize(using = StorageLocationDeserializer.class)
@@ -48,8 +48,7 @@ public abstract class AbstractOperationRequest extends OperationRequest {
4848
public RetrySpec retry = new RetrySpec();
4949

5050
@Option(names = {"--cc", "--concurrent-connections"},
51-
description = "Number of files (or file parts) to download concurrently. Higher values will increase throughput. Default is 10.",
52-
defaultValue = "10"
51+
description = "Number of files (or file parts) to download / upload / hash concurrently. Higher values will increase throughput. Default is number of available CPUs."
5352
)
5453
@JsonProperty("concurrentConnections")
5554
public Integer concurrentConnections;
@@ -60,6 +59,8 @@ public abstract class AbstractOperationRequest extends OperationRequest {
6059

6160
public AbstractOperationRequest() {
6261
// for picocli
62+
if (concurrentConnections == null)
63+
concurrentConnections = Runtime.getRuntime().availableProcessors();
6364
}
6465

6566
public AbstractOperationRequest(final StorageLocation storageLocation,
@@ -74,7 +75,7 @@ public AbstractOperationRequest(final StorageLocation storageLocation,
7475
this.skipBucketVerification = skipBucketVerification;
7576
this.proxySettings = proxySettings;
7677
this.retry = retry == null ? new RetrySpec() : retry;
77-
this.concurrentConnections = concurrentConnections == null ? 10 : concurrentConnections;
78+
this.concurrentConnections = concurrentConnections == null ? Runtime.getRuntime().availableProcessors() : concurrentConnections;
7879
this.kmsKeyId = kmsKeyId;
7980
}
8081

0 commit comments

Comments
 (0)