for (Shard shard : shards) {
shardNames.add(shard.getName());
}
for (final String shardName : shardNames) {
List<String> nodes = _protocol.registerChildListener(this, PathDef.SHARD_TO_NODES, shardName,
new IAddRemoveListener() {
@Override
public void removed(String nodeName) {
LOG.info("shard '" + shardName + "' removed from node " + nodeName + "'");
Collection<String> shardNodes = new ArrayList<String>(_selectionPolicy.getShardNodes(shardName));
shardNodes.remove(nodeName);