import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterInfo
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.logger
import org.onap.ccsdk.cds.controllerblueprints.core.utils.ClusterUtils
import org.springframework.boot.context.event.ApplicationReadyEvent
* if CLUSTER_ENABLED is present, then it will try to create cluster.
*/
@Component
-open class BlueprintProcessorCluster(private val bluePrintClusterService: BlueprintClusterService) {
+open class BluePrintProcessorCluster(private val bluePrintClusterService: BluePrintClusterService) {
- private val log = logger(BlueprintProcessorCluster::class)
+ private val log = logger(BluePrintProcessorCluster::class)
@EventListener(ApplicationReadyEvent::class)
fun startAndJoinCluster() = GlobalScope.launch {
- if (BlueprintConstants.CLUSTER_ENABLED) {
+ if (BluePrintConstants.CLUSTER_ENABLED) {
val clusterId = ClusterUtils.clusterId()
val nodeId = ClusterUtils.clusterNodeId()
val joinAsClient =
- (System.getenv(BlueprintConstants.PROPERTY_CLUSTER_JOIN_AS_CLIENT) ?: "false").toBoolean()
+ (System.getenv(BluePrintConstants.PROPERTY_CLUSTER_JOIN_AS_CLIENT) ?: "false").toBoolean()
- val clusterConfigFile = System.getenv(BlueprintConstants.PROPERTY_CLUSTER_CONFIG_FILE)
+ val clusterConfigFile = System.getenv(BluePrintConstants.PROPERTY_CLUSTER_CONFIG_FILE)
val properties = Properties()
properties["hazelcast.logging.type"] = "slf4j"