From fe70b510803256dc89b95c063cbd3dfd2d900f2c Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 3 May 2012 14:59:29 +0300 Subject: [PATCH] add debug message when adding and removing addressing from the transport client --- .../client/transport/TransportClientNodesService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java index c1fb7e22af6..bb6c1d11278 100644 --- a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java +++ b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java @@ -122,7 +122,9 @@ public class TransportClientNodesService extends AbstractComponent { public TransportClientNodesService addTransportAddress(TransportAddress transportAddress) { synchronized (transportMutex) { ImmutableList.Builder 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(); return this; @@ -134,6 +136,8 @@ public class TransportClientNodesService extends AbstractComponent { for (DiscoveryNode otherNode : listedNodes) { if (!otherNode.address().equals(transportAddress)) { builder.add(otherNode); + } else { + logger.debug("removing address {}", otherNode); } } listedNodes = builder.build();