Skip to content

Commit

Permalink
Ericsson#699 Reload nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Chandler committed Oct 14, 2024
1 parent 4aaadf0 commit f9c1ce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,22 @@ List<NodeChangeRecord> compareNodeLists(final List<Node> oldNodes, final List<No
return changesList;
}

private Node processNodeRemoved(Node oldNode, List<NodeChangeRecord> changesList, Iterator<Node> oldIterator) {
private Node processNodeRemoved(final Node oldNode, final List<NodeChangeRecord> changesList, final Iterator<Node> 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<NodeChangeRecord> changesList, Iterator<Node> newIterator) {
private Node processNodeAdded(final Node newNode, final List<NodeChangeRecord> changesList, final Iterator<Node> 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<NodeChangeRecord> changesList) {
private static void checkIPAddress(final Node oldNode, final Node newNode, final List<NodeChangeRecord> changesList)
{
// same host id, now check the ipaddress is still the same
if (!oldNode.getListenAddress().equals(newNode.getListenAddress()))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down

0 comments on commit f9c1ce9

Please sign in to comment.