From aa7eeb999f1fcb7edc190fbcefe9747fc6e63059 Mon Sep 17 00:00:00 2001 From: Sebastien Premont-Tendland Date: Mon, 17 Feb 2020 11:14:02 -0500 Subject: Removed manual shutdown hook for hazelcast Shutdown hook for hazelcast are already working with spring boot. Just changed the policy to GRACEFUL (default is TERMINATE). This allow hazelcast to shutdown gracefully and recover from a rolling upgrade Also updated the Dockerfile to use multi stage to reduce by ~200Mb the docker image size. Issue-ID: CCSDK-2011 Signed-off-by: Sebastien Premont-Tendland Change-Id: I0034145c7acefa88ed8d16f23a29249c7225ace3 --- .../blueprintsprocessor/core/cluster/HazlecastClusterService.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ms/blueprintsprocessor/modules/commons/processor-core') diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazlecastClusterService.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazlecastClusterService.kt index 09641458c..6be3334bb 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazlecastClusterService.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazlecastClusterService.kt @@ -54,7 +54,7 @@ open class HazlecastClusterService : BluePrintClusterService { var joinedLite = false override suspend fun startCluster(configuration: T) { - /** Get the Hazelcast Cliet or Server instance */ + /** Get the Hazelcast Client or Server instance */ hazelcast = when (configuration) { is Config -> { @@ -101,6 +101,8 @@ open class HazlecastClusterService : BluePrintClusterService { } else { /** Hazelcast Server from config file */ val hazelcastServerConfiguration = FileSystemYamlConfig(normalizedFile(configFile)) + hazelcastServerConfiguration.clusterName = configuration.id + hazelcastServerConfiguration.instanceName = configuration.nodeId hazelcastServerConfiguration.properties = configuration.properties hazelcastServerConfiguration.memberAttributeConfig = memberAttributeConfig joinedLite = hazelcastServerConfiguration.isLiteMember @@ -116,7 +118,7 @@ open class HazlecastClusterService : BluePrintClusterService { } /** Add the Membership Listeners */ - hazelcast.cluster.addMembershipListener(BlueprintsClusterMembershipListener(this)) + hazelcast.cluster.addMembershipListener(BlueprintsClusterMembershipListener()) log.info( "Cluster(${hazelcast.config.clusterName}) node(${hazelcast.name}) created successfully...." ) @@ -207,7 +209,7 @@ open class HazlecastClusterService : BluePrintClusterService { } } -open class BlueprintsClusterMembershipListener(val hazlecastClusterService: HazlecastClusterService) : +open class BlueprintsClusterMembershipListener() : MembershipListener { private val log = logger(BlueprintsClusterMembershipListener::class) -- cgit 1.2.3-korg