@InterfaceAudience.Private public class StorageClusterStatusModel extends Object implements Serializable, ProtobufMessageHandler
<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>
Modifier and Type | Class and Description |
---|---|
static class |
StorageClusterStatusModel.Node
Represents a region server.
|
Modifier and Type | Field and Description |
---|---|
private double |
averageLoad |
private List<String> |
deadNodes |
private List<StorageClusterStatusModel.Node> |
liveNodes |
private int |
regions |
private long |
requests |
private static long |
serialVersionUID |
Constructor and Description |
---|
StorageClusterStatusModel()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDeadNode(String node)
Add a dead node to the cluster representation.
|
StorageClusterStatusModel.Node |
addLiveNode(String name,
long startCode,
int heapSizeMB,
int maxHeapSizeMB)
Add a live node to the cluster representation.
|
byte[] |
createProtobufOutput() |
double |
getAverageLoad() |
String |
getDeadNode(int index) |
List<String> |
getDeadNodes() |
StorageClusterStatusModel.Node |
getLiveNode(int index) |
List<StorageClusterStatusModel.Node> |
getLiveNodes() |
ProtobufMessageHandler |
getObjectFromMessage(byte[] message)
Initialize the model from a protobuf representation.
|
int |
getRegions() |
long |
getRequests() |
void |
setAverageLoad(double averageLoad) |
void |
setDeadNodes(List<String> nodes) |
void |
setLiveNodes(List<StorageClusterStatusModel.Node> nodes) |
void |
setRegions(int regions) |
void |
setRequests(int requests) |
String |
toString() |
private static final long serialVersionUID
private List<StorageClusterStatusModel.Node> liveNodes
private int regions
private long requests
private double averageLoad
public StorageClusterStatusModel.Node addLiveNode(String name, long startCode, int heapSizeMB, int maxHeapSizeMB)
name
- the region server namestartCode
- the region server's start codeheapSizeMB
- the current heap size, in MBmaxHeapSizeMB
- the maximum heap size, in MBpublic StorageClusterStatusModel.Node getLiveNode(int index)
index
- the indexpublic void addDeadNode(String node)
node
- the dead region server's namepublic String getDeadNode(int index)
index
- the indexpublic List<StorageClusterStatusModel.Node> getLiveNodes()
public int getRegions()
public long getRequests()
public double getAverageLoad()
public void setLiveNodes(List<StorageClusterStatusModel.Node> nodes)
nodes
- the list of live node modelspublic void setDeadNodes(List<String> nodes)
nodes
- the list of dead node namespublic void setRegions(int regions)
regions
- the total number of regions served by the clusterpublic void setRequests(int requests)
requests
- the total number of requests per second handled by the
clusterpublic void setAverageLoad(double averageLoad)
averageLoad
- the average load of region servers in the clusterpublic byte[] createProtobufOutput()
createProtobufOutput
in interface ProtobufMessageHandler
public ProtobufMessageHandler getObjectFromMessage(byte[] message) throws IOException
ProtobufMessageHandler
getObjectFromMessage
in interface ProtobufMessageHandler
message
- the raw bytes of the protobuf messageIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.