@Override
 protected void doClose() throws ElasticsearchException {
   masterFD.close();
   nodesFD.close();
   publishClusterState.close();
   membership.close();
   pingService.close();
 }
 @Override
 public void publish(ClusterState clusterState, AckListener ackListener) {
   if (!master) {
     throw new ElasticsearchIllegalStateException("Shouldn't publish state when not master");
   }
   latestDiscoNodes = clusterState.nodes();
   nodesFD.updateNodes(clusterState.nodes());
   publishClusterState.publish(clusterState, ackListener);
 }