public enum GangliaMessageTypeEnum extends Enum<GangliaMessageTypeEnum>
Ganglia_msg_formats
from lib/gm_protocol.h
(generated when you build ganglia from the source).
Note: The Ganglia 3.1 wire format packets begin at 128 to avoid confusion with the previous wire format.
Enum Constant and Description |
---|
DOUBLE
Ganglia metric record with double value.
|
FLOAT
Ganglia metric record with float value.
|
INT16
Ganglia metric record with short value.
|
INT32
Ganglia metric record with int32 value.
|
METADATA
Ganglia metric metadata declaration record.
|
REQUEST
Ganglia request record (requests a metadata record for the named metric).
|
STRING
Ganglia metric record with string value.
|
UINT16
Ganglia metric record with unsigned short value.
|
UINT32
Ganglia metric record with unsigned int32 value.
|
Modifier and Type | Method and Description |
---|---|
static GangliaMessageTypeEnum |
forJavaValue(Object value)
Return the best match
GangliaMessageTypeEnum for a java data
value. |
static GangliaMessageTypeEnum |
fromGType(String metricType)
Translate gtype (uint32, float, string, etc) into type safe enum.
|
String |
getFormat()
Return the
printf format string suitable for use with the
ganglia data type. |
String |
getGType()
The ganglia datatype name (uint, etc).
|
boolean |
isMetric()
Return
true if this is a metric value record. |
boolean |
isNumeric()
Return
true iff this is a numeric metric type. |
int |
value()
The byte value used in the wire format.
|
static GangliaMessageTypeEnum |
valueOf(int v)
Return the type safe enum for the record type value.
|
static GangliaMessageTypeEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static GangliaMessageTypeEnum[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GangliaMessageTypeEnum METADATA
public static final GangliaMessageTypeEnum UINT16
This data type is NOT automatically selected for any Java data values. It
is only used if there is an explicit IGangliaMetadataMessage
declaring the metric as having this datatype.
IGangliaMetricMessage
associated with this ganglia data type by
an IGangliaMetadataMessage
are internally modeled using a
non-negative Java Integer
. However, when they are sent out on the
wire they are written out using the printf format string for an unsigned
int16 value.
public static final GangliaMessageTypeEnum INT16
public static final GangliaMessageTypeEnum INT32
public static final GangliaMessageTypeEnum UINT32
This data type is NOT automatically selected for any Java data values. It
is only used if there is an explicit IGangliaMetadataMessage
declaring the metric as having this datatype.
IGangliaMetricMessage
associated with this ganglia data type by
an IGangliaMetadataMessage
are internally modeled using a
non-negative Java Long
. However, when they are sent out on the
wire they are written out using the printf format string for an unsigned
int32 value.
public static final GangliaMessageTypeEnum STRING
public static final GangliaMessageTypeEnum FLOAT
public static final GangliaMessageTypeEnum DOUBLE
public static final GangliaMessageTypeEnum REQUEST
public static GangliaMessageTypeEnum[] values()
for (GangliaMessageTypeEnum c : GangliaMessageTypeEnum.values()) System.out.println(c);
public static GangliaMessageTypeEnum valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int value()
public boolean isMetric()
true
if this is a metric value record.public String getGType()
public String getFormat()
printf
format string suitable for use with the
ganglia data type.public boolean isNumeric()
true
iff this is a numeric metric type.public static GangliaMessageTypeEnum valueOf(int v)
v
- The value.public static GangliaMessageTypeEnum fromGType(String metricType)
IllegalArgumentException
- if the argument is none of the data types used by ganglia.public static GangliaMessageTypeEnum forJavaValue(Object value)
GangliaMessageTypeEnum
for a java data
value.
Note: This method is intended for dynamic declarations in which a value
to be reported is collected from the Java application and an appropriate
IGangliaMetadataMessage
needs to be constructed based on that
value object to declare the metric to the ganglia network.
This method SHOULD NOT be used to discover the enum when you already have
that information. In particular, do NOT use this method when you are
looking at an IGangliaMetricMessage
associated with one of the
unsigned ganglia data types. Unsigned ganglia data types
are represented by a wider primitive data type in java (uint16 as int and
uint32 as long). Various methods correctly translate between the wire
format for those messages when encoding and decoding. The Java data type
used for such messages will NOT be correctly translated back into the
actual GangliaMessageTypeEnum
by this method. For example, a
Integer
is translated by this method into UINT32
rather
than UINT16
since this method assumes that the Java object is
expressing a signed numeric value rather than an unsigned numeric value).
Also, this method will translate a Java Long
into DOUBLE
in order to convey as much information as possible to ganglia (which
lacks an int64 data type).
value
- The data value.GangliaMessageTypeEnum
.IllegalArgumentException
- if the value is null
.IllegalArgumentException
- if the value is not one of those registered for use
with this enum.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.