This policy controls the behavior of the DataReader with regards to the lifecycle of the data instances it manages, that is, the data instances that have been received and for which the DataReader maintains some internal resources.
When a DataReader receives data, it is stored in a receive queue for the DataReader. The user application may either take the data from the queue or leave it there. This QoS controls whether or not Connext DDS will automatically remove data from the receive queue (so that user applications cannot access it afterwards) when Connext DDS detects that there are no more DataWriters alive for that data.
DataWriters may also call dispose() on its data, informing DataReaders that the data no longer exists. This QosPolicy also controls whether or not Connext DDS automatically removes disposed data from the receive queue.
For keyed Topics, the consideration of removing DDS data samples from the receive queue is done on a per instance (key) basis. Thus when Connext DDS detects that there are no longer DataWriters alive for a certain key value for a Topic (an instance of the Topic), it can be configured to remove all DDS data samples for a certain instance (key). DataWriters also can dispose its data on a per instance basis. Only the DDS data samples of disposed instances would be removed by Connext DDS if so configured.
This policy helps purge untaken DDS samples from not-alive-instances and thus may prevent a DataReader from reclaiming resources. With this policy, the untaken DDS samples from not-alive-instances are purged and treated as if the DDS samples were taken after the specified amount of time.
The DataReader internally maintains the DDS samples that have not been taken by the application, subject to the constraints imposed by other QoS policies such as HISTORY QosPolicy and RESOURCE_LIMITS QosPolicy.
The DataReader also maintains information regarding the identity, view-state, and instance-state of data instances, even after all DDS samples have been ‘taken’ (see Accessing DDS Data Samples with Read or Take). This is needed to properly compute the states when future DDS samples arrive.
Under normal circumstances, a DataReader can only reclaim all resources for instances for which there are no DataWriters and for which all DDS samples have been ‘taken.’ The last DDS sample taken by the DataReader for that instance will have an instance state of NOT_ALIVE_NO_WRITERS or NOT_ALIVE_DISPOSED_INSTANCE (depending on whether or not the instance was disposed by the last DataWriter that owned it.) If you are using the default (infinite) values for this QosPolicy, this behavior can cause problems if the application does not ‘take’ those DDS samples for some reason. The ‘untaken’ DDS samples will prevent the DataReader from reclaiming the resources and they would remain in the DataReader indefinitely.
A DataReader can also reclaim all resources for instances that have an instance state of NOT_ALIVE_DISPOSED and for which all DDS samples have been 'taken'. DataReaders will only reclaim resources in this situation when autopurge_disposed_instances_delay has been set to zero.
It includes the members in DDS_ReaderDataLifecycleQosPolicy.
Type |
Field Name |
Description |
DDS_Duration_t |
autopurge_nowriter_ |
How long the DataReader maintains information about an instance once its instance_state becomes NOT_ALIVE_NO_WRITERS. |
DDS_Duration_t |
autopurge_disposed_ |
How long the DataReader maintains information about an instance once its instance_state becomes NOT_ALIVE_DISPOSED. |
DDS_Duration_t |
autopurge_disposed_instances_delay |
How long the DataReader maintains information about and instance once its instance_state becomes NOT_ALIVE_DISPOSED. (Note: only values of 0 or INFINITE are currently supported). |
autopurge_nowriter_samples_delay: This defines the minimum duration for which the DataReader will maintain information regarding an instance once its instance_state becomes NOT_ALIVE_NO_WRITERS. After this time elapses, the DataReader will purge all internal information regarding the instance, any untaken DDS samples will also be lost.
autopurge_disposed_samples_delay: This defines the minimum duration for which the DataReader will maintain DDS samples of an instance once its instance_state becomes NOT_ALIVE_DISPOSED. After this time elapses, the DataReader will purge all internal information regarding the instance; any untaken DDS samples will also be lost.
autopurge_disposed_instances_delay: This defines the minimum duration for which the DataReader will maintain DDS samples of an instance once its instance_state becomes NOT_ALIVE_DISPOSED. After this time elapses, the DataReader will purge all internal information regarding the instance.
This QoS policy can be modified after the DataReader is enabled.
It only applies to DataReaders, so there are no RxO restrictions for setting it compatibly on the DataWriter.
None.
© 2017 RTI