summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2020-03-20 11:25:54 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-22 11:42:07 +0000
commit6329f959f27920179604e1a015003a0f6614bd97 (patch)
treed63b87cadedb76e5c20a5d6f8fa68c776cf87091
parent13a7f6743fbcc736c871d8168d2a7dcbda1daaba (diff)
Added socketReadTimeout to be apply
Added socket ReadTimeout to be apply in the SdcSchemaUtil which is use by sdc-cs-init Issue-ID: SDC-2759 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: Ia85f166de44e6461dffbb001d5f7b8c4a0ba81c3
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java
index 76532f6ed8..862e2adcc0 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java
@@ -148,15 +148,22 @@ public class SdcSchemaUtils {
}
return true;
}
-
-
+
private void setSocketOptions(Cluster.Builder clusterBuilder, Configuration.CassandrConfig config) {
- SocketOptions socketOptions =new SocketOptions();
+ SocketOptions socketOptions = new SocketOptions();
Integer socketConnectTimeout = config.getSocketConnectTimeout();
- if( socketConnectTimeout!=null ){
- log.info("SocketConnectTimeout was provided, setting Cassandra client to use SocketConnectTimeout: {} .",socketConnectTimeout);
+ if (socketConnectTimeout != null) {
+ log.info("SocketConnectTimeout was provided, setting Cassandra client to use SocketConnectTimeout: {} .",
+ socketConnectTimeout);
socketOptions.setConnectTimeoutMillis(socketConnectTimeout);
}
+
+ Integer socketReadTimeout = config.getSocketReadTimeout();
+ if (socketReadTimeout != null) {
+ log.info("SocketReadTimeout was provided, setting Cassandra client to use SocketReadTimeout: {} .",
+ socketReadTimeout);
+ socketOptions.setReadTimeoutMillis(socketReadTimeout);
+ }
clusterBuilder.withSocketOptions(socketOptions);
}