add debug message when adding and removing addressing from the transport client

This commit is contained in:
Shay Banon 2012-05-03 14:59:29 +03:00
parent 07f3ed05b0
commit fe70b51080
1 changed files with 5 additions and 1 deletions

View File

@ -122,7 +122,9 @@ public class TransportClientNodesService extends AbstractComponent {
public TransportClientNodesService addTransportAddress(TransportAddress transportAddress) { public TransportClientNodesService addTransportAddress(TransportAddress transportAddress) {
synchronized (transportMutex) { synchronized (transportMutex) {
ImmutableList.Builder<DiscoveryNode> builder = ImmutableList.builder(); ImmutableList.Builder<DiscoveryNode> builder = ImmutableList.builder();
listedNodes = builder.addAll(listedNodes).add(new DiscoveryNode("#transport#-" + tempNodeIdGenerator.incrementAndGet(), transportAddress)).build(); DiscoveryNode node = new DiscoveryNode("#transport#-" + tempNodeIdGenerator.incrementAndGet(), transportAddress);
logger.debug("adding address {}", node);
listedNodes = builder.addAll(listedNodes).add(node).build();
} }
nodesSampler.sample(); nodesSampler.sample();
return this; return this;
@ -134,6 +136,8 @@ public class TransportClientNodesService extends AbstractComponent {
for (DiscoveryNode otherNode : listedNodes) { for (DiscoveryNode otherNode : listedNodes) {
if (!otherNode.address().equals(transportAddress)) { if (!otherNode.address().equals(transportAddress)) {
builder.add(otherNode); builder.add(otherNode);
} else {
logger.debug("removing address {}", otherNode);
} }
} }
listedNodes = builder.build(); listedNodes = builder.build();