Class TaskManagerLocation

    • Constructor Detail

      • TaskManagerLocation

        @VisibleForTesting
        public TaskManagerLocation​(ResourceID resourceID,
                                   InetAddress inetAddress,
                                   int dataPort,
                                   TaskManagerLocation.HostNameSupplier hostNameSupplier,
                                   String nodeId)
        Constructs a new instance connection info object. The constructor will attempt to retrieve the instance's host name and domain name through the operating system's lookup mechanisms.
        Parameters:
        inetAddress - the network address the instance's task manager binds its sockets to
        dataPort - the port instance's task manager expects to receive transfer envelopes on
        hostNameSupplier - the supplier for obtaining fully-qualified domain name and pure hostname of the task manager
        nodeId - the ID of node where the task manager is located on.
      • TaskManagerLocation

        @VisibleForTesting
        public TaskManagerLocation​(ResourceID resourceID,
                                   InetAddress inetAddress,
                                   int dataPort)
        Constructs a new instance connection info object. The constructor will attempt to retrieve the instance's host name and domain name through the operating system's lookup mechanisms.
        Parameters:
        inetAddress - the network address the instance's task manager binds its sockets to
        dataPort - the port instance's task manager expects to receive transfer envelopes on
    • Method Detail

      • getResourceID

        public ResourceID getResourceID()
        Gets the ID of the resource in which the TaskManager is started. The format of this depends on how the TaskManager is started:
        • If the TaskManager is started via YARN, this is the YARN container ID.
        • If the TaskManager is started in standalone mode, or via a MiniCluster, this is a random ID.
        • Other deployment modes can set the resource ID in other ways.
        Returns:
        The ID of the resource in which the TaskManager is started
      • dataPort

        public int dataPort()
        Returns the port instance's task manager expects to receive transfer envelopes on.
        Returns:
        the port instance's task manager expects to receive transfer envelopes on
      • address

        public InetAddress address()
        Returns the network address the instance's task manager binds its sockets to.
        Returns:
        the network address the instance's task manager binds its sockets to
      • addressString

        public String addressString()
        Gets the IP address where the TaskManager operates.
        Returns:
        The IP address.
      • getFQDNHostname

        public String getFQDNHostname()
        Returns the fully-qualified domain name of the TaskManager provided by hostNameSupplier.
        Returns:
        The fully-qualified domain name of the TaskManager.
      • getHostname

        public String getHostname()
        Gets the hostname of the TaskManager from hostNameSupplier.
        Returns:
        The hostname of the TaskManager.
      • getNodeId

        public String getNodeId()
        Return the ID of node where the task manager is located on.
        Returns:
        The ID of node where the task manager is located on.
      • getEndpoint

        public String getEndpoint()
        Gets the endpoint of the TaskManager in the format of "$HOST:$PORT".
        Returns:
        The endpoint of the TaskManager.
      • getHostName

        public static String getHostName​(InetAddress inetAddress)
        Gets the hostname of the TaskManager based on the network address.
        Parameters:
        inetAddress - the network address that the TaskManager binds its sockets to
        Returns:
        hostname of the TaskManager
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object