Package deltix.qsrv.hf.stream
Class SortingMessageSource<T extends deltix.data.stream.TimeStampedMessage>
- java.lang.Object
-
- deltix.qsrv.hf.stream.SortingMessageSource<T>
-
- All Implemented Interfaces:
deltix.data.stream.MessageSource<T>
,deltix.util.concurrent.AbstractCursor
,deltix.util.lang.Disposable
,java.io.Closeable
,java.lang.AutoCloseable
public class SortingMessageSource<T extends deltix.data.stream.TimeStampedMessage> extends java.lang.Object implements deltix.data.stream.MessageSource<T>
This class reorders messages coming from nested message source (in time order). This class should only be used in feed simulation mode - it introduces a latency when certain amount of input messages are accumulated to ensure proper order. FIXME: This class has severe problem: it doesn't copy messages when placing them in PQ. Thus it doesn't work with message source that reuses messages.
-
-
Constructor Summary
Constructors Constructor Description SortingMessageSource(deltix.data.stream.MessageSource<T> delegate, long maxBufferDuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
T
getMessage()
boolean
isAtEnd()
boolean
next()
-
-
-
Constructor Detail
-
SortingMessageSource
public SortingMessageSource(deltix.data.stream.MessageSource<T> delegate, long maxBufferDuration)
- Parameters:
maxBufferDuration
- specifies maximum anticipated delay of 'late' messages [in milliseconds]. For example, for RedSky feed messages may be delayed for up to 3 seconds.
-
-
Method Detail
-
next
public boolean next()
- Specified by:
next
in interfacedeltix.util.concurrent.AbstractCursor
-
getMessage
public T getMessage()
- Specified by:
getMessage
in interfacedeltix.data.stream.MessageSource<T extends deltix.data.stream.TimeStampedMessage>
-
isAtEnd
public boolean isAtEnd()
- Specified by:
isAtEnd
in interfacedeltix.util.concurrent.AbstractCursor
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacedeltix.util.lang.Disposable
-
-