RTI Connext Java API Version 7.1.0
DataReaderResourceLimitsQosPolicy Class Reference

Various settings that configure how a com.rti.dds.subscription.DataReader allocates and uses physical memory for internal resources. More...

Inheritance diagram for DataReaderResourceLimitsQosPolicy:
QosPolicy

Public Attributes

int max_remote_writers
 The maximum number of remote writers from which a com.rti.dds.subscription.DataReader may read, including all instances. More...
 
int max_remote_writers_per_instance
 The maximum number of remote writers from which a com.rti.dds.subscription.DataReader may read a single instance. More...
 
int max_samples_per_remote_writer
 The maximum number of out-of-order samples from a given remote com.rti.dds.publication.DataWriter that a com.rti.dds.subscription.DataReader may store when maintaining a reliable connection to the com.rti.dds.publication.DataWriter. More...
 
int max_infos
 The maximum number of info units that a com.rti.dds.subscription.DataReader can use to store com.rti.dds.subscription.SampleInfo. More...
 
int initial_remote_writers
 The initial number of remote writers from which a com.rti.dds.subscription.DataReader may read, including all instances. More...
 
int initial_remote_writers_per_instance
 The initial number of remote writers from which a com.rti.dds.subscription.DataReader may read a single instance. More...
 
int initial_infos
 The initial number of info units that a com.rti.dds.subscription.DataReader can have, which are used to store com.rti.dds.subscription.SampleInfo. More...
 
int initial_outstanding_reads
 The initial number of outstanding calls to read/take (or one of their variants) on the same com.rti.dds.subscription.DataReader for which memory has not been returned by calling com.rti.ndds.example.FooDataReader.return_loan. More...
 
int max_outstanding_reads
 The maximum number of outstanding read/take calls (or one of their variants) on the same com.rti.dds.subscription.DataReader for which memory has not been returned by calling com.rti.ndds.example.FooDataReader.return_loan. More...
 
int max_samples_per_read
 The maximum number of data samples that the application can receive from the middleware in a single call to com.rti.ndds.example.FooDataReader.read or com.rti.ndds.example.FooDataReader.take. If more data exists in the middleware, the application will need to issue multiple read/take calls. More...
 
boolean disable_fragmentation_support
 Determines whether the com.rti.dds.subscription.DataReader can receive fragmented samples. More...
 
int max_fragmented_samples
 The maximum number of samples for which the com.rti.dds.subscription.DataReader may store fragments at a given point in time. More...
 
int initial_fragmented_samples
 The initial number of samples for which a com.rti.dds.subscription.DataReader may store fragments. More...
 
int max_fragmented_samples_per_remote_writer
 The maximum number of samples per remote writer for which a com.rti.dds.subscription.DataReader may store fragments. More...
 
int max_fragments_per_sample
 Maximum number of fragments for a single sample. More...
 
boolean dynamically_allocate_fragmented_samples
 Determines whether the com.rti.dds.subscription.DataReader pre-allocates storage for storing fragmented samples. More...
 
int max_total_instances
 Maximum number of instances for which a DataReader will keep state. More...
 
int max_remote_virtual_writers
 The maximum number of remote virtual writers from which a com.rti.dds.subscription.DataReader may read, including all instances. More...
 
int initial_remote_virtual_writers
 The initial number of remote virtual writers from which a com.rti.dds.subscription.DataReader may read, including all instances. More...
 
int max_remote_virtual_writers_per_instance
 The maximum number of virtual remote writers that can be associated with an instance. More...
 
int initial_remote_virtual_writers_per_instance
 The initial number of virtual remote writers per instance. More...
 
int max_remote_writers_per_sample
 The maximum number of remote writers allowed to write the same sample. More...
 
int max_query_condition_filters
 The maximum number of query condition filters a reader is allowed. More...
 
int max_app_ack_response_length
 Maximum length of application-level acknowledgment response data. More...
 
boolean keep_minimum_state_for_instances
 Whether or not keep a minimum instance state for up to com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_total_instances. More...
 
int initial_topic_queries
 The initial number of TopicQueries allocated by a com.rti.dds.subscription.DataReader. More...
 
int max_topic_queries
 The maximum number of active TopicQueries that a com.rti.dds.subscription.DataReader can create. More...
 
