Class UserDBClient
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.comm.client.UserDBClient
-
- All Implemented Interfaces:
DXTickDB,TickDB,WritableTickDB,deltix.util.io.AbstractDataStore,deltix.util.lang.Disposable,java.io.Closeable,java.lang.AutoCloseable
public class UserDBClient extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description UserDBClient(TickDBClient delegate, java.security.Principal user)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.TickCursorcreateCursor(SelectionOptions options, TickStream... streams)Opens an initially empty cursor for reading data from multiple streams, according to the specified options.DXTickStreamcreateFileStream(java.lang.String key, java.lang.String dataFile)Creates a new stream mount to the given data file.DXTickStreamcreateStream(java.lang.String key, StreamOptions options)Creates a new stream within the database.DXTickStreamcreateStream(java.lang.String key, java.lang.String name, java.lang.String description, int distributionFactor)Creates a new stream within the database.voiddelete()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.voidformat()CodecFactorygetCodecFactory(ChannelQualityOfService channelQOS)java.io.File[]getDbDirs()java.lang.StringgetId()MetaDatagetMetaData()Gets stream metadata contains all class descriptors.longgetMetaDataVersion()Gets current metadata version.deltix.util.concurrent.QuickExecutorgetQuickExecutor()intgetServerProtocolVersion()longgetServerTime()Returns system time of the timebase server.SessionClientgetSession()longgetSizeOnDisk()Returns the approximate size of the database's footprint.DXTickStreamgetStream(java.lang.String key)Looks up an existing stream by key.TopicDBgetTopicDB()Topic API.booleanisOpen()booleanisReadOnly()booleanisTopicDBSupported()DXChannel[]listChannels()DXTickStream[]listStreams()Enumerates existing streams.voidopen(boolean readOnly)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)voidsetAffinityConfig(deltix.thread.affinity.AffinityConfig affinityConfig)voidsetGrowthPolicy(deltix.util.lang.GrowthPolicy policy)Sets the file growth policyvoidtrimToSize()Trims all data files to minimum size.voidwarmUp()Forces the building of all memory indexes.
-
-
-
Constructor Detail
-
UserDBClient
public UserDBClient(TickDBClient delegate, java.security.Principal user)
-
-
Method Detail
-
getSession
public SessionClient getSession()
-
getQuickExecutor
public deltix.util.concurrent.QuickExecutor getQuickExecutor()
-
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
-
getServerProtocolVersion
public int getServerProtocolVersion()
-
getCodecFactory
public CodecFactory getCodecFactory(ChannelQualityOfService channelQOS)
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacedeltix.util.io.AbstractDataStore
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfacedeltix.util.io.AbstractDataStore
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfacedeltix.util.io.AbstractDataStore
-
getStream
public DXTickStream getStream(java.lang.String key)
Description copied from interface:WritableTickDBLooks up an existing stream by key.
-
listStreams
public DXTickStream[] 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
-
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.
-
getServerTime
public long getServerTime()
Description copied from interface:DXTickDBReturns system time of the timebase server.- Specified by:
getServerTimein interfaceDXTickDB
-
createStream
public DXTickStream 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 DXTickStream 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.
-
createStream
public DXTickStream 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.
-
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.
-
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.
-
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)
-
setAffinityConfig
public void setAffinityConfig(deltix.thread.affinity.AffinityConfig affinityConfig)
-
open
public void open(boolean readOnly)
- Specified by:
openin 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
-
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.
-
coolDown
public void coolDown()
Description copied from interface:DXTickDBRemoves all memory indexes. The indexes will be rebuilt on demand.
-
format
public void format()
- Specified by:
formatin interfacedeltix.util.io.AbstractDataStore
-
delete
public void delete()
- Specified by:
deletein interfacedeltix.util.io.AbstractDataStore
-
trimToSize
public void trimToSize()
Description copied from interface:DXTickDBTrims all data files to minimum size.- Specified by:
trimToSizein interfaceDXTickDB
-
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.
-
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
-
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.
-
-