public class TaskManagerLocation extends Object implements Comparable<TaskManagerLocation>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TaskManagerLocation.DefaultHostNameSupplier
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.
|
static interface |
TaskManagerLocation.HostNameSupplier |
static class |
TaskManagerLocation.IpOnlyHostNameSupplier
This Supplier class returns the IP address of the given InetAddress directly, therefore no
reverse DNS lookup is required.
|
static class |
TaskManagerLocation.ResolutionMode
The DNS resolution mode for TaskManager's IP address.
|
Constructor and Description |
---|
TaskManagerLocation(ResourceID resourceID,
InetAddress inetAddress,
int dataPort)
Constructs a new instance connection info object.
|
TaskManagerLocation(ResourceID resourceID,
InetAddress inetAddress,
int dataPort,
TaskManagerLocation.HostNameSupplier hostNameSupplier,
String nodeId)
Constructs a new instance connection info object.
|
Modifier and Type | Method and Description |
---|---|
InetAddress |
address()
Returns the network address the instance's task manager binds its sockets to.
|
String |
addressString()
Gets the IP address where the TaskManager operates.
|
int |
compareTo(TaskManagerLocation o) |
int |
dataPort()
Returns the port instance's task manager expects to receive transfer envelopes on.
|
boolean |
equals(Object obj) |
static TaskManagerLocation |
fromUnresolvedLocation(UnresolvedTaskManagerLocation unresolvedLocation,
TaskManagerLocation.ResolutionMode resolutionMode) |
String |
getFQDNHostname()
Returns the fully-qualified domain name of the TaskManager provided by
hostNameSupplier . |
String |
getHostname()
Gets the hostname of the TaskManager from
hostNameSupplier . |
static String |
getHostName(InetAddress inetAddress)
Gets the hostname of the TaskManager based on the network address.
|
String |
getNodeId()
Return the ID of node where the task manager is located on.
|
ResourceID |
getResourceID()
Gets the ID of the resource in which the TaskManager is started.
|
int |
hashCode() |
String |
toString() |
@VisibleForTesting public TaskManagerLocation(ResourceID resourceID, InetAddress inetAddress, int dataPort, TaskManagerLocation.HostNameSupplier hostNameSupplier, String nodeId)
inetAddress
- the network address the instance's task manager binds its sockets todataPort
- the port instance's task manager expects to receive transfer envelopes onhostNameSupplier
- the supplier for obtaining fully-qualified domain name and pure
hostname of the task managernodeId
- the ID of node where the task manager is located on.@VisibleForTesting public TaskManagerLocation(ResourceID resourceID, InetAddress inetAddress, int dataPort)
inetAddress
- the network address the instance's task manager binds its sockets todataPort
- the port instance's task manager expects to receive transfer envelopes onpublic static TaskManagerLocation fromUnresolvedLocation(UnresolvedTaskManagerLocation unresolvedLocation, TaskManagerLocation.ResolutionMode resolutionMode) throws UnknownHostException
UnknownHostException
public ResourceID getResourceID()
public int dataPort()
public InetAddress address()
public String addressString()
public String getFQDNHostname()
hostNameSupplier
.public String getHostname()
hostNameSupplier
.public String getNodeId()
public static String getHostName(InetAddress inetAddress)
inetAddress
- the network address that the TaskManager binds its sockets topublic int compareTo(@Nonnull TaskManagerLocation o)
compareTo
in interface Comparable<TaskManagerLocation>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.