Package org.epics.archiverappliance
Interface EventStream
-
- All Superinterfaces:
AutoCloseable
,Closeable
,Iterable<Event>
- All Known Subinterfaces:
ETLBulkStream
- All Known Implementing Classes:
ArchiverValuesHandler
,ArrayListCollectorEventStream
,ArrayListEventStream
,CSVEventStream
,CurrentThreadWorkerEventStream
,EmptyEventStream
,FileBackedPBEventStream
,FillsCollectorEventStream
,InputStreamBackedEventStream
,MergeDedupEventStream
,MergeDedupWithCallablesEventStream
,MultiFilePBEventStream
,SimulationEventStream
,SummaryStatsCollectorEventStream
,TimeSpanLimitEventStream
public interface EventStream extends Iterable<Event>, Closeable
An event stream is a sequence of events in temporal order. The events in the stream come oldest events first. Implementations of EventStream (should) try their best to support streaming data transfers.EventStreams are typically backed by objects that consume system resources (like file handles, database connections etc). So, clients must close the EventStream once they are done with it. We strongly encourage the use of the Java 1.7 try-with-resources for this purpose.try(EventStream stream = reader.getDataForPV(...)) { for(Event event : stream) { // Do stuff. } }
EventStreams are typically backed by streams (InputStreams, XMLStreams, database cursors) etc. While there may be one or two implementations that let you get multiple iterators out of a single EventStream, this is the exception rather than the norm. For most implementation, assume that you can only get one iterator and once that iterator is finished, the EventStream is done. Again, we strongly encourage the use of the Java 1.7 try-with-resources which automatically forces this usage.The use of Iterable<Event> permits us to use syntactic sugar of the formfor(Event event : stream) { // Do stuff. }
- Author:
- mshankar
-
-
Method Summary
Modifier and Type Method Description EventStreamDesc
getDescription()
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getDescription
EventStreamDesc getDescription()
-
-