Class TaskManagerLocation.DefaultHostNameSupplier
java.lang.Object
org.apache.flink.runtime.taskmanager.TaskManagerLocation.DefaultHostNameSupplier
- All Implemented Interfaces:
Serializable,TaskManagerLocation.HostNameSupplier
- Enclosing class:
- TaskManagerLocation
@VisibleForTesting
public static class TaskManagerLocation.DefaultHostNameSupplier
extends Object
implements TaskManagerLocation.HostNameSupplier
This Supplier class could retrieve the FQDN host name of the given InetAddress on demand,
extract the pure host name and cache the results for later use.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the fully-qualified domain name the TaskManager.Gets the hostname of the TaskManager.
-
Constructor Details
-
DefaultHostNameSupplier
-
-
Method Details
-
getHostName
Gets the hostname of the TaskManager. The hostname derives from the fully qualified domain name (FQDN, seeTaskManagerLocation.getFQDNHostname()):- If the FQDN is the textual IP address, then the hostname is also the IP address
- If the FQDN has only one segment (such as "localhost", or "host17"), then this is used as the hostname.
- If the FQDN has multiple segments (such as "worker3.subgroup.company.net"), then the first segment (here "worker3") will be used as the hostname.
- Specified by:
getHostNamein interfaceTaskManagerLocation.HostNameSupplier- Returns:
- The hostname of the TaskManager.
-
getFqdnHostName
Returns the fully-qualified domain name the TaskManager. If the name could not be determined, the return value will be a textual representation of the TaskManager's IP address.- Specified by:
getFqdnHostNamein interfaceTaskManagerLocation.HostNameSupplier- Returns:
- The fully-qualified domain name of the TaskManager.
-