diff options
author | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2020-02-17 11:14:02 -0500 |
---|---|---|
committer | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2020-02-17 11:30:57 -0500 |
commit | aa7eeb999f1fcb7edc190fbcefe9747fc6e63059 (patch) | |
tree | a84dffc4fdde79555ae81602e6c1c69eb55a9768 /ms/blueprintsprocessor/modules/commons | |
parent | e0e8b14e106cff2dccc76e6edcc1a7ee6ffe10da (diff) |
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 <sebastien.premont@bell.ca>
Change-Id: I0034145c7acefa88ed8d16f23a29249c7225ace3
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/cluster/HazlecastClusterService.kt | 8 |
1 files changed, 5 insertions, 3 deletions
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 <T> 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) |