DiscoverNodes reloads the client connections by fetching information from the cluster.
()
| 645 | |
| 646 | // DiscoverNodes reloads the client connections by fetching information from the cluster. |
| 647 | func (c *BaseClient) DiscoverNodes() error { |
| 648 | if c.isClosed() { |
| 649 | return ErrClosed |
| 650 | } |
| 651 | if dt, ok := c.Transport.(elastictransport.Discoverable); ok { |
| 652 | return dt.DiscoverNodes() |
| 653 | } |
| 654 | return errors.New("transport is missing method DiscoverNodes()") |
| 655 | } |
| 656 | |
| 657 | func (c *BaseClient) isClosed() bool { |
| 658 | return atomic.LoadUint32(&c.closeDone) != 0 |
no test coverage detected