DataReaderResourceLimitsInstanceReplacementSettings instance_replacement
 Sets the kind of instances allowed to be replaced for each instance state (com.rti.dds.subscription.InstanceStateKind) when a DataReader reaches com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances. More...
 
- Public Attributes inherited from QosPolicy
final QosPolicyId_t id
 The ID of this QoS policy. More...
 
final String policy_name
 The name of this QoS policy. More...
 

Static Public Attributes

static final int AUTO_MAX_TOTAL_INSTANCES
 <<extension>> This value is used to make com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_total_instances equal to com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances. More...
 

Detailed Description

Various settings that configure how a com.rti.dds.subscription.DataReader allocates and uses physical memory for internal resources.

DataReaders must allocate internal structures to handle the maximum number of DataWriters that may connect to it, whether or not a com.rti.dds.subscription.DataReader handles data fragmentation and how many data fragments that it may handle (for data samples larger than the MTU of the underlying network transport), how many simultaneous outstanding loans of internal memory holding data samples can be provided to user code, as well as others.

Most of these internal structures start at an initial size and, by default, will grow as needed by dynamically allocating additional memory. You may set fixed, maximum sizes for these internal structures if you want to bound the amount of memory that can be used by a com.rti.dds.subscription.DataReader. By setting the initial size to the maximum size, you will prevent RTI Connext from dynamically allocating any memory after the creation of the com.rti.dds.subscription.DataReader.

This QoS policy is an extension to the DDS standard.

Entity:
com.rti.dds.subscription.DataReader
Properties:
RxO = N/A
Changeable = NO

Member Data Documentation

◆ max_remote_writers

int max_remote_writers

The maximum number of remote writers from which a com.rti.dds.subscription.DataReader may read, including all instances.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED
[range] [1, 1 million] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_remote_writers, >= max_remote_writers_per_instance

For unkeyed types, this value has to be equal to max_remote_writers_per_instance if max_remote_writers_per_instance is not equal to com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED.

Note: For efficiency, set max_remote_writers >= com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_remote_writers_per_instance.

◆ max_remote_writers_per_instance

int max_remote_writers_per_instance

The maximum number of remote writers from which a com.rti.dds.subscription.DataReader may read a single instance.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

[range] [1, 1024] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, <= max_remote_writers or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_remote_writers_per_instance

For unkeyed types, this value has to be equal to max_remote_writers if it is not com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED.

Note: For efficiency, set max_remote_writers_per_instance <= com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_remote_writers

◆ max_samples_per_remote_writer

int max_samples_per_remote_writer

◆ max_infos

int max_infos

The maximum number of info units that a com.rti.dds.subscription.DataReader can use to store com.rti.dds.subscription.SampleInfo.

When read/take is called on a DataReader, the DataReader passes a sequence of data samples and an associated sample info sequence. The sample info sequence contains additional information for each data sample.

max_infos determines the resources allocated for storing sample info. This memory is loaned to the application when passing a sample info sequence.

Note that sample info is a snapshot, generated when read/take is called.

max_infos should not be less than max_samples.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

[range] [1, 1 million] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_infos

◆ initial_remote_writers

int initial_remote_writers

The initial number of remote writers from which a com.rti.dds.subscription.DataReader may read, including all instances.

[default] 2

[range] [1, 1 million], <= max_remote_writers

For unkeyed types this value has to be equal to initial_remote_writers_per_instance.

Note: For efficiency, set initial_remote_writers >= com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.initial_remote_writers_per_instance.

◆ initial_remote_writers_per_instance

int initial_remote_writers_per_instance

The initial number of remote writers from which a com.rti.dds.subscription.DataReader may read a single instance.

[default] 2

[range] [1,1024], <= max_remote_writers_per_instance

For unkeyed types this value has to be equal to initial_remote_writers.

Note: For efficiency, set initial_remote_writers_per_instance <= com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.initial_remote_writers.

◆ initial_infos

int initial_infos

The initial number of info units that a com.rti.dds.subscription.DataReader can have, which are used to store com.rti.dds.subscription.SampleInfo.

[default] 32

[range] [1,1 million], <= max_infos

◆ initial_outstanding_reads

int initial_outstanding_reads

The initial number of outstanding calls to read/take (or one of their variants) on the same com.rti.dds.subscription.DataReader for which memory has not been returned by calling com.rti.ndds.example.FooDataReader.return_loan.

