com.hazelcast.spi.discovery.multicast

## Class MulticastDiscoveryStrategy

- java.lang.Object
- - com.hazelcast.spi.discovery.AbstractDiscoveryStrategy
  - - com.hazelcast.spi.discovery.multicast.MulticastDiscoveryStrategy

- All Implemented Interfaces:
    DiscoveryStrategy

      public class MulticastDiscoveryStrategy
      extends AbstractDiscoveryStrategy

  The multicast `DiscoveryStrategy`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MulticastDiscoveryStrategy(DiscoveryNode discoveryNode, ILogger logger, Map<String,Comparable> properties)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` The `stop` method is used to stop internal services, sockets or to destroy any kind of internal state.
    `Map<String,Object>` | `discoverLocalMetadata()` Returns a map with discovered metadata provided by the runtime environment.
    `Iterable<DiscoveryNode>` | `discoverNodes()` Returns a set of all discovered nodes based on the defined properties that were used to create the `DiscoveryStrategy` instance.
    `PartitionGroupStrategy` | `getPartitionGroupStrategy()` Returns a custom implementation of a `PartitionGroupStrategy` to override default behavior of zone aware backup strategies `PartitionGroupMetaData` or to provide a specific behavior in case the discovery environment does not provide information about the infrastructure to be used for automatic configuration.
    `void` | `start()` The `start` method is used to initialize internal state and perform any kind of startup procedure like multicast socket creation.

    - ### Methods inherited from class com.hazelcast.spi.discovery.AbstractDiscoveryStrategy

      `getLogger, getOrDefault, getOrDefault, getOrNull, getOrNull, getProperties`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MulticastDiscoveryStrategy

          public MulticastDiscoveryStrategy(DiscoveryNode discoveryNode,
                                            ILogger logger,
                                            Map<String,Comparable> properties)

  - ### Method Detail

    - #### start

          public void start()

      Description copied from interface: `DiscoveryStrategy`
      The `start` method is used to initialize internal state and perform any kind of startup procedure like multicast socket creation. The behavior of this method might change based on the `DiscoveryNode` instance passed to the `DiscoveryStrategyFactory`.
      Specified by:
        `start` in interface `DiscoveryStrategy`
      Overrides:
        `start` in class `AbstractDiscoveryStrategy`

    - #### discoverNodes

          public Iterable<DiscoveryNode> discoverNodes()

      Description copied from interface: `DiscoveryStrategy`
      Returns a set of all discovered nodes based on the defined properties that were used to create the `DiscoveryStrategy` instance.
      Returns:
        a set of all discovered nodes

    - #### destroy

          public void destroy()

      Description copied from interface: `DiscoveryStrategy`
      The `stop` method is used to stop internal services, sockets or to destroy any kind of internal state.
      Specified by:
        `destroy` in interface `DiscoveryStrategy`
      Overrides:
        `destroy` in class `AbstractDiscoveryStrategy`

    - #### getPartitionGroupStrategy

          public PartitionGroupStrategy getPartitionGroupStrategy()

      Description copied from interface: `DiscoveryStrategy`
      Returns a custom implementation of a `PartitionGroupStrategy` to override default behavior of zone aware backup strategies `PartitionGroupMetaData` or to provide a specific behavior in case the discovery environment does not provide information about the infrastructure to be used for automatic configuration.
      Specified by:
        `getPartitionGroupStrategy` in interface `DiscoveryStrategy`
      Overrides:
        `getPartitionGroupStrategy` in class `AbstractDiscoveryStrategy`
      Returns:
        a custom implementation of a `PartitionGroupStrategy` otherwise `null` in case of the default implementation is to be used

    - #### discoverLocalMetadata

          public Map<String,Object> discoverLocalMetadata()

      Description copied from interface: `DiscoveryStrategy`
      Returns a map with discovered metadata provided by the runtime environment. Those information may include, but are not limited, to location information like datacenter, rack, host or additional tags to be used for custom purpose.

      Information discovered from this method are shaded into the `Member`s attributes. Existing attributes will not be overridden, that way local attribute configuration overrides provided metadata.

      The default implementation provides an empty map with no further metadata configured. Returning `null` is not permitted and will most probably result in an `NullPointerException` inside the cluster system.
      Specified by:
        `discoverLocalMetadata` in interface `DiscoveryStrategy`
      Overrides:
        `discoverLocalMetadata` in class `AbstractDiscoveryStrategy`
      Returns:
        a map of discovered metadata as provided by the runtime environment

Copyright © 2019. All rights reserved.