org.apache.hadoop.hbase
Class HServerLoad

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

public class HServerLoad
extends Object
implements org.apache.hadoop.io.WritableComparable

This class encapsulates metrics for determining the load on a HRegionServer


Constructor Summary
HServerLoad()
          default constructior (used by Writable)
HServerLoad(int numberOfRequests, int numberOfRegions)
          Constructor
 
Method Summary
 int compareTo(Object o)
          
 boolean equals(Object o)
          
 int getLoad()
          Originally, this method factored in the effect of requests going to the server as well.
 int getNumberOfRegions()
           
 int getNumberOfRequests()
           
 int hashCode()
          
 void readFields(DataInput in)
          
 void setNumberOfRegions(int numberOfRegions)
           
 void setNumberOfRequests(int numberOfRequests)
           
 String toString()
          
 String toString(int msgInterval)
          Returns toString() with the number of requests divided by the message interval in seconds
 void write(DataOutput out)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HServerLoad

public HServerLoad()
default constructior (used by Writable)


HServerLoad

public HServerLoad(int numberOfRequests,
                   int numberOfRegions)
Constructor

Parameters:
numberOfRequests -
numberOfRegions -
Method Detail

getLoad

public int getLoad()
Originally, this method factored in the effect of requests going to the server as well. However, this does not interact very well with the current region rebalancing code, which only factors number of regions. For the interim, until we can figure out how to make rebalancing use all the info available, we're just going to make load purely the number of regions.

Returns:
load factor for this server

toString

public String toString()

Overrides:
toString in class Object

toString

public String toString(int msgInterval)
Returns toString() with the number of requests divided by the message interval in seconds

Parameters:
msgInterval -
Returns:
The load as a String

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getNumberOfRegions

public int getNumberOfRegions()
Returns:
the numberOfRegions

getNumberOfRequests

public int getNumberOfRequests()
Returns:
the numberOfRequests

setNumberOfRegions

public void setNumberOfRegions(int numberOfRegions)
Parameters:
numberOfRegions - the numberOfRegions to set

setNumberOfRequests

public void setNumberOfRequests(int numberOfRequests)
Parameters:
numberOfRequests - the numberOfRequests to set

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(Object o)

Specified by:
compareTo in interface Comparable


Copyright © 2008 The Apache Software Foundation