public class GangliaListener extends Object implements Callable<Void>, IGangliaDefaults
The decoded messages are reported without any additional translation. The
receiver may need to reconcile host names,
with those already on hand, and/or reconcile
IGangliaMetadataMessages already on hand. The
GangliaListener does NOT perform such operations by design so it
maybe used to obtain a faithful transcription of the chatter on the ganglia
|Constructor and Description|
Listen at the default multicast group address and port.
Listen at the specified multicast group address and port.
|Modifier and Type||Method and Description|
Listens for ganglia messages.
Decode a Ganglia message from the datagram packet.
Listens to ganglia services on the default multicast address and port and writes out the messages that it observes on stdout.
public GangliaListener(IGangliaMessageHandler handler) throws UnknownHostException
public GangliaListener(InetAddress group, int port, IGangliaMessageDecoder decoder, IGangliaMessageHandler handler)
group- The multicast address used by ganglia for hosts to join.
port- The port on which the ganglia services are talking.
decoder- Object responsible for decoding packets.
handler- The interface to receive the ganglia messages.
public boolean isListening()
trueiff the listener is running when this method is invoked.
Note: This method BLOCKS and does NOT notice an interrupt. This is because JDK 6 does not support multicast NIO. TODO Java 6 does not support non-blocking multicast receive. Write a JDK 7 specific version of class class which uses multicast with non-blocking IO and hence can be interrupted.
protected IGangliaMessage decodeRecord(byte data, int off, int len)
data- The packet data.
off- The offset of the first byte in the packet.
len- The #of bytes in the packet.
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.