Class StorageClusterStatusModel
java.lang.Object
org.apache.hadoop.hbase.rest.model.StorageClusterStatusModel
- All Implemented Interfaces:
Serializable
,ProtobufMessageHandler
@Private
public class StorageClusterStatusModel
extends Object
implements Serializable, ProtobufMessageHandler
Representation of the status of a storage cluster:
- regions: the total number of regions served by the cluster
- requests: the total number of requests per second handled by the cluster in the last reporting interval
- averageLoad: the average load of the region servers in the cluster
- liveNodes: detailed status of the live region servers
- deadNodes: the names of region servers declared dead
<complexType name="StorageClusterStatus"> <sequence> <element name="liveNode" type="tns:Node" maxOccurs="unbounded" minOccurs="0"> </element> <element name="deadNode" type="string" maxOccurs="unbounded" minOccurs="0"> </element> </sequence> <attribute name="regions" type="int"></attribute> <attribute name="requests" type="int"></attribute> <attribute name="averageLoad" type="float"></attribute> </complexType> <complexType name="Node"> <sequence> <element name="region" type="tns:Region" maxOccurs="unbounded" minOccurs="0"></element> </sequence> <attribute name="name" type="string"></attribute> <attribute name="startCode" type="int"></attribute> <attribute name="requests" type="int"></attribute> <attribute name="heapSizeMB" type="int"></attribute> <attribute name="maxHeapSizeMB" type="int"></attribute> </complexType> <complexType name="Region"> <attribute name="name" type="base64Binary"></attribute> <attribute name="stores" type="int"></attribute> <attribute name="storefiles" type="int"></attribute> <attribute name="storefileSizeMB" type="int"></attribute> <attribute name="memstoreSizeMB" type="int"></attribute> <attribute name="storefileIndexSizeMB" type="int"></attribute> <attribute name="readRequestsCount" type="int"></attribute> <attribute name="writeRequestsCount" type="int"></attribute> <attribute name="rootIndexSizeKB" type="int"></attribute> <attribute name="totalStaticIndexSizeKB" type="int"></attribute> <attribute name="totalStaticBloomSizeKB" type="int"></attribute> <attribute name="totalCompactingKVs" type="int"></attribute> <attribute name="currentCompactedKVs" type="int"></attribute> </complexType>
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a region server. -
Field Summary
Modifier and TypeFieldDescriptionprivate double
private List<StorageClusterStatusModel.Node>
private int
private long
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDeadNode
(String node) Add a dead node to the cluster representation.addLiveNode
(String name, long startCode, int heapSizeMB, int maxHeapSizeMB) Add a live node to the cluster representation.byte[]
Returns the protobuf represention of the modeldouble
Returns the average load of the region servers in the clustergetDeadNode
(int index) Returns the list of dead nodesgetLiveNode
(int index) Returns the list of live nodesgetObjectFromMessage
(byte[] message) Initialize the model from a protobuf representation.int
Returns the total number of regions served by the clusterlong
void
setAverageLoad
(double averageLoad) void
setDeadNodes
(List<String> nodes) void
void
setRegions
(int regions) void
setRequests
(long requests) toString()
-
Field Details
-
serialVersionUID
- See Also:
-
liveNodes
-
deadNodes
-
regions
-
requests
-
averageLoad
-
-
Constructor Details
-
StorageClusterStatusModel
public StorageClusterStatusModel()Default constructor
-
-
Method Details
-
addLiveNode
public StorageClusterStatusModel.Node addLiveNode(String name, long startCode, int heapSizeMB, int maxHeapSizeMB) Add a live node to the cluster representation.- Parameters:
name
- the region server namestartCode
- the region server's start codeheapSizeMB
- the current heap size, in MBmaxHeapSizeMB
- the maximum heap size, in MB
-
getLiveNode
- Parameters:
index
- the index- Returns:
- the region server model
-
addDeadNode
Add a dead node to the cluster representation.- Parameters:
node
- the dead region server's name
-
getDeadNode
- Parameters:
index
- the index- Returns:
- the dead region server's name
-
getLiveNodes
Returns the list of live nodes -
getDeadNodes
Returns the list of dead nodes -
getRegions
Returns the total number of regions served by the cluster -
getRequests
- Returns:
- the total number of requests per second handled by the cluster in the last reporting interval
-
getAverageLoad
Returns the average load of the region servers in the cluster -
setLiveNodes
- Parameters:
nodes
- the list of live node models
-
setDeadNodes
- Parameters:
nodes
- the list of dead node names
-
setRegions
- Parameters:
regions
- the total number of regions served by the cluster
-
setRequests
- Parameters:
requests
- the total number of requests per second handled by the cluster
-
setAverageLoad
- Parameters:
averageLoad
- the average load of region servers in the cluster
-
toString
-
createProtobufOutput
Description copied from interface:ProtobufMessageHandler
Returns the protobuf represention of the model- Specified by:
createProtobufOutput
in interfaceProtobufMessageHandler
-
getObjectFromMessage
Description copied from interface:ProtobufMessageHandler
Initialize the model from a protobuf representation.- Specified by:
getObjectFromMessage
in interfaceProtobufMessageHandler
- Parameters:
message
- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-