|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.eventlogs.EventBacklog
public class EventBacklog
Thread-safe java.util-like Container for storing EventLog
instances
for later parsing. This container, however, will not add more than two
logs
with the same (id, eventType, action) tuple.
Further, the container can only either be in the adding state or the removing
state. A newly created EventBacklog
is in the adding state. The
popping state is entered the first time that remove()
is called. And
the adding state will only be re-entered, once remove()
has returned
null and #flipIfEmpty()
has been invoked at the end of a batch.
All calls to add(EventLog)
while in the popping state will return
false.
Field Summary | |
---|---|
protected boolean |
adding
Switch between the adding and the removing states. |
Constructor Summary | |
---|---|
EventBacklog()
|
Method Summary | |
---|---|
boolean |
add(ome.model.meta.EventLog log)
Adds the given EventLog instance to the end of a queue for later
popping if no equivalent EventLog is present. |
void |
flipState()
Flips the EventBacklog to the "adding" state if it is empty,
otherwise to the "removing" state. |
ome.model.meta.EventLog |
remove()
Removes and returns the next EventLog instance or null if none is
present. |
boolean |
removingOnly()
Check the current state of the EventBacklog . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean adding
Constructor Detail |
---|
public EventBacklog()
Method Detail |
---|
public boolean add(ome.model.meta.EventLog log)
EventLog
instance to the end of a queue for later
popping
if no equivalent EventLog
is present.
Equivalence is based on the entityType, entityId, and action fields.
Records tracking information to prevent the same EventLog
from
being re-added before the last instance is removed.
public ome.model.meta.EventLog remove()
EventLog
instance or null if none is
present. Also cleans up any tracking information for the given
EventLog
.
public void flipState()
EventBacklog
to the "adding" state if it is empty,
otherwise to the "removing" state. This is necessary since the indexing
happens only at flush time in the FullTextIndexer
. This
restriction means in any one batch only either backlog or new event logs
will be processed.
EventLogLoader.hasNext()
public boolean removingOnly()
EventBacklog
. If in the
"removingOnly" state, then any calls to add(EventLog)
will
return false.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.3-00d1137e-b2894
Copyright © 2009 The University of Dundee. All Rights Reserved.