clean connected nodes when closing a client

This commit is contained in:
Shay Banon 2011-07-25 15:25:10 +03:00
parent 549e9c7019
commit 7bdae651c3
1 changed files with 6 additions and 1 deletions

View File

@ -157,9 +157,14 @@ public class TransportClientNodesService extends AbstractComponent {
public void close() {
closed = true;
nodesSamplerFuture.cancel(true);
for (DiscoveryNode listedNode : listedNodes)
for (DiscoveryNode node : nodes) {
transportService.disconnectFromNode(node);
}
for (DiscoveryNode listedNode : listedNodes) {
transportService.disconnectFromNode(listedNode);
}
nodes = ImmutableList.of();
}
interface NodeSampler {
void sample();