|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.Event
public class Event
An event. Events are queued by the IBigdataClient and self-reported
periodically to the ILoadBalancerService. The event is assigned a
UUID when it is created and the ILoadBalancerService assigned
start and end event times based on its local clock as the events are received
(this helps to reduce the demand on the ITransactionService for
global timestamp).
ILoadBalancerService, including factoring out of the common
metadata (some stuff will always be the same for a given reported and
does not need to be reported with each event)., Add a level property to events? (but events are not meant to replace
logging)| Field Summary | |
|---|---|
protected boolean |
complete
true iff the event event has been generated. |
protected Map<String,Object> |
details
Event details. |
protected long |
endTime
The event end time. |
UUID |
eventUUID
Unique event identifier. |
protected IBigdataFederation |
fed
|
String |
hostname
The host on which the event was generated. |
protected static org.apache.log4j.Logger |
log
|
Object |
majorEventType
Major event type (classification or category). |
Object |
minorEventType
Minor event type (classification or category). |
protected long |
receiptTime
The time when the event was received. |
EventResource |
resource
The resource for which the event is reported (store file, index name, etc). |
Class |
serviceIface
The most interesting class or interface for the service which generated that event. |
String |
serviceName
The name of the service which generated the event. |
UUID |
serviceUUID
The UUID for the service which generated that event. |
protected long |
startTime
The event start time. |
| Constructor Summary | |
|---|---|
|
Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType)
|
|
Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType,
Map<String,Object> details)
Event ctor. |
protected |
Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType,
Object minorEventType,
Map<String,Object> details)
Sub-event ctor. |
protected |
Event(String s)
Construct an event from the tab-delimited serialization produced from toString(). |
| Method Summary | |
|---|---|
Event |
addDetail(String name,
Object value)
Add a detail. |
Event |
addDetails(Map<String,Object> details)
Add details. |
Event |
end()
Sends the end event. |
static Event |
fromString(String s)
Reconstruct an event object from a string. |
Map<String,Object> |
getDetails()
Event details. |
long |
getElapsed()
The elapsed time for the event. |
long |
getEndTime()
|
static String |
getHeader()
A header that can be used to interpret the output of toString()
(with newline). |
long |
getStartTime()
|
boolean |
isComplete()
true iff the event event has been generated. |
protected static Map<String,Object> |
newDetails()
Factory for the details hash map. |
Event |
newSubEvent(Object minorEventType)
A child event (major type is the type of the parent). |
Event |
newSubEvent(Object minorEventType,
Map<String,Object> details)
A child event (major type is the type of the parent). |
protected void |
sendEvent()
Dispatch the Event via
AbstractFederation.sendEvent(Event). |
Event |
start()
Send the start event. |
String |
toString()
Tab-delimited format (with newline). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final transient org.apache.log4j.Logger log
protected transient IBigdataFederation fed
public final UUID eventUUID
public final String hostname
public final Class serviceIface
public final String serviceName
public final UUID serviceUUID
UUID for the service which generated that event.
public final EventResource resource
serviceUUID will also be reported.
public final Object majorEventType
public final Object minorEventType
protected Map<String,Object> details
protected long startTime
protected long endTime
protected transient long receiptTime
protected boolean complete
true iff the event event has been generated.
| Constructor Detail |
|---|
public Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType)
public Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType,
Map<String,Object> details)
fed - The federation object (used to send the event to an
aggregator).resource - The resource for which the event was generated (store, index
partition, etc).majorEventType - The major type of the event (use of enums is encouraged).details - Optional details for the event.
protected Event(IBigdataFederation fed,
EventResource resource,
Object majorEventType,
Object minorEventType,
Map<String,Object> details)
fed - The federation object (used to send the event to an
aggregator).resource - The resource for which the event was generated (store, index
partition, etc).majorEventType - The major type of the event (use of enums is encouraged).minorEventType - The minor type of the event (use of enums is encouraged).details - Optional details for the event.UUID of the parent event but
then must correlate that UUID when the event is received.
protected Event(String s)
throws ClassNotFoundException
toString().
s - the tab delimited serialization
ClassNotFoundException - if any fields specify an invalid classname| Method Detail |
|---|
public Map<String,Object> getDetails()
public Event addDetails(Map<String,Object> details)
details -
Event.protected static Map<String,Object> newDetails()
end() which would
otherwise lead to a ConcurrentModificationException. It can not
be a ConcurrentHashMap since that class does not support
null values.
public Event addDetail(String name,
Object value)
name - value -
Event.public boolean isComplete()
true iff the event event has been generated.
public long getStartTime()
public long getEndTime()
public long getElapsed()
public Event newSubEvent(Object minorEventType)
minorEventType -
public Event newSubEvent(Object minorEventType,
Map<String,Object> details)
minorEventType - details - Optional ordered (name,value) array.
public Event start()
Note: If you want to report an event with a duration then you MUST use
start() when the event starts and end() when the event
ends. If you want to report an "instantaneous" event then you can just use
end().
public Event end()
Note: You can use this method for "instantaneous" events.
protected void sendEvent()
throws IOException
Event via
AbstractFederation.sendEvent(Event).
IOExceptionpublic static String getHeader()
toString()
(with newline).
public String toString()
name=value, so only the non-null columns are written out.
toString in class Object
public static Event fromString(String s)
throws ClassNotFoundException
s - the tab-delimited format create by toString().
ClassNotFoundException - if any CSV fields specify an invalid classname
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||