Package deltix.qsrv.hf.tickdb.pub
Class StreamOptions
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.pub.StreamOptions
-
public class StreamOptions extends java.lang.Object
Stream definition attributes.
-
-
Field Summary
Fields Modifier and Type Field Description deltix.util.collections.generated.IntegerHashSet
additionalFlags
Set of additional stream flags (identified by integer key).BufferOptions
bufferOptions
Options that control data buffering.java.lang.String
description
Optional multi-line description.int
distributionFactor
The number of M-files into which to distribute the data.java.lang.String
distributionRuleName
Class name of the distribution ruleboolean
duplicatesAllowed
Indicates that loader will ignore binary similar messages(for 'unique' streams only).boolean
highAvailability
High availability durable streams are cached on startup.java.lang.String
location
Location of the stream (by default null).static int
MAX_DISTRIBUTION
"Maximum" distribution factor value.java.lang.String
name
Optional user-readable name.java.lang.String
owner
Optional owner of stream.deltix.util.time.Periodicity
periodicity
Stream periodicity, if known.boolean
polymorphic
StreamScope
scope
Determines persistent properties of a stream.boolean
unique
Unique streams maintain in-memory cache of resent messages.java.lang.String
version
Stream format version.
-
Constructor Summary
Constructors Constructor Description StreamOptions()
StreamOptions(StreamScope scope, java.lang.String name, java.lang.String description, int distributionFactor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamOptions
fixedType(StreamScope scope, java.lang.String name, java.lang.String description, int distributionFactor, RecordClassDescriptor cd)
Creates monomorphic stream options with given attributesRecordClassSet
getMetaData()
RecordClassDescriptor
getSchemaChangeDescriptor()
Introspects and returns RecordClassDescriptor ofSchemaChangeMessage
.boolean
isFixedType()
boolean
isFlagSet(int flag)
Checks if specified additional flag is set.boolean
isPolymorphic()
static StreamOptions
polymorphic(StreamScope scope, java.lang.String name, java.lang.String description, int distributionFactor, RecordClassDescriptor... cds)
Creates polymorphic stream options with given attributesvoid
setFixedType(RecordClassDescriptor cd)
Marks this stream as fixed-type (monomorphic), capable of containing messages of a single specified type.void
setFlag(int flag, boolean enabled)
Changes status of an additional flag.void
setMetaData(boolean polymorphic, RecordClassSet md)
void
setPolymorphic(boolean poly)
void
setPolymorphic(RecordClassDescriptor... cds)
Marks this stream as polymorphic, capable of containing messages of several specified types.static RecordClassDescriptor[]
sort(RecordClassDescriptor... cds)
-
-
-
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. SupplyMAX_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 keyPrimaryKey
. 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.
-
additionalFlags
public deltix.util.collections.generated.IntegerHashSet additionalFlags
Set of additional stream flags (identified by integer key). Use methodssetFlag(int, boolean)
andisFlagSet(int)
toggle flags. Example:TDBProtocol.AF_STUB_STREAM
-
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
-
getMetaData
public RecordClassSet getMetaData()
-
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 namedescription
- descriptiondistributionFactor
- Distribution Factorcd
- 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 namedescription
- descriptiondistributionFactor
- Distribution Factorcds
- RecordClassDescriptor objects contains stream schema definition- Returns:
- StreamOptions instance
-
sort
public static RecordClassDescriptor[] sort(RecordClassDescriptor... cds)
-
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
-
getSchemaChangeDescriptor
public RecordClassDescriptor getSchemaChangeDescriptor()
Introspects and returns RecordClassDescriptor ofSchemaChangeMessage
.- Returns:
RecordClassDescriptor
-
-