org.apache.hadoop.hbase
Class HServerLoad

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

public class HServerLoad
extends org.apache.hadoop.io.VersionedWritable
implements org.apache.hadoop.io.WritableComparable<HServerLoad>

This class is used exporting current state of load on a RegionServer.


Nested Class Summary
static class HServerLoad.RegionLoad
          Encapsulates per-region loading metrics.
 
Field Summary
static HServerLoad EMPTY_HSERVERLOAD
           
 
Constructor Summary
HServerLoad()
          default constructor (used by Writable)
HServerLoad(HServerLoad hsl)
          Constructor
HServerLoad(int totalNumberOfRequests, int numberOfRequests, int usedHeapMB, int maxHeapMB, Map<byte[],HServerLoad.RegionLoad> regionLoad, Set<String> coprocessors)
          Constructor
 
Method Summary
 int compareTo(HServerLoad o)
           
 boolean equals(Object o)
           
 int getLoad()
          Originally, this method factored in the effect of requests going to the server as well.
 int getMaxHeapMB()
           
 int getMemStoreSizeInMB()
           
 int getNumberOfRegions()
           
 int getNumberOfRequests()
           
 Map<byte[],HServerLoad.RegionLoad> getRegionsLoad()
           
 String[] getRsCoprocessors()
          HBASE-4070: Improve region server metrics to report loaded coprocessors.
 int getStorefileIndexSizeInMB()
           
 int getStorefiles()
           
 int getStorefileSizeInMB()
           
 int getTotalNumberOfRequests()
           
 int getUsedHeapMB()
           
 byte getVersion()
           
 void readFields(DataInput in)
           
 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, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_HSERVERLOAD

public static final HServerLoad EMPTY_HSERVERLOAD
Constructor Detail

HServerLoad

public HServerLoad()
default constructor (used by Writable)


HServerLoad

public HServerLoad(int totalNumberOfRequests,
                   int numberOfRequests,
                   int usedHeapMB,
                   int maxHeapMB,
                   Map<byte[],HServerLoad.RegionLoad> regionLoad,
                   Set<String> coprocessors)
Constructor

Parameters:
numberOfRequests -
usedHeapMB -
maxHeapMB -
coprocessors - : coprocessors loaded at the regionserver-level

HServerLoad

public HServerLoad(HServerLoad hsl)
Constructor

Parameters:
hsl - the template HServerLoad
Method Detail

getRsCoprocessors

public String[] getRsCoprocessors()
HBASE-4070: Improve region server metrics to report loaded coprocessors.

Returns:
the set of all the server-wide coprocessors on this regionserver

getVersion

public byte getVersion()
Specified by:
getVersion in class org.apache.hadoop.io.VersionedWritable
Returns:
the object version number

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
See Also:
Object.toString()

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
See Also:
Object.equals(java.lang.Object)

getNumberOfRegions

public int getNumberOfRegions()
Returns:
the numberOfRegions

getNumberOfRequests

public int getNumberOfRequests()
Returns:
the numberOfRequests per second.

getTotalNumberOfRequests

public int getTotalNumberOfRequests()
Returns:
the numberOfRequests

getUsedHeapMB

public int getUsedHeapMB()
Returns:
the amount of heap in use, in MB

getMaxHeapMB

public int getMaxHeapMB()
Returns:
the maximum allowable heap size, in MB

getRegionsLoad

public Map<byte[],HServerLoad.RegionLoad> getRegionsLoad()
Returns:
region load metrics

getStorefiles

public int getStorefiles()
Returns:
Count of storefiles on this regionserver

getStorefileSizeInMB

public int getStorefileSizeInMB()
Returns:
Total size of store files in MB

getMemStoreSizeInMB

public int getMemStoreSizeInMB()
Returns:
Size of memstores in MB

getStorefileIndexSizeInMB

public int getStorefileIndexSizeInMB()
Returns:
Size of store file indexes in MB

readFields

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

write

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

compareTo

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


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.