Class StreamOptions


  • public class StreamOptions
    extends java.lang.Object
    Stream definition attributes.
    • Field Detail

      • MAX_DISTRIBUTION

        public static final int MAX_DISTRIBUTION
        "Maximum" distribution factor value. For example: having DF=1 all data will be stored in a single file.
        See Also:
        Constant Field Values
      • name

        public java.lang.String name
        Optional user-readable name.
      • description

        public java.lang.String description
        Optional multi-line description.
      • location

        public java.lang.String location
        Location of the stream (by default null). When defined this attribute provides alternative stream location (rather than default location under QuantServerHome)
      • distributionFactor

        public int distributionFactor
        The number of M-files into which to distribute the data. Supply MAX_DISTRIBUTION to keep a separate file for each instrument (default).
      • bufferOptions

        public BufferOptions bufferOptions
        Options that control data buffering.
      • unique

        public boolean unique
        Unique streams maintain in-memory cache of resent messages. This concept assumes that stream messages will have some field(s) marked as primary key PrimaryKey. Primary key may be a simple field (e.g. symbol) or composite (e.g. symbol and portfolio ID). For each key TimeBase runtime maintains a copy of the last message received for this key (cache). Each new consumer will receive a snapshot of current cache at the beginning of live data subscription.
      • duplicatesAllowed

        public boolean duplicatesAllowed
        Indicates that loader will ignore binary similar messages(for 'unique' streams only).
      • scope

        public StreamScope scope
        Determines persistent properties of a stream.
      • periodicity

        public deltix.util.time.Periodicity periodicity
        Stream periodicity, if known.
      • distributionRuleName

        public java.lang.String distributionRuleName
        Class name of the distribution rule
      • highAvailability

        public boolean highAvailability
        High availability durable streams are cached on startup.
      • owner

        public java.lang.String owner
        Optional owner of stream. During stream creation it will be set equals to authenticated user name.
      • version

        public java.lang.String version
        Stream format version. Supported versions are: "5.0" - Editable past format, TS data file "4.3" - "Classic" storage format, allocation free
      • polymorphic

        public boolean polymorphic
    • Constructor Detail

      • StreamOptions

        public StreamOptions()
      • StreamOptions

        public StreamOptions​(StreamScope scope,
                             java.lang.String name,
                             java.lang.String description,
                             int distributionFactor)
    • Method Detail

      • setMetaData

        public void setMetaData​(boolean polymorphic,
                                RecordClassSet md)
      • setPolymorphic

        public void setPolymorphic​(RecordClassDescriptor... cds)
        Marks this stream as polymorphic, capable of containing messages of several specified types.
        Parameters:
        cds - The descriptors of classes describing messages to be contained in the stream.
      • setFixedType

        public void setFixedType​(RecordClassDescriptor cd)
        Marks this stream as fixed-type (monomorphic), capable of containing messages of a single specified type.
        Parameters:
        cd - The descriptor of the class describing messages to be contained in the stream.
      • setPolymorphic

        public void setPolymorphic​(boolean poly)
      • isFixedType

        public boolean isFixedType()
      • isPolymorphic

        public boolean isPolymorphic()
      • fixedType

        public static StreamOptions fixedType​(StreamScope scope,
                                              java.lang.String name,
                                              java.lang.String description,
                                              int distributionFactor,
                                              RecordClassDescriptor cd)
        Creates monomorphic stream options with given attributes
        Parameters:
        scope - stream durability scope ()
        name - descriptive name
        description - description
        distributionFactor - Distribution Factor
        cd - RecordClassDescriptor object contains stream schema definition
        Returns:
        StreamOptions instance
      • polymorphic

        public static StreamOptions polymorphic​(StreamScope scope,
                                                java.lang.String name,
                                                java.lang.String description,
                                                int distributionFactor,
                                                RecordClassDescriptor... cds)
        Creates polymorphic stream options with given attributes
        Parameters:
        scope - stream durability scope ()
        name - descriptive name
        description - description
        distributionFactor - Distribution Factor
        cds - RecordClassDescriptor objects contains stream schema definition
        Returns:
        StreamOptions instance
      • isFlagSet

        public boolean isFlagSet​(int flag)
        Checks if specified additional flag is set.
        Parameters:
        flag - flag identifier. Example: TDBProtocol.AF_STUB_STREAM
        Returns:
        true if flag is set
      • setFlag

        public void setFlag​(int flag,
                            boolean enabled)
        Changes status of an additional flag.
        Parameters:
        flag - flag identifier. Example: TDBProtocol.AF_STUB_STREAM
        enabled - true to set flag, false to clear it