Interface TickStream
-
- All Superinterfaces:
deltix.util.security.AuthorizationController.ProtectedResource
,DXChannel<deltix.qsrv.hf.pub.InstrumentMessage>
- All Known Subinterfaces:
DXTickStream
,WritableTickStream
public interface TickStream extends DXChannel<deltix.qsrv.hf.pub.InstrumentMessage>
The stream is a time series of messages for a number of financial instruments ("entities"). Messages can be price bars (see
BarMessage
), trade ticks (seeTradeMessage
), bid/offer ticks (seeBestBidOfferMessage
), or any of the many more built-in and user-defined types. In the simplest case, a database will have a single stream of data. Multiple streams can be used to represent data of different frequencies, or completely different factors. For instance, separate streams can represent 1-minute price bars and ticks for the same set of entities. Or, you can have price bars and volatility bars in separate streams.- See Also:
TickDB.getStream(String)
,TickDB.listStreams()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TickCursor
createCursor(SelectionOptions options)
Creates a cursor for reading data from this stream, according to the specified options, but initially with a fully restricted filter.ClassDescriptor[]
getAllDescriptors()
Return all class descriptors comprising this stream's metadata.TickDB
getDB()
Returns the parent database object.java.lang.String
getDescription()
Returns a user-readable multi-line description.RecordClassDescriptor
getFixedType()
When the stream is configured as fixed-type, returns the content class descriptor.int
getFormatVersion()
Returns stream data format version.java.lang.String
getKey()
Returns the key, which uniquely identifies the stream within its database.java.lang.String
getName()
Returns a user-readable short name.RecordClassDescriptor[]
getPolymorphicDescriptors()
When the stream is configured as polymorphic, returns the content class descriptors.long[]
getTimeRange(deltix.qsrv.hf.pub.InstrumentIdentity... entities)
Return an inclusive range of times for which the specified entities have data in the database.default long[]
getTimeRange(java.lang.String space)
long
getTypeVersion()
Returns a number which is guaranteed to be incremented every time stream metadata is changed.boolean
isFixedType()
Returns whether the stream is configured as fixed-type.boolean
isPolymorphic()
Returns whether the stream is configured as polymorphic.deltix.qsrv.hf.pub.InstrumentIdentity[]
listEntities(deltix.qsrv.hf.pub.InstrumentType... types)
Return a non-nullable list of entities, for which this stream has any data.default deltix.qsrv.hf.pub.InstrumentIdentity[]
listEntities(java.lang.String space)
Returns all symbols listed in given "space".default java.lang.String[]
listSpaces()
Returns all created "spaces" for the stream.deltix.qsrv.hf.pub.TimeInterval[]
listTimeRange(deltix.qsrv.hf.pub.InstrumentIdentity... entities)
Return an range of times for which the specified entities have data in the database.TickCursor
select(long time, SelectionOptions options)
TickCursor
select(long time, SelectionOptions options, java.lang.String[] types)
TickCursor
select(long time, SelectionOptions options, java.lang.String[] types, deltix.qsrv.hf.pub.InstrumentIdentity[] entities)
Opens a cursor for reading data from this stream, according to the specified options.TickCursor
select(long time, SelectionOptions options, java.lang.String[] types, java.lang.CharSequence[] symbols)
-
Methods inherited from interface deltix.data.stream.DXChannel
createConsumer, createPublisher, getTypes
-
-
-
-
Method Detail
-
getDB
TickDB getDB()
Returns the parent database object.- Returns:
- Parent database object.
-
getKey
java.lang.String getKey()
Returns the key, which uniquely identifies the stream within its database.
-
getName
java.lang.String getName()
Returns a user-readable short name.
-
getDescription
java.lang.String getDescription()
Returns a user-readable multi-line description.- Specified by:
getDescription
in interfaceDXChannel<deltix.qsrv.hf.pub.InstrumentMessage>
-
getTypeVersion
long getTypeVersion()
Returns a number which is guaranteed to be incremented every time stream metadata is changed. This number can be used as a basis for caching information about streams, as returned from methodsisPolymorphic()
,isFixedType()
,getFixedType()
,getPolymorphicDescriptors()
andgetAllDescriptors()
.
-
getFormatVersion
int getFormatVersion()
Returns stream data format version. Currently supported formats is 4 and 5.
-
isPolymorphic
boolean isPolymorphic()
Returns whether the stream is configured as polymorphic.
-
isFixedType
boolean isFixedType()
Returns whether the stream is configured as fixed-type.
-
getFixedType
RecordClassDescriptor getFixedType()
When the stream is configured as fixed-type, returns the content class descriptor. Otherwise, returns null.- Returns:
- Content class descriptor.
-
getPolymorphicDescriptors
RecordClassDescriptor[] getPolymorphicDescriptors()
When the stream is configured as polymorphic, returns the content class descriptors. Otherwise, returns null.- Returns:
- Content class descriptors.
-
getAllDescriptors
ClassDescriptor[] getAllDescriptors()
Return all class descriptors comprising this stream's metadata.- Returns:
- All relevant class descriptors.
-
select
TickCursor select(long time, SelectionOptions options, java.lang.String[] types, deltix.qsrv.hf.pub.InstrumentIdentity[] entities)
Opens a cursor for reading data from this stream, according to the specified options. The messages are returned from the cursor strictly ordered by time. Within the same exact time stamp, the order of messages is undefined and may vary from call to call, i.e. it is non-deterministic.
Note that the arguments of this method only determine the initial configuration of the cursor. The
TickCursor
interface provides methods for dynamically re-configuring the subscription, or jumping to a different timestamp.- Parameters:
time
- The start timestamp.options
- Selection options.types
- Specified message types to be subscribed. If null, then all types will be subscribed.entities
- Specified entities to be subscribed. If null, then all entities will be subscribed.- Returns:
- A cursor used to read messages.
-
select
TickCursor select(long time, SelectionOptions options, java.lang.String[] types, java.lang.CharSequence[] symbols)
-
select
TickCursor select(long time, SelectionOptions options, java.lang.String[] types)
-
select
TickCursor select(long time, SelectionOptions options)
-
createCursor
TickCursor createCursor(SelectionOptions options)
Creates a cursor for reading data from this stream, according to the specified options, but initially with a fully restricted filter. The user must call
TimeController.reset(long)
at least once, in order to begin retrieving data. This method is equivalent to (but is slightly more optimal than) callingcreateCursor(options)
- Returns:
- A cursor used to read messages. Never null.
-
listEntities
deltix.qsrv.hf.pub.InstrumentIdentity[] listEntities(deltix.qsrv.hf.pub.InstrumentType... types)
Return a non-nullable list of entities, for which this stream has any data.
-
getTimeRange
long[] getTimeRange(deltix.qsrv.hf.pub.InstrumentIdentity... entities)
Return an inclusive range of times for which the specified entities have data in the database.- Parameters:
entities
- A list of entities. If empty, return for all.- Returns:
- An array consisting of two long timestamps (from and to),
or
null
if no data was found.
-
listTimeRange
deltix.qsrv.hf.pub.TimeInterval[] listTimeRange(deltix.qsrv.hf.pub.InstrumentIdentity... entities)
Return an range of times for which the specified entities have data in the database.- Parameters:
entities
- A list of entities. If empty, return for each entity in the stream.- Returns:
- Array of TimeInterval objects for the specified entities.
-
listSpaces
default java.lang.String[] listSpaces()
Returns all created "spaces" for the stream. Default space returns as "" (empty string).If backing stream does not support spaces
null
will be returned.
-
listEntities
default deltix.qsrv.hf.pub.InstrumentIdentity[] listEntities(java.lang.String space)
Returns all symbols listed in given "space".If backing stream does not support spaces
null
will be returned.
-
getTimeRange
default long[] getTimeRange(java.lang.String space)
- Returns:
- An array consisting of two long timestamps (from and to) or
null
if no data was found.
-
-