|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.HServerInfo
public class HServerInfo
HServerInfo is meta info about an HRegionServer
. It is the token
by which a master distingushes a particular regionserver from the rest.
It holds hostname, ports, regionserver startcode, and load. Each server has
a servername
where servername is made up of a concatenation of
hostname, port, and regionserver startcode. This servername is used in
various places identifying this regionserver. Its even used as part of
a pathname in the filesystem. As part of the initialization,
master will pass the regionserver the address that it knows this regionserver
by. In subsequent communications, the regionserver will pass a HServerInfo
with the master-supplied address.
Nested Class Summary | |
---|---|
static class |
HServerInfo.LoadComparator
Orders HServerInfos by load then name. |
Constructor Summary | |
---|---|
HServerInfo()
|
|
HServerInfo(HServerAddress serverAddress,
int infoPort,
String hostname)
Constructor that creates a HServerInfo with a generated startcode and an empty load. |
|
HServerInfo(HServerAddress serverAddress,
long startCode,
int infoPort,
String hostname)
|
|
HServerInfo(HServerInfo other)
Copy-constructor |
Method Summary | |
---|---|
int |
compareTo(HServerInfo o)
|
boolean |
equals(Object obj)
|
String |
getHostname()
|
String |
getHostnamePort()
|
static String |
getHostnamePort(String hostname,
int port)
|
int |
getInfoPort()
|
HServerLoad |
getLoad()
|
HServerAddress |
getServerAddress()
|
String |
getServerName()
Gets the unique server instance name. |
static String |
getServerName(HServerAddress address,
long startCode)
|
static String |
getServerName(String hostName,
int port,
long startCode)
|
static String |
getServerName(String hostAndPort,
long startcode)
|
static String |
getServerNameLessStartCode(String inServerName)
Utility method to excise the start code from a server name |
long |
getStartCode()
|
int |
hashCode()
|
static boolean |
isServer(Set<String> servers,
String serverName,
boolean hostAndPortOnly)
Utility method that does a find of a servername or a hostandport combination in the passed Set. |
void |
readFields(DataInput in)
|
void |
setLoad(HServerLoad load)
|
void |
setServerAddress(HServerAddress serverAddress)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HServerInfo()
public HServerInfo(HServerAddress serverAddress, int infoPort, String hostname)
serverAddress
- An InetSocketAddress
encased in a Writable
infoPort
- Port the webui runs on.hostname
- Server hostname.public HServerInfo(HServerAddress serverAddress, long startCode, int infoPort, String hostname)
public HServerInfo(HServerInfo other)
other
- Method Detail |
---|
public HServerLoad getLoad()
public void setLoad(HServerLoad load)
public HServerAddress getServerAddress()
public void setServerAddress(HServerAddress serverAddress)
public long getStartCode()
public int getInfoPort()
public String getHostname()
public String getHostnamePort()
public static String getHostnamePort(String hostname, int port)
hostname
- port
-
public String getServerName()
<hostname> ',' <port> ',' <startcode>
public static String getServerName(String hostAndPort, long startcode)
public static String getServerName(HServerAddress address, long startCode)
address
- Server addressstartCode
- Server startcode
<hostname> ',' <port> ',' <startcode>
public static String getServerName(String hostName, int port, long startCode)
public String toString()
toString
in class Object
getServerName()
,
getLoad()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(HServerInfo o)
compareTo
in interface Comparable<HServerInfo>
public static boolean isServer(Set<String> servers, String serverName, boolean hostAndPortOnly)
servers
- Set of server namesserverName
- Name to look forhostAndPortOnly
- If serverName
is a
hostname ':' port
or hostname , port , startcode
.
serverName
found in servers
public static String getServerNameLessStartCode(String inServerName)
inServerName
- full server name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |