org.apache.hadoop.hbase
Class HServerAddress

java.lang.Object
  extended by org.apache.hadoop.hbase.HServerAddress
All Implemented Interfaces:
Comparable<HServerAddress>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<HServerAddress>

public class HServerAddress
extends Object
implements org.apache.hadoop.io.WritableComparable<HServerAddress>

HServerAddress is a "label" for a HBase server that combines the host name and port number.


Constructor Summary
HServerAddress()
          Empty constructor, used for Writable
HServerAddress(HServerAddress other)
          Construct a HServerAddress from another HServerAddress
HServerAddress(InetSocketAddress address)
          Construct a HServerAddress from an InetSocketAddress
HServerAddress(String hostAndPort)
          Construct a HServerAddress from a string of the form hostname:port
HServerAddress(String bindAddress, int port)
          Construct a HServerAddress from hostname, port number
 
Method Summary
 int compareTo(HServerAddress o)
           
 boolean equals(Object o)
           
 String getBindAddress()
           
 String getHostname()
           
 InetSocketAddress getInetSocketAddress()
           
 int getPort()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HServerAddress

public HServerAddress()
Empty constructor, used for Writable


HServerAddress

public HServerAddress(InetSocketAddress address)
Construct a HServerAddress from an InetSocketAddress

Parameters:
address - InetSocketAddress of server

HServerAddress

public HServerAddress(String hostAndPort)
Construct a HServerAddress from a string of the form hostname:port

Parameters:
hostAndPort - format 'hostname:port'

HServerAddress

public HServerAddress(String bindAddress,
                      int port)
Construct a HServerAddress from hostname, port number

Parameters:
bindAddress - host name
port - port number

HServerAddress

public HServerAddress(HServerAddress other)
Construct a HServerAddress from another HServerAddress

Parameters:
other - the HServerAddress to copy from
Method Detail

getBindAddress

public String getBindAddress()
Returns:
bind address

getPort

public int getPort()
Returns:
port number

getHostname

public String getHostname()
Returns:
host name

getInetSocketAddress

public InetSocketAddress getInetSocketAddress()
Returns:
the InetSocketAddress

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

compareTo

public int compareTo(HServerAddress o)
Specified by:
compareTo in interface Comparable<HServerAddress>


Copyright © 2009 The Apache Software Foundation