Example usage for Java org.apache.hadoop.net NetUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
void | addStaticResolution(String host, String resolvedName) Adds a static resolution for host. |
void | connect(Socket socket, SocketAddress address, int timeout) This is a drop-in replacement for Socket#connect(SocketAddress,int) . |
void | connect(Socket socket, SocketAddress endpoint, SocketAddress localAddr, int timeout) Like NetUtils#connect(Socket,SocketAddress,int) but also takes a local address and port to bind the socket to. |
InetSocketAddress | createSocketAddr(String target) Util method to build socket addr from either: |
InetSocketAddress | createSocketAddr(String target, int defaultPort) Util method to build socket addr from either: |
InetSocketAddress | createSocketAddr(String target, int defaultPort, String configName) Create an InetSocketAddress from the given target string and default port. |
InetSocketAddress | createSocketAddrForHost(String host, int port) Create a socket address with the given host and port. |
URI | getCanonicalUri(URI uri, int defaultPort) Resolve the uri's hostname and add the default port if not in the uri |
InetSocketAddress | getConnectAddress(Server server) Returns InetSocketAddress that a client can use to connect to the server. |
InetSocketAddress | getConnectAddress(InetSocketAddress addr) Returns an InetSocketAddress that a client can use to connect to the given listening address. |
SocketFactory | getDefaultSocketFactory(Configuration conf) Get the default socket factory as specified by the configuration parameter hadoop.rpc.socket.factory.default |
int | getFreeSocketPort() Return a free port number. |
String | getHostname() Return hostname without throwing exception. |
String | getHostPortString(InetSocketAddress addr) Compose a "host:port" string from the address. |
SocketInputWrapper | getInputStream(Socket socket) Same as getInputStream(socket, socket.getSoTimeout()). |
List | getIPs(String subnet, boolean returnSubinterfaces) Return an InetAddress for each interface that matches the given subnet specified using CIDR notation. |
OutputStream | getOutputStream(Socket socket) Same as getOutputStream(socket, 0). |
OutputStream | getOutputStream(Socket socket, long timeout) Returns OutputStream for the socket. |
SocketFactory | getSocketFactory(Configuration conf, Class> clazz) Get the socket factory for the given class according to its configuration parameter hadoop.rpc.socket.factory.class.<ClassName>. |
boolean | isLocalAddress(InetAddress addr) Given an InetAddress, checks to see if the address is a local address, by comparing the address with all the interfaces on the node. |
boolean | isValidSubnet(String subnet) |
String | normalizeHostName(String name) Given a string representation of a host, return its ip address in textual presentation. |
IOException | wrapException(final String destHost, final int destPort, final String localHost, final int localPort, final IOException exception) Take an IOException , the local host port and remote host port details and return an IOException with the input exception as the cause and also include the host details. |