Interface DXTickDB

    • Method Detail

      • warmUp

        void warmUp()
        Forces the building of all memory indexes. This is useful in performance testing or on server startup.
      • coolDown

        void coolDown()
        Removes all memory indexes. The indexes will be rebuilt on demand.
      • trimToSize

        void trimToSize()
        Trims all data files to minimum size.
      • getSizeOnDisk

        long getSizeOnDisk()
        Returns the approximate size of the database's footprint.
        Returns:
        Size in bytes.
      • getStream

        DXTickStream getStream​(java.lang.String key)
        Description copied from interface: WritableTickDB
        Looks up an existing stream by key.
        Specified by:
        getStream in interface TickDB
        Specified by:
        getStream in interface WritableTickDB
        Parameters:
        key - Identifies the stream.
        Returns:
        A stream object, or null if the key was not found.
      • getDbDirs

        java.io.File[] getDbDirs()
      • createAnonymousStream

        @Deprecated
        DXTickStream createAnonymousStream​(StreamOptions options)
        Deprecated.
        Creates a new anonymous stream.
        Parameters:
        options - Options for creating the stream. The stream is automatically created with the StreamScope.RUNTIME scope.
      • getServerTime

        long getServerTime()
        Returns system time of the timebase server.
      • createStream

        DXTickStream createStream​(java.lang.String key,
                                  StreamOptions options)
        Creates a new stream within the database.
        Parameters:
        key - A required key later used to identify the stream.
        options - Options for creating the stream.
        Throws:
        java.lang.IllegalArgumentException - When the key is duplicate.
      • createFileStream

        DXTickStream createFileStream​(java.lang.String key,
                                      java.lang.String dataFile)
        Creates a new stream mount to the given data file.
        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

        DXTickStream createStream​(java.lang.String key,
                                  java.lang.String name,
                                  java.lang.String description,
                                  int distributionFactor)
        Creates a new stream within the database. The newly created stream must be configured with the required metadata via calling either DXTickStream.setFixedType(deltix.qsrv.hf.pub.md.RecordClassDescriptor) or DXTickStream.setPolymorphic(deltix.qsrv.hf.pub.md.RecordClassDescriptor...).
        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.
        Throws:
        java.lang.IllegalArgumentException - When the key is duplicate.
      • setGrowthPolicy

        void setGrowthPolicy​(deltix.util.lang.GrowthPolicy policy)
        Sets the file growth policy
        Parameters:
        policy - Growth Policy value
      • getMetaDataVersion

        long getMetaDataVersion()
        Gets current metadata version.
        Returns:
        current metadata version number.
      • describeQuery

        ClassSet describeQuery​(java.lang.String qql,
                               SelectionOptions options,
                               Parameter... params)
                        throws deltix.util.parsers.CompilationException
        Returns schema for the given query.
        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

        InstrumentMessageSource executeQuery​(java.lang.String qql,
                                             SelectionOptions options,
                                             deltix.qsrv.hf.pub.InstrumentIdentity[] ids,
                                             Parameter... params)
                                      throws deltix.util.parsers.CompilationException

        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
        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

        InstrumentMessageSource executeQuery​(java.lang.String qql,
                                             Parameter... params)
                                      throws deltix.util.parsers.CompilationException

        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
        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

        InstrumentMessageSource executeQuery​(java.lang.String qql,
                                             SelectionOptions options,
                                             Parameter... params)
                                      throws deltix.util.parsers.CompilationException

        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
        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

        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

        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
        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

        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

        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
        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 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

        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

        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
        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

        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

        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
        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 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.
      • isTopicDBSupported

        boolean isTopicDBSupported()
        Returns:
        true if this DB instance supports topics. If this methods returns false then getTopicDB() is unavailable.