[default] 2

[range] [1, 65536], <= max_outstanding_reads

◆ max_outstanding_reads

int max_outstanding_reads

The maximum number of outstanding read/take calls (or one of their variants) on the same com.rti.dds.subscription.DataReader for which memory has not been returned by calling com.rti.ndds.example.FooDataReader.return_loan.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

[range] [1, 65536] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_outstanding_reads

◆ max_samples_per_read

int max_samples_per_read

The maximum number of data samples that the application can receive from the middleware in a single call to com.rti.ndds.example.FooDataReader.read or com.rti.ndds.example.FooDataReader.take. If more data exists in the middleware, the application will need to issue multiple read/take calls.

When reading data using listeners, the expected number of samples available for delivery in a single take call is typically small: usually just one, in the case of unbatched data, or the number of samples in a single batch, in the case of batched data. (See com.rti.dds.infrastructure.BatchQosPolicy for more information about this feature.) When polling for data or using a com.rti.dds.infrastructure.WaitSet, however, multiple samples (or batches) could be retrieved at once, depending on the data rate.

A larger value for this parameter makes the API simpler to use at the expense of some additional memory consumption.

[default] 1024

[range] [1,65536]

◆ disable_fragmentation_support

boolean disable_fragmentation_support

Determines whether the com.rti.dds.subscription.DataReader can receive fragmented samples.

When fragmentation support is not needed, disabling fragmentation support will save some memory resources.

[default] com.rti.dds.infrastructure.false

◆ max_fragmented_samples

int max_fragmented_samples

The maximum number of samples for which the com.rti.dds.subscription.DataReader may store fragments at a given point in time.

At any given time, a com.rti.dds.subscription.DataReader may store fragments for up to max_fragmented_samples samples while waiting for the remaining fragments. These samples need not have consecutive sequence numbers and may have been sent by different com.rti.dds.publication.DataWriter instances.

Once all fragments of a sample have been received, the sample is treated as a regular sample and becomes subject to standard QoS settings such as com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_samples.

The middleware will drop fragments if the max_fragmented_samples limit has been reached. For best-effort communication, the middleware will accept a fragment for a new sample, but drop the oldest fragmented sample from the same remote writer. For reliable communication, the middleware will drop fragments for any new samples until all fragments for at least one older sample from that writer have been received.

Only applies if com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.disable_fragmentation_support is com.rti.dds.infrastructure.false.

[default] 1024

[range] [1, 1 million]

◆ initial_fragmented_samples

int initial_fragmented_samples

The initial number of samples for which a com.rti.dds.subscription.DataReader may store fragments.

Only applies if com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.disable_fragmentation_support is com.rti.dds.infrastructure.false.

[default] 4

[range] [1,1024], <= max_fragmented_samples

◆ max_fragmented_samples_per_remote_writer

int max_fragmented_samples_per_remote_writer

The maximum number of samples per remote writer for which a com.rti.dds.subscription.DataReader may store fragments.

Logical limit so a single remote writer cannot consume all available resources.

Only applies if com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.disable_fragmentation_support is com.rti.dds.infrastructure.false.

[default] 256

[range] [1, 1 million], <= max_fragmented_samples

◆ max_fragments_per_sample

int max_fragments_per_sample

◆ dynamically_allocate_fragmented_samples

boolean dynamically_allocate_fragmented_samples

Determines whether the com.rti.dds.subscription.DataReader pre-allocates storage for storing fragmented samples.

By default, the middleware does not allocate memory upfront, but instead allocates memory from the heap upon receiving the first fragment of a new sample. The amount of memory allocated equals the amount of memory needed to store all fragments in the sample. Once all fragments of a sample have been received, the sample is deserialized and stored in the regular receive queue. At that time, the dynamically allocated memory is freed again.

This QoS setting is useful for large, but variable-sized data types where upfront memory allocation for multiple samples based on the maximum possible sample size may be expensive. The main disadvantage of not pre-allocating memory is that one can no longer guarantee the middleware will have sufficient resources at runtime.

If dynamically_allocate_fragmented_samples is set to com.rti.dds.infrastructure.false, the middleware will allocate memory upfront for storing fragments for up to com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.initial_fragmented_samples samples. This memory may grow up to com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_fragmented_samples if needed.

