Class TickDBClient
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.comm.client.TickDBClient
-
- All Implemented Interfaces:
deltix.qsrv.hf.spi.conn.Disconnectable,deltix.qsrv.hf.spi.conn.ReconnectableImpl.Reconnector,DBStateNotifier,DXTickDB,RemoteTickDB,TickDB,TopicDB,WritableTickDB,deltix.util.io.AbstractDataStore,deltix.util.lang.Disposable,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
SecuredDbClient
public class TickDBClient extends java.lang.Object implements DBStateNotifier, RemoteTickDB, deltix.qsrv.hf.spi.conn.ReconnectableImpl.Reconnector, TopicDB
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanenableSSLstatic deltix.gflog.LogLOGGERprotected SessionClientsession
-
Constructor Summary
Constructors Modifier Constructor Description TickDBClient(java.lang.String host, int port)TickDBClient(java.lang.String host, int port, boolean enableSSL)protectedTickDBClient(java.lang.String host, int port, boolean enableSSL, UserPrincipal user)TickDBClient(java.lang.String host, int port, boolean enableSSL, java.lang.String user, java.lang.String pass)TickDBClient(java.lang.String host, int port, java.lang.String user, java.lang.String pass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)voidaddStateListener(DBStateListener listener)voidclose()voidcompileQuery(java.lang.String query, java.util.List<Token> tokens)Compiles QQL/DDL Query.VSChannelconnect()VSChannelconnect(ChannelType type, boolean autoCommit, boolean noDelay, ChannelCompression c, int channelBufferSize)voidcoolDown()Removes all memory indexes.DXTickStreamcreateAnonymousStream(StreamOptions options)Creates a new anonymous stream.protected VSChannelcreateChannel(ChannelType type, boolean autoCommit, boolean noDelay, ChannelCompression c, int channelBufferSize)deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage>createConsumer(java.lang.String topicKey, ConsumerPreferences pref, IdleStrategy idleStrategy)CreatesMessageSource-style message consumer (blocking).deltix.util.lang.DisposablecreateConsumerWorker(java.lang.String topicKey, ConsumerPreferences pref, IdleStrategy idleStrategy, java.util.concurrent.ThreadFactory threadFactory, MessageProcessor processor)Creates worker-style message consumer.TickCursorcreateCursor(SelectionOptions options, TickStream... streams)Opens an initially empty cursor for reading data from multiple streams, according to the specified options.deltix.qsrv.hf.tickdb.comm.client.TickStreamClientcreateFileStream(java.lang.String key, java.lang.String dataFile)Creates a new stream mount to the given data file.MessagePollercreatePollingConsumer(java.lang.String topicKey, ConsumerPreferences pref)Creates a non-blocking poll-style message consumer.deltix.data.stream.MessageChannel<deltix.qsrv.hf.pub.InstrumentMessage>createPublisher(java.lang.String topicKey, PublisherPreferences pref, IdleStrategy idleStrategy)Creates channel for message publishing.deltix.qsrv.hf.tickdb.comm.client.TickStreamClientcreateStream(java.lang.String key, StreamOptions options)Creates a new stream within the database.deltix.qsrv.hf.tickdb.comm.client.TickStreamClientcreateStream(java.lang.String key, java.lang.String name, java.lang.String description, int distributionFactor)Creates a new stream within the database.DirectChannelcreateTopic(java.lang.String topicKey, RecordClassDescriptor[] types, TopicSettings settings)Creates pub/sub style topic (IPC).voiddelete()voiddeleteTopic(java.lang.String topicKey)Deletes topic data from registry.ClassSet<ClassDescriptor>describeQuery(java.lang.String qql, SelectionOptions options, Parameter... params)Returns schema for the given query.InstrumentMessageSourceexecuteQuery(deltix.util.parsers.Element qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long startTimestamp, long endTimestamp, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(deltix.util.parsers.Element qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long time, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(java.lang.String qql, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(java.lang.String qql, SelectionOptions options, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(java.lang.String qql, SelectionOptions options, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(java.lang.String qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long startTimestamp, long endTimestamp, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSourceexecuteQuery(java.lang.String qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long time, Parameter... params)Execute Query and creates a message source for reading data from it, according to the specified options.voidfireAdded(java.lang.String key)voidfireDeleted(java.lang.String key)voidfireRenamed(java.lang.String fromKey, java.lang.String toKey)voidfireStateChanged(java.lang.String key)voidformat()java.lang.StringgetApplicationId()CodecFactorygetCodecFactory(ChannelQualityOfService qos)java.lang.StringgetConnectionString()long[]getConnectLatency()java.io.File[]getDbDirs()java.lang.StringgetHost()java.lang.StringgetId()MetaDatagetMetaData()Gets stream metadata contains all class descriptors.longgetMetaDataVersion()Gets current metadata version.intgetPort()deltix.util.concurrent.QuickExecutorgetQuickExecutor()longgetServerAvailableBandwidth()intgetServerProtocolVersion()longgetServerStartTime()longgetServerTime()Returns system time of the timebase server.java.lang.StringgetServerVersion()SessionClientgetSession()longgetSizeOnDisk()Returns the approximate size of the database's footprint.intgetSSLPort()deltix.qsrv.hf.tickdb.comm.client.TickStreamClientgetStream(java.lang.String key)Looks up an existing stream by key.intgetTimeout()Gets timeout value for socket connections.DirectChannelgetTopic(java.lang.String topicKey)TopicDBgetTopicDB()Topic API.RecordClassDescriptor[]getTypes(java.lang.String topicKey)Returns list of types that can be written to and read from the specified topic.protected UserPrincipalgetUser()booleanisConnected()booleanisLoopback()booleanisOpen()booleanisReadOnly()booleanisSecured()booleanisSSLEnabled()booleanisTopicDBSupported()DXChannel[]listChannels()deltix.qsrv.hf.tickdb.comm.client.TickStreamClient[]listStreams()Enumerates existing streams.java.util.List<java.lang.String>listTopics()voidopen(boolean readOnly)voidremoveDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)voidremoveStateListener(DBStateListener listener)TickCursorselect(long time, SelectionOptions options, TickStream... streams)TickCursorselect(long time, SelectionOptions options, java.lang.String[] types, deltix.qsrv.hf.pub.InstrumentIdentity[] entities, TickStream... streams)Opens a cursor for reading data from multiple streams, according to the specified options.TickCursorselect(long time, SelectionOptions options, java.lang.String[] types, TickStream... streams)TickCursorselect(long time, SelectionOptions options, java.lang.String[] types, java.lang.CharSequence[] symbols, TickStream... streams)voidsetAccessToken(java.lang.String token)Sets user access token to login to the Timebase server when OAUTH type of authentication defined on server.voidsetAffinityConfig(deltix.thread.affinity.AffinityConfig affinityConfig)voidsetApplicationId(java.lang.String id)voidsetCompression(boolean useCompression)voidsetGrowthPolicy(deltix.util.lang.GrowthPolicy policy)Sets the file growth policyvoidsetTimeout(int timeout)Sets timeout for socket connections, in milliseconds.long[]testConnectLatency(int iterations)java.lang.StringtoString()voidtrimToSize()Trims all data files to minimum size.booleantryReconnect(int numAttempts, long timeSinceDisconnected, deltix.qsrv.hf.spi.conn.ReconnectableImpl helper)voidwarmUp()Forces the building of all memory indexes.
-
-
-
Field Detail
-
LOGGER
public static final deltix.gflog.Log LOGGER
-
session
protected volatile SessionClient session
-
enableSSL
protected final boolean enableSSL
-
-
Constructor Detail
-
TickDBClient
protected TickDBClient(java.lang.String host, int port, boolean enableSSL, UserPrincipal user)
-
TickDBClient
public TickDBClient(java.lang.String host, int port, java.lang.String user, java.lang.String pass)
-
TickDBClient
public TickDBClient(java.lang.String host, int port, boolean enableSSL, java.lang.String user, java.lang.String pass)
-
TickDBClient
public TickDBClient(java.lang.String host, int port)
-
TickDBClient
public TickDBClient(java.lang.String host, int port, boolean enableSSL)
-
-
Method Detail
-
getSession
public SessionClient getSession()
-
setAccessToken
public void setAccessToken(java.lang.String token)
Sets user access token to login to the Timebase server when OAUTH type of authentication defined on server.- Parameters:
token- Access token
-
testConnectLatency
public long[] testConnectLatency(int iterations) throws java.io.IOException- Throws:
java.io.IOException
-
getConnectLatency
public long[] getConnectLatency()
-
connect
public VSChannel connect() throws java.io.IOException
- Throws:
java.io.IOException
-
connect
public VSChannel connect(ChannelType type, boolean autoCommit, boolean noDelay, ChannelCompression c, int channelBufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
getUser
protected UserPrincipal getUser()
-
createChannel
protected VSChannel createChannel(ChannelType type, boolean autoCommit, boolean noDelay, ChannelCompression c, int channelBufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfacedeltix.util.io.AbstractDataStore
-
getConnectionString
public java.lang.String getConnectionString()
-
getCodecFactory
public CodecFactory getCodecFactory(ChannelQualityOfService qos)
-
getTimeout
public int getTimeout()
Gets timeout value for socket connections.- Specified by:
getTimeoutin interfaceRemoteTickDB- Returns:
- timeout value, in milliseconds.
-
setTimeout
public void setTimeout(int timeout)
Sets timeout for socket connections, in milliseconds. A timeout of zero is interpreted as an infinite timeout. By default - 5 sec for remote connections, 1 sec for local connections.- Specified by:
setTimeoutin interfaceRemoteTickDB- Parameters:
timeout- the specified timeout, in milliseconds.- See Also:
getTimeout()
-
getServerProtocolVersion
public int getServerProtocolVersion()
-
getServerStartTime
public long getServerStartTime()
- Specified by:
getServerStartTimein interfaceRemoteTickDB
-
open
public void open(boolean readOnly)
- Specified by:
openin interfacedeltix.util.io.AbstractDataStore
-
getQuickExecutor
public deltix.util.concurrent.QuickExecutor getQuickExecutor()
-
getSizeOnDisk
public long getSizeOnDisk()
Description copied from interface:DXTickDBReturns the approximate size of the database's footprint.- Specified by:
getSizeOnDiskin interfaceDXTickDB- Returns:
- Size in bytes.
-
getStream
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient getStream(java.lang.String key)
Description copied from interface:WritableTickDBLooks up an existing stream by key.
-
getServerAvailableBandwidth
public long getServerAvailableBandwidth()
-
getServerTime
public long getServerTime()
Description copied from interface:DXTickDBReturns system time of the timebase server.- Specified by:
getServerTimein interfaceDXTickDB
-
listStreams
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient[] listStreams()
Description copied from interface:WritableTickDBEnumerates existing streams.- Specified by:
listStreamsin interfaceDXTickDB- Specified by:
listStreamsin interfaceTickDB- Specified by:
listStreamsin interfaceWritableTickDB- Returns:
- An array of existing stream objects.
-
listChannels
public DXChannel[] listChannels()
- Specified by:
listChannelsin interfaceDXTickDB
-
coolDown
public void coolDown()
Description copied from interface:DXTickDBRemoves all memory indexes. The indexes will be rebuilt on demand.
-
createAnonymousStream
public DXTickStream createAnonymousStream(StreamOptions options)
Description copied from interface:DXTickDBCreates a new anonymous stream.- Specified by:
createAnonymousStreamin interfaceDXTickDB- Parameters:
options- Options for creating the stream. The stream is automatically created with theStreamScope.RUNTIMEscope.
-
createStream
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient createStream(java.lang.String key, java.lang.String name, java.lang.String description, int distributionFactor)Description copied from interface:DXTickDBCreates a new stream within the database. The newly created stream must be configured with the required metadata via calling eitherDXTickStream.setFixedType(deltix.qsrv.hf.pub.md.RecordClassDescriptor)orDXTickStream.setPolymorphic(deltix.qsrv.hf.pub.md.RecordClassDescriptor...).- Specified by:
createStreamin interfaceDXTickDB- Parameters:
key- A required key later used to identify the stream.name- An optional user-readable name.description- An optional multi-line description.distributionFactor- The number of files into which to distribute the data. Supply 0 to keep a separate file for each instrument.
-
createStream
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient createStream(java.lang.String key, StreamOptions options)Description copied from interface:DXTickDBCreates a new stream within the database.- Specified by:
createStreamin interfaceDXTickDB- Parameters:
key- A required key later used to identify the stream.options- Options for creating the stream.
-
createFileStream
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient createFileStream(java.lang.String key, java.lang.String dataFile)Description copied from interface:DXTickDBCreates a new stream mount to the given data file.- Specified by:
createFileStreamin interfaceDXTickDB- Parameters:
key- A required key later used to identify the stream.dataFile- Path to the data file (on server side).- Returns:
- A new instance of DXTickStream.
-
createTopic
public DirectChannel createTopic(@Nonnull java.lang.String topicKey, @Nonnull RecordClassDescriptor[] types, @Nullable TopicSettings settings)
Description copied from interface:TopicDBCreates pub/sub style topic (IPC). You can use this type of topics only when client is local (on same machine with TimeBase).- Specified by:
createTopicin interfaceTopicDB- Parameters:
topicKey- topic identifiertypes- list of message typessettings- custom topic settings
-
getTopic
@Nullable public DirectChannel getTopic(@Nonnull java.lang.String topicKey)
-
deleteTopic
public void deleteTopic(@Nonnull java.lang.String topicKey)Description copied from interface:TopicDBDeletes topic data from registry. Does not check for existing publishers/consumers.- Specified by:
deleteTopicin interfaceTopicDB
-
listTopics
public java.util.List<java.lang.String> listTopics()
- Specified by:
listTopicsin interfaceTopicDB- Returns:
- list of all topic keys
-
getTypes
public RecordClassDescriptor[] getTypes(@Nonnull java.lang.String topicKey)
Description copied from interface:TopicDBReturns list of types that can be written to and read from the specified topic.
-
createPublisher
public deltix.data.stream.MessageChannel<deltix.qsrv.hf.pub.InstrumentMessage> createPublisher(@Nonnull java.lang.String topicKey, @Nullable PublisherPreferences pref, @Nullable IdleStrategy idleStrategy) throws TopicNotFoundExceptionDescription copied from interface:TopicDBCreates channel for message publishing.- Specified by:
createPublisherin interfaceTopicDB- Parameters:
topicKey- topic identifierpref- configuration for this publisheridleStrategy- strategy to be used when publishing is not possible due to back pressure. Ifnullthen determined bypreferences.- Throws:
TopicNotFoundException
-
createConsumerWorker
public deltix.util.lang.Disposable createConsumerWorker(@Nonnull java.lang.String topicKey, @Nullable ConsumerPreferences pref, @Nullable IdleStrategy idleStrategy, @Nullable java.util.concurrent.ThreadFactory threadFactory, @Nonnull MessageProcessor processor)Description copied from interface:TopicDBCreates worker-style message consumer.- Specified by:
createConsumerWorkerin interfaceTopicDB- Parameters:
topicKey- topic identifierpref- configuration for this consumeridleStrategy- strategy to be used when there are no messages to consume. Ifnullthen determined bypreferences.threadFactory- thread factory that will be used to run theprocessor. Ifnullthen default thread factory will be used.processor- instance to process arrived messages- Returns:
- returns a
Disposablethat can be used to stop message processing
-
createPollingConsumer
public MessagePoller createPollingConsumer(@Nonnull java.lang.String topicKey, @Nullable ConsumerPreferences pref)
Description copied from interface:TopicDBCreates a non-blocking poll-style message consumer.- Specified by:
createPollingConsumerin interfaceTopicDB- Parameters:
topicKey- topic identifierpref- configuration for this consumer- Returns:
- returns
MessagePollerthat can be used to poll messages from subscription.
-
createConsumer
public deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage> createConsumer(@Nonnull java.lang.String topicKey, @Nullable ConsumerPreferences pref, @Nullable IdleStrategy idleStrategy)Description copied from interface:TopicDBCreatesMessageSource-style message consumer (blocking).- Specified by:
createConsumerin interfaceTopicDB- Parameters:
topicKey- topic identifierpref- configuration for this consumeridleStrategy- strategy to be used when there are no messages to consume. Ifnullthen determined bypreferences.- Returns:
MessageSourcefor topic. CallingAbstractCursor.next()will block.
-
createCursor
public TickCursor createCursor(SelectionOptions options, TickStream... streams)
Description copied from interface:TickDBOpens an initially empty cursor for reading data from multiple streams, 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.
The cursor is returned initially empty and must be reset. The
TickCursorinterface provides methods for dynamically re-configuring the subscription, or jumping to a different timestamp.- Specified by:
createCursorin interfaceTickDB- Parameters:
options- Selection options.streams- Streams from which data will be selected.- Returns:
- A cursor used to read messages.
-
select
public TickCursor select(long time, SelectionOptions options, java.lang.String[] types, deltix.qsrv.hf.pub.InstrumentIdentity[] entities, TickStream... streams)
Description copied from interface:TickDBOpens a cursor for reading data from multiple streams, 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
TickCursorinterface provides methods for dynamically re-configuring the subscription, or jumping to a different timestamp.- Specified by:
selectin interfaceTickDB- 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.streams- Streams from which data will be selected.- Returns:
- A cursor used to read messages.
-
select
public TickCursor select(long time, SelectionOptions options, java.lang.String[] types, java.lang.CharSequence[] symbols, TickStream... streams)
-
select
public TickCursor select(long time, SelectionOptions options, java.lang.String[] types, TickStream... streams)
-
select
public TickCursor select(long time, SelectionOptions options, TickStream... streams)
-
setGrowthPolicy
public void setGrowthPolicy(deltix.util.lang.GrowthPolicy policy)
Description copied from interface:DXTickDBSets the file growth policy- Specified by:
setGrowthPolicyin interfaceDXTickDB- Parameters:
policy- Growth Policy value
-
trimToSize
public void trimToSize()
Description copied from interface:DXTickDBTrims all data files to minimum size.- Specified by:
trimToSizein interfaceDXTickDB
-
warmUp
public void warmUp()
Description copied from interface:DXTickDBForces the building of all memory indexes. This is useful in performance testing or on server startup.
-
delete
public void delete()
- Specified by:
deletein interfacedeltix.util.io.AbstractDataStore
-
format
public void format()
- Specified by:
formatin interfacedeltix.util.io.AbstractDataStore
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacedeltix.util.io.AbstractDataStore
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfacedeltix.util.io.AbstractDataStore
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacedeltix.util.lang.Disposable
-
getMetaDataVersion
public long getMetaDataVersion()
Description copied from interface:DXTickDBGets current metadata version.- Specified by:
getMetaDataVersionin interfaceDXTickDB- Returns:
- current metadata version number.
-
getMetaData
public MetaData getMetaData()
Description copied from interface:DXTickDBGets stream metadata contains all class descriptors.- Specified by:
getMetaDatain interfaceDXTickDB- Returns:
- metadata object.
-
tryReconnect
public boolean tryReconnect(int numAttempts, long timeSinceDisconnected, deltix.qsrv.hf.spi.conn.ReconnectableImpl helper) throws java.lang.Exception- Specified by:
tryReconnectin interfacedeltix.qsrv.hf.spi.conn.ReconnectableImpl.Reconnector- Throws:
java.lang.Exception
-
addDisconnectEventListener
public void addDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
- Specified by:
addDisconnectEventListenerin interfacedeltix.qsrv.hf.spi.conn.Disconnectable
-
removeDisconnectEventListener
public void removeDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
- Specified by:
removeDisconnectEventListenerin interfacedeltix.qsrv.hf.spi.conn.Disconnectable
-
isSecured
public boolean isSecured()
- Specified by:
isSecuredin interfaceRemoteTickDB
-
isLoopback
public boolean isLoopback()
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfacedeltix.qsrv.hf.spi.conn.Disconnectable
-
compileQuery
public void compileQuery(java.lang.String query, java.util.List<Token> tokens)Compiles QQL/DDL Query. Returns CompilationResult contains parsed tokens information. If query contains errors, throws CompilationException.- Parameters:
query- query to compile.tokens-
-
describeQuery
public ClassSet<ClassDescriptor> describeQuery(java.lang.String qql, SelectionOptions options, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBReturns schema for the given query.- Specified by:
describeQueryin interfaceDXTickDB- Parameters:
qql- Query text.options- Selection options.params- Specified message types to be subscribed. If null, then all types will be subscribed.*- Returns:
- Schema contains classes definitions.
- Throws:
deltix.util.parsers.CompilationException- when query has errors
-
executeQuery
public InstrumentMessageSource executeQuery(java.lang.String qql, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text.params- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException
-
executeQuery
public InstrumentMessageSource executeQuery(java.lang.String qql, SelectionOptions options, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text.options- Selection options.params- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException- when query has errors
-
executeQuery
public InstrumentMessageSource executeQuery(java.lang.String qql, SelectionOptions options, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text.options- Selection options.ids- Specified entities to be subscribed. If null, then all entities will be subscribed.params- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException
-
executeQuery
public InstrumentMessageSource executeQuery(deltix.util.parsers.Element qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long time, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text element.options- Selection options.streams- Streams from which data will be selected.ids- Specified entities to be subscribed. If null, then all entities will be subscribed.time- The start timestamp.params- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException- when query has errors.
-
executeQuery
public InstrumentMessageSource executeQuery(deltix.util.parsers.Element qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long startTimestamp, long endTimestamp, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text element.options- Selection options.streams- Streams from which data will be selected.ids- Specified entities to be subscribed. If null, then all entities will be subscribed.startTimestamp- The start timestamp.endTimestamp- The end timestampparams- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException- when query has errors.
-
executeQuery
public InstrumentMessageSource executeQuery(java.lang.String qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long time, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text.options- Selection options.streams- Streams from which data will be selected.ids- Specified entities to be subscribed. If null, then all entities will be subscribed.time- The start timestamp.params- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException- when query has errors.
-
executeQuery
public InstrumentMessageSource executeQuery(java.lang.String qql, SelectionOptions options, TickStream[] streams, deltix.qsrv.hf.pub.InstrumentIdentity[] ids, long startTimestamp, long endTimestamp, Parameter... params) throws deltix.util.parsers.CompilationException
Description copied from interface:DXTickDBExecute Query and creates a message source for reading data from it, 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.
select * from bars- Specified by:
executeQueryin interfaceDXTickDB- Parameters:
qql- Query text.options- Selection options.streams- Streams from which data will be selected.ids- Specified entities to be subscribed. If null, then all entities will be subscribed.startTimestamp- The start timestamp.endTimestamp- The end timestampparams- The parameter values of the query.- Returns:
- An iterable message source to read messages.
- Throws:
deltix.util.parsers.CompilationException- when query has errors.
-
getHost
public java.lang.String getHost()
-
getPort
public int getPort()
-
setCompression
public void setCompression(boolean useCompression)
-
setApplicationId
public void setApplicationId(java.lang.String id)
-
getApplicationId
public java.lang.String getApplicationId()
-
setAffinityConfig
public void setAffinityConfig(deltix.thread.affinity.AffinityConfig affinityConfig)
-
isSSLEnabled
public boolean isSSLEnabled()
-
getSSLPort
public int getSSLPort()
-
addStateListener
public void addStateListener(DBStateListener listener)
- Specified by:
addStateListenerin interfaceDBStateNotifier
-
removeStateListener
public void removeStateListener(DBStateListener listener)
- Specified by:
removeStateListenerin interfaceDBStateNotifier
-
fireStateChanged
public void fireStateChanged(java.lang.String key)
- Specified by:
fireStateChangedin interfaceDBStateNotifier
-
fireAdded
public void fireAdded(java.lang.String key)
- Specified by:
fireAddedin interfaceDBStateNotifier
-
fireDeleted
public void fireDeleted(java.lang.String key)
- Specified by:
fireDeletedin interfaceDBStateNotifier
-
fireRenamed
public void fireRenamed(java.lang.String fromKey, java.lang.String toKey)- Specified by:
fireRenamedin interfaceDBStateNotifier
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getServerVersion
public java.lang.String getServerVersion()
-
getTopicDB
public TopicDB getTopicDB()
Description copied from interface:DXTickDBTopic API. May be not be supported by some implementations. UseDXTickDB.isTopicDBSupported()to check this.- Specified by:
getTopicDBin interfaceDXTickDB
-
isTopicDBSupported
public boolean isTopicDBSupported()
- Specified by:
isTopicDBSupportedin interfaceDXTickDB- Returns:
- true if this DB instance supports topics. If this methods returns false then
DXTickDB.getTopicDB()is unavailable.
-
-