Source: ZettaScale Technology ( Erik Hendriks)
When using a GROUP ordered Subscriber, how do you access the samples in the order in which they are produced? The DDS1.4 specification says the following thing about this:.
"If the PRESENTATION QosPolicy of the Subscriber to which the DataReader belongs has the access_scope set to ‘GROUP.’ This operation should only be invoked inside a begin_access/end_access block. Otherwise it will return the error PRECONDITION_NOT_MET. Depending on the setting of the PRESENTATION QoS policy (see 188.8.131.52), the returned collection of DataReader objects may be a ‘set’ containing each DataReader at most once in no specified order, or a ‘list’ containing each DataReader one or more times in a specific order.
- If PRESENTATION access_scope is INSTANCE or TOPIC the returned collection is a ‘set.’
- If PRESENTATION access_scope is GROUP and ordered_access is set to TRUE, then the returned collection is a ‘list.’
This difference is due to the fact that, in the second situation it is required to access samples belonging to different DataReader objects in a particular order. In this case, the application should process each DataReader in the same order it appears in the ‘list’ and read or take exactly one sample from each DataReader. The patterns that an application should use to access data is fully described in 184.108.40.206.1, Access to the data."
The big question here is: what happens when the user does not follow this scenario exactly? Here is a couple of potential deviations from the described scenario:
- Reading more than one sample from every listed reader (i.e. use read/take with max_samples > 1)
- We could state that no matter what the size of max_samples is, you get one sample at max.
- Reading/Taking samples with different sample/view/instance state masks than passed to the get_datareaders() call.
- Reading/Taking samples from a different reader than next one in the reader list.
- you invoke get_datareaders() before having fully iterated through the previous reader list.
We should specify what happens if an application (intentionally or non-intentionally) does not follow the scenario laid out in the spec, or we should come up with an alternative reading mechanism that does not allow you stray off the correct path in these ways for example by introducing new function calls.
Reported: DDS 1.4 — Fri, 6 Jul 2018 19:34 GMT
Updated: Fri, 6 Jul 2018 19:34 GMT