org.apache.hadoop.hbase
Class HServerInfo

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

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

HServerInfo contains metainfo about an HRegionServer, Currently it only contains the server start code. In the future it will contain information about the source machine and load statistics.


Constructor Summary
HServerInfo()
          default constructor - used by Writable
HServerInfo(HServerAddress serverAddress, long startCode, int infoPort, String name)
          Constructor
HServerInfo(HServerInfo other)
          Construct a new object using another as input (like a copy constructor)
 
Method Summary
 int compareTo(HServerInfo o)
           
 boolean equals(Object obj)
           
 int getInfoPort()
           
 HServerLoad getLoad()
           
 String getName()
          Get the hostname of the server
 HServerAddress getServerAddress()
           
 String getServerName()
           
static String getServerName(HServerAddress address, long startCode)
           
static String getServerName(String serverAddress, long startCode)
           
 long getStartCode()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 void setInfoPort(int infoPort)
           
 void setLoad(HServerLoad load)
           
 void setName(String name)
          Set the hostname of the server
 void setServerAddress(HServerAddress serverAddress)
          Change the server address.
 void setStartCode(long startCode)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HServerInfo

public HServerInfo()
default constructor - used by Writable


HServerInfo

public HServerInfo(HServerAddress serverAddress,
                   long startCode,
                   int infoPort,
                   String name)
Constructor

Parameters:
serverAddress -
startCode -
infoPort - Port the info server is listening on.

HServerInfo

public HServerInfo(HServerInfo other)
Construct a new object using another as input (like a copy constructor)

Parameters:
other -
Method Detail

getLoad

public HServerLoad getLoad()
Returns:
the load

setLoad

public void setLoad(HServerLoad load)
Parameters:
load - the load to set

getServerAddress

public HServerAddress getServerAddress()
Returns:
the server address

setServerAddress

public void setServerAddress(HServerAddress serverAddress)
Change the server address.

Parameters:
serverAddress - New server address

getStartCode

public long getStartCode()
Returns:
the server start code

getInfoPort

public int getInfoPort()
Returns:
Port the info server is listening on.

setInfoPort

public void setInfoPort(int infoPort)
Parameters:
infoPort - - new port of info server

setStartCode

public void setStartCode(long startCode)
Parameters:
startCode - the startCode to set

getServerName

public String getServerName()
Returns:
the server name in the form hostname_startcode_port

getName

public String getName()
Get the hostname of the server

Returns:
hostname

setName

public void setName(String name)
Set the hostname of the server

Parameters:
name - hostname

toString

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

equals

public boolean equals(Object obj)
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(HServerInfo o)
Specified by:
compareTo in interface Comparable<HServerInfo>

getServerName

public static String getServerName(String serverAddress,
                                   long startCode)
Parameters:
serverAddress - in the form hostname:port
startCode -
Returns:
the server name in the form hostname_startcode_port

getServerName

public static String getServerName(HServerAddress address,
                                   long startCode)
Parameters:
address -
startCode -
Returns:
the server name in the form hostname_startcode_port


Copyright © 2010 The Apache Software Foundation