From 6329f959f27920179604e1a015003a0f6614bd97 Mon Sep 17 00:00:00 2001 From: "k.kedron" Date: Fri, 20 Mar 2020 11:25:54 +0100 Subject: 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 Change-Id: Ia85f166de44e6461dffbb001d5f7b8c4a0ba81c3 --- .../sdc/be/dao/cassandra/schema/SdcSchemaUtils.java | 17 ++++++++++++----- 1 file 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); } -- cgit 1.2.3-korg