diff options
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java index 05a0eb52ef..bc5f77ba1b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java @@ -1,3 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * Modifications copyright (c) 2018 Nokia + * ================================================================================ + */ package org.openecomp.sdc.be.components.impl; import com.datastax.driver.core.Cluster; @@ -12,6 +33,7 @@ import org.openecomp.sdc.common.util.GeneralUtility; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; + import java.io.FileInputStream; import java.io.InputStream; import java.util.*; @@ -28,6 +50,8 @@ public class CassandraHealthCheck { private int HC_FormulaNumber; + private SdcSchemaUtils sdcSchemaUtils; + @PostConstruct private void init() { @@ -61,14 +85,14 @@ public class CassandraHealthCheck { } log.info("All sdc keyspaces are : {}", sdcKeyspaces); - + sdcSchemaUtils = new SdcSchemaUtils(); //Calculate the Formula of Health Check Cluster cluster = null; try { log.info("creating cluster for Cassandra Health Check."); //Create cluster from nodes in cassandra configuration - cluster = SdcSchemaUtils.createCluster(); + cluster = sdcSchemaUtils.createCluster(); if (cluster == null) { log.error("Failure create cassandra cluster."); return; @@ -141,7 +165,7 @@ public class CassandraHealthCheck { Session session = null; try { log.info("creating cluster for Cassandra for monitoring."); - cluster = SdcSchemaUtils.createCluster(); + cluster = sdcSchemaUtils.createCluster(); if (cluster == null) { log.error("Failure create cassandra cluster."); return false; |