summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2023-07-26 17:33:35 +0100
committermpriyank <priyank.maheshwari@est.tech>2023-08-18 13:40:10 +0100
commitf4778800c815fbc962b194a177525957a564231d (patch)
tree1075f0c9173f0511cf9e7410adcf80494355aceb /cps-service/src/main/java
parenta52b1825f99318181cd356dcde1b1db46c1098ac (diff)
Device heartbeat listener
- Infrastructure code to have the kafka listener and distributed set in place - performance tested locally - testware added Issue-ID: CPS-1642 Change-Id: I775dbe6e6b520b8777faa08610db439877757572 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r--cps-service/src/main/java/org/onap/cps/cache/HazelcastCacheConfig.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/cache/HazelcastCacheConfig.java b/cps-service/src/main/java/org/onap/cps/cache/HazelcastCacheConfig.java
index 405e6e2a88..067191b5a5 100644
--- a/cps-service/src/main/java/org/onap/cps/cache/HazelcastCacheConfig.java
+++ b/cps-service/src/main/java/org/onap/cps/cache/HazelcastCacheConfig.java
@@ -24,6 +24,7 @@ import com.hazelcast.config.Config;
import com.hazelcast.config.MapConfig;
import com.hazelcast.config.NamedConfig;
import com.hazelcast.config.QueueConfig;
+import com.hazelcast.config.SetConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import lombok.extern.slf4j.Slf4j;
@@ -57,6 +58,10 @@ public class HazelcastCacheConfig {
if (namedConfig instanceof QueueConfig) {
config.addQueueConfig((QueueConfig) namedConfig);
}
+ if (namedConfig instanceof SetConfig) {
+ config.addSetConfig((SetConfig) namedConfig);
+ }
+
config.setClusterName(clusterName);
updateDiscoveryMode(config);
return config;
@@ -76,6 +81,13 @@ public class HazelcastCacheConfig {
return commonQueueConfig;
}
+ protected static SetConfig createSetConfig(final String configName) {
+ final SetConfig commonSetConfig = new SetConfig(configName);
+ commonSetConfig.setBackupCount(1);
+ commonSetConfig.setAsyncBackupCount(1);
+ return commonSetConfig;
+ }
+
protected void updateDiscoveryMode(final Config config) {
if (cacheKubernetesEnabled) {
log.info("Enabling kubernetes mode with service-name : {}", cacheKubernetesServiceName);