diff --git a/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/NodeListComparator.java b/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/NodeListComparator.java index a51a3c59..dff3c495 100644 --- a/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/NodeListComparator.java +++ b/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/NodeListComparator.java @@ -84,19 +84,22 @@ List compareNodeLists(final List oldNodes, final List changesList, Iterator oldIterator) { + private Node processNodeRemoved(final Node oldNode, final List changesList, final Iterator oldIterator) + { LOG.info("Node has been removed, Node id: {}", oldNode.getHostId()); changesList.add(new NodeChangeRecord(oldNode, NodeChangeRecord.NodeChangeType.DELETE)); return getNode(oldIterator); } - private Node processNodeAdded(Node newNode, List changesList, Iterator newIterator) { + private Node processNodeAdded(final Node newNode, final List changesList, final Iterator newIterator) + { LOG.info("Node has been added, Node id: {}", newNode.getHostId()); changesList.add(new NodeChangeRecord(newNode, NodeChangeRecord.NodeChangeType.INSERT)); return getNode(newIterator); } - private static void checkIPAddress(Node oldNode, Node newNode, List changesList) { + private static void checkIPAddress(final Node oldNode, final Node newNode, final List changesList) + { // same host id, now check the ipaddress is still the same if (!oldNode.getListenAddress().equals(newNode.getListenAddress())) { diff --git a/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/ReloadNodesService.java b/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/ReloadNodesService.java index 40d9ca11..a0034124 100644 --- a/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/ReloadNodesService.java +++ b/application/src/main/java/com/ericsson/bss/cassandra/ecchronos/application/spring/ReloadNodesService.java @@ -14,7 +14,7 @@ */ package com.ericsson.bss.cassandra.ecchronos.application.spring; -import com.datastax.oss.driver.api.core.CqlSession; + import com.datastax.oss.driver.api.core.metadata.Node; import com.ericsson.bss.cassandra.ecchronos.application.config.Config; import com.ericsson.bss.cassandra.ecchronos.connection.DistributedJmxConnectionProvider; @@ -100,7 +100,8 @@ void reloadNodes() } } - private void processDeleteRecord(NodeChangeRecord nodeChangeRecord) { + private void processDeleteRecord(final NodeChangeRecord nodeChangeRecord) + { myEccNodesSync.deleteNodeStatus(nodeChangeRecord.getNode().getDatacenter(), nodeChangeRecord.getNode().getHostId()); try { @@ -111,8 +112,8 @@ private void processDeleteRecord(NodeChangeRecord nodeChangeRecord) { LOG.info("Node {} JMX connection removal failed", nodeChangeRecord.getNode().getHostId()); } } - - private void processInsertRecord(NodeChangeRecord nodeChangeRecord) { + private void processInsertRecord(final NodeChangeRecord nodeChangeRecord) + { myEccNodesSync.verifyAcquireNode(nodeChangeRecord.getNode()); try {