EventBuffer
public class QueueEventBuffer extends java.lang.Object implements EventBuffer
Use QueueEventBuffer.Builder
(created using newBuilder()
) to
build this buffer. The buffer can be configured to contain event queues per data point, per
static group, or per set of multiple static groups.
When a queue of this buffer is full any new events will be queued and cause the event at front of the queue to be removed and discarded.
Modifier and Type | Class | Description |
---|---|---|
static class |
QueueEventBuffer.Builder |
Builder used to construct
QueueEventBuffer |
Modifier and Type | Method | Description |
---|---|---|
void |
add(java.util.List<Event> events) |
Adds the given events to the buffer.
|
static QueueEventBuffer.Builder |
newBuilder() |
Create a new builder.
|
java.util.List<Event> |
readAll() |
Returns all events stored by this buffer.
|
java.util.List<Event> |
readClass(EventClass eventClass,
int limit) |
Returns events of the given class.
|
java.util.List<Event> |
readGroup(StaticGroup group,
int limit) |
Returns events belonging to the given static group.
|
void |
remove(java.util.List<Event> events) |
Removes the given list of events from the buffer.
|
public static QueueEventBuffer.Builder newBuilder()
public void add(java.util.List<Event> events)
EventBuffer
add
in interface EventBuffer
events
- the events to addpublic java.util.List<Event> readAll()
EventBuffer
readAll
in interface EventBuffer
public java.util.List<Event> readClass(EventClass eventClass, int limit)
EventBuffer
limit
is <= 0, all events of the given class are returned.readClass
in interface EventBuffer
eventClass
- the event classlimit
- the maximum number of events to returnpublic java.util.List<Event> readGroup(StaticGroup group, int limit)
EventBuffer
limit
is <= 0, all events of the given class
are returned.readGroup
in interface EventBuffer
group
- the static grouplimit
- the maximum number of events to returnpublic void remove(java.util.List<Event> events)
EventBuffer
remove
in interface EventBuffer
events
- the events to remove