Only applies if com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.disable_fragmentation_support is com.rti.dds.infrastructure.false.

[default] com.rti.dds.infrastructure.true

◆ max_total_instances

int max_total_instances

Maximum number of instances for which a DataReader will keep state.

The maximum number of instances actively managed by a DataReader is determined by com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances.

These instances have associated DataWriters or samples in the DataReader's queue and are visible to the user through operations such as com.rti.ndds.example.FooDataReader.take, com.rti.ndds.example.FooDataReader.read, and com.rti.ndds.example.FooDataReader.get_key_value.

The features Durable Reader State, MultiChannel DataWriters and RTI Persistence Service require RTI Connext to keep some internal state even for instances without DataWriters or samples in the DataReader's queue. The additional state is used to filter duplicate samples that could be coming from different DataWriter channels or from multiple executions of RTI Persistence Service.

The total maximum number of instances that will be managed by the middleware, including instances without associated DataWriters or samples, is determined by max_total_instances.

When a new instance is received, RTI Connext will check the resource limit com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances. If the limit is exceeded, RTI Connext will drop the sample with the reason LOST_BY_INSTANCES_LIMIT. If the limit is not exceeded, RTI Connext will check max_total_instances. If max_total_instances is exceeded, RTI Connext will replace an existing instance without DataWriters and samples with the new one. The application could receive duplicate samples for the replaced instance if it becomes alive again.

The max_total_instances limit is not used if com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.keep_minimum_state_for_instances is false, and in that case should be left at the default value.

[default] com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.AUTO_MAX_TOTAL_INSTANCES

[range] [1, 1 million] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED or com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.AUTO_MAX_TOTAL_INSTANCES, >= com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances

◆ max_remote_virtual_writers

int max_remote_virtual_writers

The maximum number of remote virtual writers from which a com.rti.dds.subscription.DataReader may read, including all instances.

When com.rti.dds.infrastructure.PresentationQosPolicy.access_scope is set to com.rti.dds.infrastructure.PresentationQosPolicyAccessScopeKind.PresentationQosPolicyAccessScopeKind.GROUP_PRESENTATION_QOS, this value determines the maximum number of DataWriter groups that can be managed by the com.rti.dds.subscription.Subscriber containing this com.rti.dds.subscription.DataReader.

Since the com.rti.dds.subscription.Subscriber may contain more than one com.rti.dds.subscription.DataReader, only the setting of the first applies.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED
[range] [1, 1 million] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_remote_virtual_writers, >= max_remote_virtual_writers_per_instance

◆ initial_remote_virtual_writers

int initial_remote_virtual_writers

The initial number of remote virtual writers from which a com.rti.dds.subscription.DataReader may read, including all instances.

[default] 2
[range] [1, 1 million] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, <= max_remote_virtual_writers

◆ max_remote_virtual_writers_per_instance

int max_remote_virtual_writers_per_instance

The maximum number of virtual remote writers that can be associated with an instance.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

[range] [1, 1024] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED, >= initial_remote_virtual_writers_per_instance

For unkeyed types, this value is ignored.

The features of Durable Reader State and MultiChannel DataWriters, and RTI Persistence Service require RTI Connext to keep some internal state per virtual writer and instance that is used to filter duplicate samples. These duplicate samples could be coming from different DataWriter channels or from multiple executions of RTI Persistence Service.

Once an association between a remote virtual writer and an instance is established, it is permanent – it will not disappear even if the physical writer incarnating the virtual writer is destroyed.

If max_remote_virtual_writers_per_instance is exceeded for an instance, RTI Connext will not associate this instance with new virtual writers. Duplicates samples from these virtual writers will not be filtered on the reader.

If you are not using Durable Reader State, MultiChannel DataWriters or RTI Persistence Service in your system, you can set this property to 1 to optimize resources.

◆ initial_remote_virtual_writers_per_instance

int initial_remote_virtual_writers_per_instance

The initial number of virtual remote writers per instance.

[default] 2

[range] [1, 1024], <= max_remote_virtual_writers_per_instance

For unkeyed types, this value is ignored.

◆ max_remote_writers_per_sample

int max_remote_writers_per_sample

The maximum number of remote writers allowed to write the same sample.

