Class EventTimeSlice
java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.playback.EventTimeSlice
This class holds events that were processed by the MissedEventPlaybackManager
for the most recent timestamp.
For example, if 3 events were received at t1, they would be present in the Event Slice.
However, if another event is processed at t2, then the Event Slice would evict the previous
events and only keep the new event at t2.
Created by scott.hebert@ericsson.com on 12/12/14.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent evt) Add an event to the list.List<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent>get the events for this time slice.longGet the time slice in ms.static EventTimeSliceCreates a shallow copy of a given EventTimeSlice.
-
Field Details
-
events
events to persist.
-
-
Constructor Details
-
EventTimeSlice
public EventTimeSlice(long ts) - Parameters:
ts- Time slice in ms to hold events for.
-
-
Method Details
-
getTimeSlice
public long getTimeSlice()Get the time slice in ms.- Returns:
- this time slice
-
addEvent
public void addEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent evt) Add an event to the list.- Parameters:
evt- Event to be persisted.
-
getEvents
get the events for this time slice.- Returns:
- events that pertain to the time slice.
-
shallowCopy
Creates a shallow copy of a given EventTimeSlice.- Parameters:
ets- the EventTimeSlice to copy- Returns:
- the copy
-