Class TcpDiscoveryVmIpFinder

    • Constructor Detail

      • TcpDiscoveryVmIpFinder

        public TcpDiscoveryVmIpFinder()
        Constructs new IP finder.
      • TcpDiscoveryVmIpFinder

        public TcpDiscoveryVmIpFinder​(boolean shared)
        Constructs new IP finder.
        Parameters:
        shared - true if IP finder is shared.
        See Also:
        setShared(boolean)
    • Method Detail

      • setAddresses

        @IgniteSpiConfiguration(optional=true)
        public TcpDiscoveryVmIpFinder setAddresses​(Collection<String> addrs)
                                            throws IgniteSpiException
        Parses provided values and initializes the internal collection of addresses.

        Addresses may be represented as follows:

        • IP address (e.g. 127.0.0.1, 9.9.9.9, etc);
        • IP address and port (e.g. 127.0.0.1:47500, 9.9.9.9:47501, etc);
        • IP address and port range (e.g. 127.0.0.1:47500..47510, 9.9.9.9:47501..47504, etc);
        • Hostname (e.g. host1.com, host2, etc);
        • Hostname and port (e.g. host1.com:47500, host2:47502, etc).
        • Hostname and port range (e.g. host1.com:47500..47510, host2:47502..47508, etc).

        If port is 0 or not provided then default port will be used (depends on discovery SPI configuration).

        If port range is provided (e.g. host:port1..port2) the following should be considered:

        • port1 < port2 should be true;
        • Both port1 and port2 should be greater than 0.
        Parameters:
        addrs - Known nodes addresses.
        Returns:
        this for chaining.
        Throws:
        IgniteSpiException - If any error occurs.
      • getRegisteredAddresses

        public Collection<InetSocketAddress> getRegisteredAddresses()
        Gets all addresses registered in this finder.
        Returns:
        All known addresses, potentially empty, but never null.
      • registerAddresses

        public void registerAddresses​(Collection<InetSocketAddress> addrs)
        Registers new addresses.

        Implementation should accept duplicates quietly, but should not register address if it is already registered.

        Parameters:
        addrs - Addresses to register. Not null and not empty.
      • unregisterAddresses

        public void unregisterAddresses​(Collection<InetSocketAddress> addrs)
        Unregisters provided addresses.

        Implementation should accept addresses that are currently not registered quietly (just no-op).

        Parameters:
        addrs - Addresses to unregister. Not null and not empty.
      • setShared

        public TcpDiscoveryVmIpFinder setShared​(boolean shared)
        Sets shared flag. If true then it is expected that IP addresses registered with IP finder will be seen by IP finders on all other nodes.
        Overrides:
        setShared in class TcpDiscoveryIpFinderAdapter
        Parameters:
        shared - true if this IP finder is shared.
        Returns:
        this for chaining.