/hadoop-0.20.2/hadoop-0.20.2/docs/api/org/apache/hadoop/net/NetUtils.html
HTML | 743 lines | 651 code | 70 blank | 22 comment | 0 complexity | 1e4be4081d2c6912f1a4634c01398124 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, LGPL-3.0, EPL-1.0
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.6.0_07) on Fri Feb 19 08:07:58 UTC 2010 -->
- <TITLE>
- NetUtils (Hadoop 0.20.2 API)
- </TITLE>
- <META NAME="date" CONTENT="2010-02-19">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="NetUtils (Hadoop 0.20.2 API)";
- }
- }
- </SCRIPT>
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" onload="windowTitle();">
- <HR>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NetUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/hadoop/net/DNSToSwitchMapping.html" title="interface in org.apache.hadoop.net"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/hadoop/net/NetworkTopology.html" title="class in org.apache.hadoop.net"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/hadoop/net/NetUtils.html" target="_top"><B>FRAMES</B></A>
- <A HREF="NetUtils.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- org.apache.hadoop.net</FONT>
- <BR>
- Class NetUtils</H2>
- <PRE>
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
- <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.net.NetUtils</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>NetUtils</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
- </PRE>
- <P>
- <HR>
- <P>
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <A NAME="constructor_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Constructor Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#NetUtils()">NetUtils</A></B>()</CODE>
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#addStaticResolution(java.lang.String, java.lang.String)">addStaticResolution</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> host,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> resolvedName)</CODE>
- <BR>
- Adds a static resolution for host.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#connect(java.net.Socket, java.net.SocketAddress, int)">connect</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/SocketAddress.html?is-external=true" title="class or interface in java.net">SocketAddress</A> endpoint,
- int timeout)</CODE>
- <BR>
- This is a drop-in replacement for
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#connect(java.net.SocketAddress, int)" title="class or interface in java.net"><CODE>Socket.connect(SocketAddress, int)</CODE></A>.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#createSocketAddr(java.lang.String)">createSocketAddr</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> target)</CODE>
- <BR>
- Util method to build socket addr from either:
- <host>:<post>
- <fs>://<host>:<port>/<path></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#createSocketAddr(java.lang.String, int)">createSocketAddr</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> target,
- int defaultPort)</CODE>
- <BR>
- Util method to build socket addr from either:
- <host>
- <host>:<post>
- <fs>://<host>:<port>/<path></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getAllStaticResolutions()">getAllStaticResolutions</A></B>()</CODE>
- <BR>
- This is used to get all the resolutions that were added using
- <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#addStaticResolution(java.lang.String, java.lang.String)"><CODE>addStaticResolution(String, String)</CODE></A>.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getConnectAddress(org.apache.hadoop.ipc.Server)">getConnectAddress</A></B>(<A HREF="../../../../org/apache/hadoop/ipc/Server.html" title="class in org.apache.hadoop.ipc">Server</A> server)</CODE>
- <BR>
- Returns InetSocketAddress that a client can use to
- connect to the server.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getDefaultSocketFactory(org.apache.hadoop.conf.Configuration)">getDefaultSocketFactory</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf)</CODE>
- <BR>
- Get the default socket factory as specified by the configuration
- parameter <tt>hadoop.rpc.socket.factory.default</tt></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getInputStream(java.net.Socket)">getInputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket)</CODE>
- <BR>
- Same as getInputStream(socket, socket.getSoTimeout()).<br><br>
-
- From documentation for <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getInputStream(java.net.Socket, long)"><CODE>getInputStream(Socket, long)</CODE></A>:<br>
- Returns InputStream for the socket.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getInputStream(java.net.Socket, long)">getInputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- long timeout)</CODE>
- <BR>
- Returns InputStream for the socket.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getOutputStream(java.net.Socket)">getOutputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket)</CODE>
- <BR>
- Same as getOutputStream(socket, 0).</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getOutputStream(java.net.Socket, long)">getOutputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- long timeout)</CODE>
- <BR>
- Returns OutputStream for the socket.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getServerAddress(org.apache.hadoop.conf.Configuration, java.lang.String, java.lang.String, java.lang.String)">getServerAddress</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldBindAddressName,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldPortName,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> newBindAddressName)</CODE>
- <BR>
- <B>Deprecated.</B> </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getSocketFactory(org.apache.hadoop.conf.Configuration, java.lang.Class)">getSocketFactory</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> clazz)</CODE>
- <BR>
- Get the socket factory for the given class according to its
- configuration parameter
- <tt>hadoop.rpc.socket.factory.class.<ClassName></tt>.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getSocketFactoryFromProperty(org.apache.hadoop.conf.Configuration, java.lang.String)">getSocketFactoryFromProperty</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> propValue)</CODE>
- <BR>
- Get the socket factory corresponding to the given proxy URI.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getStaticResolution(java.lang.String)">getStaticResolution</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> host)</CODE>
- <BR>
- Retrieves the resolved name for the passed host.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#normalizeHostName(java.lang.String)">normalizeHostName</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</CODE>
- <BR>
- Given a string representation of a host, return its ip address
- in textual presentation.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#normalizeHostNames(java.util.Collection)">normalizeHostNames</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> names)</CODE>
- <BR>
- Given a collection of string representation of hosts, return a list of
- corresponding IP addresses in the textual representation.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <A NAME="constructor_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Constructor Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="NetUtils()"><!-- --></A><H3>
- NetUtils</H3>
- <PRE>
- public <B>NetUtils</B>()</PRE>
- <DL>
- </DL>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="getSocketFactory(org.apache.hadoop.conf.Configuration, java.lang.Class)"><!-- --></A><H3>
- getSocketFactory</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A> <B>getSocketFactory</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> clazz)</PRE>
- <DL>
- <DD>Get the socket factory for the given class according to its
- configuration parameter
- <tt>hadoop.rpc.socket.factory.class.<ClassName></tt>. When no
- such parameter exists then fall back on the default socket factory as
- configured by <tt>hadoop.rpc.socket.factory.class.default</tt>. If
- this default socket factory is not configured, then fall back on the JVM
- default socket factory.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration<DD><CODE>clazz</CODE> - the class (usually a <A HREF="../../../../org/apache/hadoop/ipc/VersionedProtocol.html" title="interface in org.apache.hadoop.ipc"><CODE>VersionedProtocol</CODE></A>)
- <DT><B>Returns:</B><DD>a socket factory</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getDefaultSocketFactory(org.apache.hadoop.conf.Configuration)"><!-- --></A><H3>
- getDefaultSocketFactory</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A> <B>getDefaultSocketFactory</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf)</PRE>
- <DL>
- <DD>Get the default socket factory as specified by the configuration
- parameter <tt>hadoop.rpc.socket.factory.default</tt>
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration
- <DT><B>Returns:</B><DD>the default socket factory as specified in the configuration or
- the JVM default socket factory if the configuration does not
- contain a default socket factory property.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getSocketFactoryFromProperty(org.apache.hadoop.conf.Configuration, java.lang.String)"><!-- --></A><H3>
- getSocketFactoryFromProperty</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/javax/net/SocketFactory.html?is-external=true" title="class or interface in javax.net">SocketFactory</A> <B>getSocketFactoryFromProperty</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> propValue)</PRE>
- <DL>
- <DD>Get the socket factory corresponding to the given proxy URI. If the
- given proxy URI corresponds to an absence of configuration parameter,
- returns null. If the URI is malformed raises an exception.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>propValue</CODE> - the property which is the class name of the
- SocketFactory to instantiate; assumed non null and non empty.
- <DT><B>Returns:</B><DD>a socket factory as defined in the property value.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="createSocketAddr(java.lang.String)"><!-- --></A><H3>
- createSocketAddr</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A> <B>createSocketAddr</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> target)</PRE>
- <DL>
- <DD>Util method to build socket addr from either:
- <host>:<post>
- <fs>://<host>:<port>/<path>
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="createSocketAddr(java.lang.String, int)"><!-- --></A><H3>
- createSocketAddr</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A> <B>createSocketAddr</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> target,
- int defaultPort)</PRE>
- <DL>
- <DD>Util method to build socket addr from either:
- <host>
- <host>:<post>
- <fs>://<host>:<port>/<path>
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getServerAddress(org.apache.hadoop.conf.Configuration, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
- getServerAddress</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getServerAddress</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldBindAddressName,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldPortName,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> newBindAddressName)</PRE>
- <DL>
- <DD><B>Deprecated.</B>
- <P>
- <DD>Handle the transition from pairs of attributes specifying a host and port
- to a single colon separated one.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration to check<DD><CODE>oldBindAddressName</CODE> - the old address attribute name<DD><CODE>oldPortName</CODE> - the old port attribute name<DD><CODE>newBindAddressName</CODE> - the new combined name
- <DT><B>Returns:</B><DD>the complete address from the configuration</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="addStaticResolution(java.lang.String, java.lang.String)"><!-- --></A><H3>
- addStaticResolution</H3>
- <PRE>
- public static void <B>addStaticResolution</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> host,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> resolvedName)</PRE>
- <DL>
- <DD>Adds a static resolution for host. This can be used for setting up
- hostnames with names that are fake to point to a well known host. For e.g.
- in some testcases we require to have daemons with different hostnames
- running on the same machine. In order to create connections to these
- daemons, one can set up mappings from those hostnames to "localhost".
- <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getStaticResolution(java.lang.String)"><CODE>getStaticResolution(String)</CODE></A> can be used to query for
- the actual hostname.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>host</CODE> - <DD><CODE>resolvedName</CODE> - </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getStaticResolution(java.lang.String)"><!-- --></A><H3>
- getStaticResolution</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getStaticResolution</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> host)</PRE>
- <DL>
- <DD>Retrieves the resolved name for the passed host. The resolved name must
- have been set earlier using
- <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#addStaticResolution(java.lang.String, java.lang.String)"><CODE>addStaticResolution(String, String)</CODE></A>
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>host</CODE> -
- <DT><B>Returns:</B><DD>the resolution</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getAllStaticResolutions()"><!-- --></A><H3>
- getAllStaticResolutions</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]> <B>getAllStaticResolutions</B>()</PRE>
- <DL>
- <DD>This is used to get all the resolutions that were added using
- <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#addStaticResolution(java.lang.String, java.lang.String)"><CODE>addStaticResolution(String, String)</CODE></A>. The return
- value is a List each element of which contains an array of String
- of the form String[0]=hostname, String[1]=resolved-hostname
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>the list of resolutions</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getConnectAddress(org.apache.hadoop.ipc.Server)"><!-- --></A><H3>
- getConnectAddress</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/InetSocketAddress.html?is-external=true" title="class or interface in java.net">InetSocketAddress</A> <B>getConnectAddress</B>(<A HREF="../../../../org/apache/hadoop/ipc/Server.html" title="class in org.apache.hadoop.ipc">Server</A> server)</PRE>
- <DL>
- <DD>Returns InetSocketAddress that a client can use to
- connect to the server. Server.getListenerAddress() is not correct when
- the server binds to "0.0.0.0". This returns "127.0.0.1:port" when
- the getListenerAddress() returns "0.0.0.0:port".
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>server</CODE> -
- <DT><B>Returns:</B><DD>socket address that a client can use to connect to the server.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getInputStream(java.net.Socket)"><!-- --></A><H3>
- getInputStream</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> <B>getInputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket)
- throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
- <DL>
- <DD>Same as getInputStream(socket, socket.getSoTimeout()).<br><br>
-
- From documentation for <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getInputStream(java.net.Socket, long)"><CODE>getInputStream(Socket, long)</CODE></A>:<br>
- Returns InputStream for the socket. If the socket has an associated
- SocketChannel then it returns a
- <A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketInputStream</CODE></A> with the given timeout. If the socket does not
- have a channel, <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getInputStream()" title="class or interface in java.net"><CODE>Socket.getInputStream()</CODE></A> is returned. In the later
- case, the timeout argument is ignored and the timeout set with
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#setSoTimeout(int)" title="class or interface in java.net"><CODE>Socket.setSoTimeout(int)</CODE></A> applies for reads.<br><br>
- Any socket created using socket factories returned by <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#NetUtils()"><CODE>NetUtils()</CODE></A>,
- must use this interface instead of <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getInputStream()" title="class or interface in java.net"><CODE>Socket.getInputStream()</CODE></A>.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>socket</CODE> -
- <DT><B>Returns:</B><DD>InputStream for reading from the socket.
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getInputStream(java.net.Socket, long)"><CODE>getInputStream(Socket, long)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getInputStream(java.net.Socket, long)"><!-- --></A><H3>
- getInputStream</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> <B>getInputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- long timeout)
- throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
- <DL>
- <DD>Returns InputStream for the socket. If the socket has an associated
- SocketChannel then it returns a
- <A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketInputStream</CODE></A> with the given timeout. If the socket does not
- have a channel, <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getInputStream()" title="class or interface in java.net"><CODE>Socket.getInputStream()</CODE></A> is returned. In the later
- case, the timeout argument is ignored and the timeout set with
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#setSoTimeout(int)" title="class or interface in java.net"><CODE>Socket.setSoTimeout(int)</CODE></A> applies for reads.<br><br>
-
- Any socket created using socket factories returned by <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#NetUtils()"><CODE>NetUtils()</CODE></A>,
- must use this interface instead of <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getInputStream()" title="class or interface in java.net"><CODE>Socket.getInputStream()</CODE></A>.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>socket</CODE> - <DD><CODE>timeout</CODE> - timeout in milliseconds. This may not always apply. zero
- for waiting as long as necessary.
- <DT><B>Returns:</B><DD>InputStream for reading from the socket.
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getChannel()" title="class or interface in java.net"><CODE>Socket.getChannel()</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getOutputStream(java.net.Socket)"><!-- --></A><H3>
- getOutputStream</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A> <B>getOutputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket)
- throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
- <DL>
- <DD>Same as getOutputStream(socket, 0). Timeout of zero implies write will
- wait until data is available.<br><br>
-
- From documentation for <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getOutputStream(java.net.Socket, long)"><CODE>getOutputStream(Socket, long)</CODE></A> : <br>
- Returns OutputStream for the socket. If the socket has an associated
- SocketChannel then it returns a
- <A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketOutputStream</CODE></A> with the given timeout. If the socket does not
- have a channel, <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getOutputStream()" title="class or interface in java.net"><CODE>Socket.getOutputStream()</CODE></A> is returned. In the later
- case, the timeout argument is ignored and the write will wait until
- data is available.<br><br>
-
- Any socket created using socket factories returned by <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#NetUtils()"><CODE>NetUtils()</CODE></A>,
- must use this interface instead of <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getOutputStream()" title="class or interface in java.net"><CODE>Socket.getOutputStream()</CODE></A>.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>socket</CODE> -
- <DT><B>Returns:</B><DD>OutputStream for writing to the socket.
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#getOutputStream(java.net.Socket, long)"><CODE>getOutputStream(Socket, long)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getOutputStream(java.net.Socket, long)"><!-- --></A><H3>
- getOutputStream</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A> <B>getOutputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- long timeout)
- throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
- <DL>
- <DD>Returns OutputStream for the socket. If the socket has an associated
- SocketChannel then it returns a
- <A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketOutputStream</CODE></A> with the given timeout. If the socket does not
- have a channel, <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getOutputStream()" title="class or interface in java.net"><CODE>Socket.getOutputStream()</CODE></A> is returned. In the later
- case, the timeout argument is ignored and the write will wait until
- data is available.<br><br>
-
- Any socket created using socket factories returned by <A HREF="../../../../org/apache/hadoop/net/NetUtils.html#NetUtils()"><CODE>NetUtils()</CODE></A>,
- must use this interface instead of <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getOutputStream()" title="class or interface in java.net"><CODE>Socket.getOutputStream()</CODE></A>.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>socket</CODE> - <DD><CODE>timeout</CODE> - timeout in milliseconds. This may not always apply. zero
- for waiting as long as necessary.
- <DT><B>Returns:</B><DD>OutputStream for writing to the socket.
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getChannel()" title="class or interface in java.net"><CODE>Socket.getChannel()</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="connect(java.net.Socket, java.net.SocketAddress, int)"><!-- --></A><H3>
- connect</H3>
- <PRE>
- public static void <B>connect</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A> socket,
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/SocketAddress.html?is-external=true" title="class or interface in java.net">SocketAddress</A> endpoint,
- int timeout)
- throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
- <DL>
- <DD>This is a drop-in replacement for
- <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#connect(java.net.SocketAddress, int)" title="class or interface in java.net"><CODE>Socket.connect(SocketAddress, int)</CODE></A>.
- In the case of normal sockets that don't have associated channels, this
- just invokes <code>socket.connect(endpoint, timeout)</code>. If
- <code>socket.getChannel()</code> returns a non-null channel,
- connect is implemented using Hadoop's selectors. This is done mainly
- to avoid Sun's connect implementation from creating thread-local
- selectors, since Hadoop does not have control on when these are closed
- and could end up taking all the available file descriptors.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>socket</CODE> - <DD><CODE>endpoint</CODE> - <DD><CODE>timeout</CODE> - - timeout in milliseconds
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#connect(java.net.SocketAddress, int)" title="class or interface in java.net"><CODE>Socket.connect(java.net.SocketAddress, int)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="normalizeHostName(java.lang.String)"><!-- --></A><H3>
- normalizeHostName</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>normalizeHostName</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</PRE>
- <DL>
- <DD>Given a string representation of a host, return its ip address
- in textual presentation.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>name</CODE> - a string representation of a host:
- either a textual representation its IP address or its host name
- <DT><B>Returns:</B><DD>its IP address in the string format</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="normalizeHostNames(java.util.Collection)"><!-- --></A><H3>
- normalizeHostNames</H3>
- <PRE>
- public static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>normalizeHostNames</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> names)</PRE>
- <DL>
- <DD>Given a collection of string representation of hosts, return a list of
- corresponding IP addresses in the textual representation.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>names</CODE> - a collection of string representations of hosts
- <DT><B>Returns:</B><DD>a list of corresponding IP addresses in the string format<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/net/NetUtils.html#normalizeHostName(java.lang.String)"><CODE>normalizeHostName(String)</CODE></A></DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NetUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/hadoop/net/DNSToSwitchMapping.html" title="interface in org.apache.hadoop.net"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/hadoop/net/NetworkTopology.html" title="class in org.apache.hadoop.net"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/hadoop/net/NetUtils.html" target="_top"><B>FRAMES</B></A>
- <A HREF="NetUtils.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- Copyright © 2009 The Apache Software Foundation
- </BODY>
- </HTML>