One scenario in which two DataWriters may write the same sample is Persistence Service. The DataReader may receive the same sample coming from the original DataWriter and from a Persistence Service DataWriter. [default] 3

[range] [1, 1024]

◆ max_query_condition_filters

int max_query_condition_filters

The maximum number of query condition filters a reader is allowed.

[default] 4

[range] [0, 32]

This value determines the maximum number of unique query condition content filters that a reader may create.

Each query condition content filter is comprised of both its query_expression and query_parameters. Two query conditions that have the same query_expression will require unique query condition filters if their query_paramters differ. Query conditions that differ only in their state masks will share the same query condition filter.

◆ max_app_ack_response_length

int max_app_ack_response_length

Maximum length of application-level acknowledgment response data.

The maximum length of response data in an application-level acknowledgment.

When set to zero, no response data is sent with application-level acknowledgments.

[default] 1

[range] [0, 32768]

◆ keep_minimum_state_for_instances

boolean keep_minimum_state_for_instances

Whether or not keep a minimum instance state for up to com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_total_instances.

The features Durable Reader State, multi-channel DataWriters, and Persistence Service require RTI Connext to keep some minimal internal state even for instances without DataWriters or DDS samples in the DataReader's queue, or that have been purged due to a dispose. The additional state is used to filter duplicate DDS samples that could be coming from different DataWriter channels or from multiple executions of Persistence Service. The total maximum number of instances that will be managed by the middleware, including instances without associated DataWriters or DDS samples or that have been purged due to a dispose, is determined by com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.max_total_instances.

This additional state will only be kept for up to max_total_instances if this field is set to com.rti.dds.infrastructure.true, otherwise the additional state will not be kept for any instances.

The minimum state includes information such as the source timestamp of the last sample received by the instance and the last sequence number received from a virtual GUID.

[default] com.rti.dds.infrastructure.true

◆ initial_topic_queries

int initial_topic_queries

The initial number of TopicQueries allocated by a com.rti.dds.subscription.DataReader.

[default] 1

See also
com.rti.dds.subscription.TopicQuery

◆ max_topic_queries

int max_topic_queries

The maximum number of active TopicQueries that a com.rti.dds.subscription.DataReader can create.

Once this limit is reached, a com.rti.dds.subscription.DataReader can create more TopicQueries only if it deletes some of the previously created ones.

[default] com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

See also
com.rti.dds.subscription.TopicQuery

◆ instance_replacement

Sets the kind of instances allowed to be replaced for each instance state (com.rti.dds.subscription.InstanceStateKind) when a DataReader reaches com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances.

When com.rti.dds.infrastructure.ResourceLimitsQosPolicy.max_instances is reached, a com.rti.dds.subscription.DataReader will try to make room for a new instance by attempting to reclaim an existing instance based on the instance replacement kinds specified by this field.

A DataReader can choose what kinds of instances can be replaced for each com.rti.dds.subscription.InstanceStateKind separately. This means, for example, that a DataReader can choose to not allow replacing alive (com.rti.dds.subscription.InstanceStateKind.ALIVE_INSTANCE_STATE) instances but allow replacement of empty disposed (com.rti.dds.subscription.InstanceStateKind.NOT_ALIVE_DISPOSED_INSTANCE_STATE) instances.

Only instances whose states match the specified kinds are eligible to be replaced. In addition, there must be no outstanding loans on any of the samples belonging to the instance for it to be considered for replacement.

For all kinds, a com.rti.dds.subscription.DataReader will replace the least-recently-updated instance satisfying that kind. An instance is considered 'updated' when a valid sample or dispose sample is received and accepted for that instance. When using com.rti.dds.infrastructure.OwnershipQosPolicyKind.EXCLUSIVE_OWNERSHIP_QOS, only samples that are received from the owner of the instance will cause the instance to be considered updated. An instance is not considered updated when an unregister sample is received because the unregister message simply indicates that there is one less writer that has updates for the instance, not that the instance itself was updated.

If no replaceable instance exists, the sample for the new instance will be considered lost with lost reason com.rti.dds.subscription.SampleLostStatusKind.LOST_BY_INSTANCES_LIMIT and the instance will not be asserted into the DataReader queue.

[default]

See also
com.rti.dds.infrastructure.DataReaderResourceLimitsInstanceReplacementSettings