public class

HealthStat

extends HelixProperty
java.lang.Object
   ↳ org.apache.helix.HelixProperty
     ↳ org.apache.helix.model.HealthStat

Class Overview

Represents a set of properties that can be queried to determine the health of instances on a Helix-managed cluster

Summary

Nested Classes
enum HealthStat.HealthStatProperty Queryable health statistic properties  
[Expand]
Inherited Fields
From class org.apache.helix.HelixProperty
Public Constructors
HealthStat(String id)
Instantiate with an identifier
HealthStat(ZNRecord record)
Instantiate with a pre-populated record
Public Methods
String buildCompositeKey(String instance, String parentKey, String statName)
Create a key based on a parent key, instance, and statistic
long getCreateTimeStamp()
Get when these statistics were created
Map<StringMap<StringString>> getHealthFields(String instanceName)
Get all the health statistics for a given instance
long getLastModifiedTimeStamp()
Get when these statistics were last modified
String getTestField()
Get the value of a test field corresponding to a request count
boolean isValid()
Get property validity
void setHealthFields(Map<StringMap<StringString>> healthFields)
Set a group of heath statistics, grouped by the statistic
[Expand]
Inherited Methods
From class org.apache.helix.HelixProperty
From class java.lang.Object

Public Constructors

public HealthStat (String id)

Instantiate with an identifier

Parameters
id the name of these statistics

public HealthStat (ZNRecord record)

Instantiate with a pre-populated record

Parameters
record a ZNRecord corresponding to health statistics

Public Methods

public String buildCompositeKey (String instance, String parentKey, String statName)

Create a key based on a parent key, instance, and statistic

Parameters
instance the instance for which these statistics exist
parentKey the originating key
statName the statistic
Returns
  • a unified key

public long getCreateTimeStamp ()

Get when these statistics were created

Returns
  • a UNIX timestamp

public Map<StringMap<StringString>> getHealthFields (String instanceName)

Get all the health statistics for a given instance

Parameters
instanceName the instance for which to get health statistics
Returns
  • a map of (instance and statistic, value or timestamp, value) triples

public long getLastModifiedTimeStamp ()

Get when these statistics were last modified

Returns
  • a UNIX timestamp

public String getTestField ()

Get the value of a test field corresponding to a request count

Returns
  • the number of requests

public boolean isValid ()

Get property validity

Returns
  • true if valid, false if invalid

public void setHealthFields (Map<StringMap<StringString>> healthFields)

Set a group of heath statistics, grouped by the statistic

Parameters
healthFields a map of statistic name, the corresponding entity, and the value