hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "binlijin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-8773) Improve Server#getRemoteAddress by utilizing Server.Connection.hostAddress
Date Thu, 06 Sep 2012 08:17:07 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-8773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

binlijin updated HADOOP-8773:
-----------------------------

    Attachment: HADOOP-8773.patch
    
> Improve Server#getRemoteAddress by utilizing Server.Connection.hostAddress 
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-8773
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8773
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: binlijin
>            Priority: Minor
>         Attachments: HADOOP-8773.patch
>
>
> Connection :
> {code}
>     public String getHostAddress() {
>       return hostAddress;
>     }
> {code}
> Inet4Address :
> {code}
>     public String getHostAddress() {
> 	return numericToTextFormat(getAddress());
>     }
>     public byte[] getAddress() {
> 	byte[] addr = new byte[INADDRSZ];
> 	addr[0] = (byte) ((address >>> 24) & 0xFF);
> 	addr[1] = (byte) ((address >>> 16) & 0xFF);
> 	addr[2] = (byte) ((address >>> 8) & 0xFF);
> 	addr[3] = (byte) (address & 0xFF);
> 	return addr;
>     }
>     static String numericToTextFormat(byte[] src)
>     {
> 	return (src[0] & 0xff) + "." + (src[1] & 0xff) + "." + (src[2] & 0xff) +
"." + (src[3] & 0xff);
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message