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 boolean
enableSSL
static deltix.gflog.Log
LOGGER
protected SessionClient
session
-
Constructor Summary
Constructors Modifier Constructor Description TickDBClient(java.lang.String host, int port)
TickDBClient(java.lang.String host, int port, boolean enableSSL)
protected
TickDBClient(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 void
addDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
void
addStateListener(DBStateListener listener)
void
close()
void
compileQuery(java.lang.String query, java.util.List<Token> tokens)
Compiles QQL/DDL Query.VSChannel
connect()
VSChannel
connect(ChannelType type, boolean autoCommit, boolean noDelay, ChannelCompression c, int channelBufferSize)
void
coolDown()
Removes all memory indexes.DXTickStream
createAnonymousStream(StreamOptions options)
Creates a new anonymous stream.protected VSChannel
createChannel(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.Disposable
createConsumerWorker(java.lang.String topicKey, ConsumerPreferences pref, IdleStrategy idleStrategy, java.util.concurrent.ThreadFactory threadFactory, MessageProcessor processor)
Creates worker-style message consumer.TickCursor
createCursor(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.TickStreamClient
createFileStream(java.lang.String key, java.lang.String dataFile)
Creates a new stream mount to the given data file.MessagePoller
createPollingConsumer(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.TickStreamClient
createStream(java.lang.String key, StreamOptions options)
Creates a new stream within the database.deltix.qsrv.hf.tickdb.comm.client.TickStreamClient
createStream(java.lang.String key, java.lang.String name, java.lang.String description, int distributionFactor)
Creates a new stream within the database.DirectChannel
createTopic(java.lang.String topicKey, RecordClassDescriptor[] types, TopicSettings settings)
Creates pub/sub style topic (IPC).void
delete()
void
deleteTopic(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.InstrumentMessageSource
executeQuery(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.InstrumentMessageSource
executeQuery(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.InstrumentMessageSource
executeQuery(java.lang.String qql, Parameter... params)
Execute Query and creates a message source for reading data from it, according to the specified options.InstrumentMessageSource
executeQuery(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.InstrumentMessageSource
executeQuery(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.InstrumentMessageSource
executeQuery(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.InstrumentMessageSource
executeQuery(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.void
fireAdded(java.lang.String key)
void
fireDeleted(java.lang.String key)
void
fireRenamed(java.lang.String fromKey, java.lang.String toKey)
void
fireStateChanged(java.lang.String key)
void
format()
java.lang.String
getApplicationId()
CodecFactory
getCodecFactory(ChannelQualityOfService qos)
java.lang.String
getConnectionString()
long[]
getConnectLatency()
java.io.File[]
getDbDirs()
java.lang.String
getHost()
java.lang.String
getId()
MetaData
getMetaData()
Gets stream metadata contains all class descriptors.long
getMetaDataVersion()
Gets current metadata version.int
getPort()
deltix.util.concurrent.QuickExecutor
getQuickExecutor()
long
getServerAvailableBandwidth()
int
getServerProtocolVersion()
long
getServerStartTime()
long
getServerTime()
Returns system time of the timebase server.java.lang.String
getServerVersion()
SessionClient
getSession()
long
getSizeOnDisk()
Returns the approximate size of the database's footprint.int
getSSLPort()
deltix.qsrv.hf.tickdb.comm.client.TickStreamClient
getStream(java.lang.String key)
Looks up an existing stream by key.int
getTimeout()
Gets timeout value for socket connections.DirectChannel
getTopic(java.lang.String topicKey)
TopicDB
getTopicDB()
Topic API.RecordClassDescriptor[]
getTypes(java.lang.String topicKey)
Returns list of types that can be written to and read from the specified topic.protected UserPrincipal
getUser()
boolean
isConnected()
boolean
isLoopback()
boolean
isOpen()
boolean
isReadOnly()
boolean
isSecured()
boolean
isSSLEnabled()
boolean
isTopicDBSupported()
DXChannel[]
listChannels()
deltix.qsrv.hf.tickdb.comm.client.TickStreamClient[]
listStreams()
Enumerates existing streams.java.util.List<java.lang.String>
listTopics()
void
open(boolean readOnly)
void
removeDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
void
removeStateListener(DBStateListener listener)
TickCursor
select(long time, SelectionOptions options, TickStream... streams)
TickCursor
select(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.TickCursor
select(long time, SelectionOptions options, java.lang.String[] types, TickStream... streams)
TickCursor
select(long time, SelectionOptions options, java.lang.String[] types, java.lang.CharSequence[] symbols, TickStream... streams)
void
setAccessToken(java.lang.String token)
Sets user access token to login to the Timebase server when OAUTH type of authentication defined on server.void
setAffinityConfig(deltix.thread.affinity.AffinityConfig affinityConfig)
void
setApplicationId(java.lang.String id)
void
setCompression(boolean useCompression)
void
setGrowthPolicy(deltix.util.lang.GrowthPolicy policy)
Sets the file growth policyvoid
setTimeout(int timeout)
Sets timeout for socket connections, in milliseconds.long[]
testConnectLatency(int iterations)
java.lang.String
toString()
void
trimToSize()
Trims all data files to minimum size.boolean
tryReconnect(int numAttempts, long timeSinceDisconnected, deltix.qsrv.hf.spi.conn.ReconnectableImpl helper)
void
warmUp()
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:
getId
in 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:
getTimeout
in 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:
setTimeout
in interfaceRemoteTickDB
- Parameters:
timeout
- the specified timeout, in milliseconds.- See Also:
getTimeout()
-
getServerProtocolVersion
public int getServerProtocolVersion()
-
getServerStartTime
public long getServerStartTime()
- Specified by:
getServerStartTime
in interfaceRemoteTickDB
-
open
public void open(boolean readOnly)
- Specified by:
open
in interfacedeltix.util.io.AbstractDataStore
-
getQuickExecutor
public deltix.util.concurrent.QuickExecutor getQuickExecutor()
-
getSizeOnDisk
public long getSizeOnDisk()
Description copied from interface:DXTickDB
Returns the approximate size of the database's footprint.- Specified by:
getSizeOnDisk
in interfaceDXTickDB
- Returns:
- Size in bytes.
-
getStream
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient getStream(java.lang.String key)
Description copied from interface:WritableTickDB
Looks up an existing stream by key.
-
getServerAvailableBandwidth
public long getServerAvailableBandwidth()
-
getServerTime
public long getServerTime()
Description copied from interface:DXTickDB
Returns system time of the timebase server.- Specified by:
getServerTime
in interfaceDXTickDB
-
listStreams
public deltix.qsrv.hf.tickdb.comm.client.TickStreamClient[] listStreams()
Description copied from interface:WritableTickDB
Enumerates existing streams.- Specified by:
listStreams
in interfaceDXTickDB
- Specified by:
listStreams
in interfaceTickDB
- Specified by:
listStreams
in interfaceWritableTickDB
- Returns:
- An array of existing stream objects.
-
listChannels
public DXChannel[] listChannels()
- Specified by:
listChannels
in interfaceDXTickDB
-
coolDown
public void coolDown()
Description copied from interface:DXTickDB
Removes all memory indexes. The indexes will be rebuilt on demand.
-
createAnonymousStream
public DXTickStream createAnonymousStream(StreamOptions options)
Description copied from interface:DXTickDB
Creates a new anonymous stream.- Specified by:
createAnonymousStream
in interfaceDXTickDB
- Parameters:
options
- Options for creating the stream. The stream is automatically created with theStreamScope.RUNTIME
scope.
-
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:DXTickDB
Creates 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:
createStream
in 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:DXTickDB
Creates a new stream within the database.- Specified by:
createStream
in 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:DXTickDB
Creates a new stream mount to the given data file.- Specified by:
createFileStream
in 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:TopicDB
Creates pub/sub style topic (IPC). You can use this type of topics only when client is local (on same machine with TimeBase).- Specified by:
createTopic
in 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:TopicDB
Deletes topic data from registry. Does not check for existing publishers/consumers.- Specified by:
deleteTopic
in interfaceTopicDB
-
listTopics
public java.util.List<java.lang.String> listTopics()
- Specified by:
listTopics
in interfaceTopicDB
- Returns:
- list of all topic keys
-
getTypes
public RecordClassDescriptor[] getTypes(@Nonnull java.lang.String topicKey)
Description copied from interface:TopicDB
Returns 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 TopicNotFoundException
Description copied from interface:TopicDB
Creates channel for message publishing.- Specified by:
createPublisher
in interfaceTopicDB
- Parameters:
topicKey
- topic identifierpref
- configuration for this publisheridleStrategy
- strategy to be used when publishing is not possible due to back pressure. Ifnull
then 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:TopicDB
Creates worker-style message consumer.- Specified by:
createConsumerWorker
in interfaceTopicDB
- Parameters:
topicKey
- topic identifierpref
- configuration for this consumeridleStrategy
- strategy to be used when there are no messages to consume. Ifnull
then determined bypreferences
.threadFactory
- thread factory that will be used to run theprocessor
. Ifnull
then default thread factory will be used.processor
- instance to process arrived messages- Returns:
- returns a
Disposable
that can be used to stop message processing
-
createPollingConsumer
public MessagePoller createPollingConsumer(@Nonnull java.lang.String topicKey, @Nullable ConsumerPreferences pref)
Description copied from interface:TopicDB
Creates a non-blocking poll-style message consumer.- Specified by:
createPollingConsumer
in interfaceTopicDB
- Parameters:
topicKey
- topic identifierpref
- configuration for this consumer- Returns:
- returns
MessagePoller
that 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:TopicDB
CreatesMessageSource
-style message consumer (blocking).- Specified by:
createConsumer
in interfaceTopicDB
- Parameters:
topicKey
- topic identifierpref
- configuration for this consumeridleStrategy
- strategy to be used when there are no messages to consume. Ifnull
then determined bypreferences
.- Returns:
MessageSource
for topic. CallingAbstractCursor.next()
will block.
-
createCursor
public TickCursor createCursor(SelectionOptions options, TickStream... streams)
Description copied from interface:TickDB
Opens 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
TickCursor
interface provides methods for dynamically re-configuring the subscription, or jumping to a different timestamp.- Specified by:
createCursor
in 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:TickDB
Opens 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
TickCursor
interface provides methods for dynamically re-configuring the subscription, or jumping to a different timestamp.- Specified by:
select
in 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:DXTickDB
Sets the file growth policy- Specified by:
setGrowthPolicy
in interfaceDXTickDB
- Parameters:
policy
- Growth Policy value
-
trimToSize
public void trimToSize()
Description copied from interface:DXTickDB
Trims all data files to minimum size.- Specified by:
trimToSize
in interfaceDXTickDB
-
warmUp
public void warmUp()
Description copied from interface:DXTickDB
Forces the building of all memory indexes. This is useful in performance testing or on server startup.
-
delete
public void delete()
- Specified by:
delete
in interfacedeltix.util.io.AbstractDataStore
-
format
public void format()
- Specified by:
format
in interfacedeltix.util.io.AbstractDataStore
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacedeltix.util.io.AbstractDataStore
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in interfacedeltix.util.io.AbstractDataStore
-
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
-
getMetaDataVersion
public long getMetaDataVersion()
Description copied from interface:DXTickDB
Gets current metadata version.- Specified by:
getMetaDataVersion
in interfaceDXTickDB
- Returns:
- current metadata version number.
-
getMetaData
public MetaData getMetaData()
Description copied from interface:DXTickDB
Gets stream metadata contains all class descriptors.- Specified by:
getMetaData
in 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:
tryReconnect
in interfacedeltix.qsrv.hf.spi.conn.ReconnectableImpl.Reconnector
- Throws:
java.lang.Exception
-
addDisconnectEventListener
public void addDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
- Specified by:
addDisconnectEventListener
in interfacedeltix.qsrv.hf.spi.conn.Disconnectable
-
removeDisconnectEventListener
public void removeDisconnectEventListener(deltix.qsrv.hf.spi.conn.DisconnectEventListener listener)
- Specified by:
removeDisconnectEventListener
in interfacedeltix.qsrv.hf.spi.conn.Disconnectable
-
isSecured
public boolean isSecured()
- Specified by:
isSecured
in interfaceRemoteTickDB
-
isLoopback
public boolean isLoopback()
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in 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:DXTickDB
Returns schema for the given query.- Specified by:
describeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:DXTickDB
Execute 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:
executeQuery
in 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:
addStateListener
in interfaceDBStateNotifier
-
removeStateListener
public void removeStateListener(DBStateListener listener)
- Specified by:
removeStateListener
in interfaceDBStateNotifier
-
fireStateChanged
public void fireStateChanged(java.lang.String key)
- Specified by:
fireStateChanged
in interfaceDBStateNotifier
-
fireAdded
public void fireAdded(java.lang.String key)
- Specified by:
fireAdded
in interfaceDBStateNotifier
-
fireDeleted
public void fireDeleted(java.lang.String key)
- Specified by:
fireDeleted
in interfaceDBStateNotifier
-
fireRenamed
public void fireRenamed(java.lang.String fromKey, java.lang.String toKey)
- Specified by:
fireRenamed
in interfaceDBStateNotifier
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getServerVersion
public java.lang.String getServerVersion()
-
getTopicDB
public TopicDB getTopicDB()
Description copied from interface:DXTickDB
Topic API. May be not be supported by some implementations. UseDXTickDB.isTopicDBSupported()
to check this.- Specified by:
getTopicDB
in interfaceDXTickDB
-
isTopicDBSupported
public boolean isTopicDBSupported()
- Specified by:
isTopicDBSupported
in interfaceDXTickDB
- Returns:
- true if this DB instance supports topics. If this methods returns false then
DXTickDB.getTopicDB()
is unavailable.
-
-