RTI Connext Java API
Version 5.2.0
|
Specifies whether it is allowed for multiple com.rti.dds.publication.DataWriter (s) to write the same instance of the data and if so, how these modifications should be arbitrated. More...
Public Attributes | |
OwnershipQosPolicyKind | kind |
The kind of ownership. | |
Public Attributes inherited from QosPolicy | |
final QosPolicyId_t | id |
The ID of this QoS policy. | |
final String | policy_name |
The name of this QoS policy. | |
Additional Inherited Members | |
Public Member Functions inherited from Struct | |
abstract boolean | equals (Object obj) |
abstract int | hashCode () |
String | toString () |
Protected Member Functions inherited from Struct | |
Struct () | |
abstract void | pull_from_nativeI (long native_status) |
abstract void | push_to_nativeI (long native_status) |
Specifies whether it is allowed for multiple com.rti.dds.publication.DataWriter (s) to write the same instance of the data and if so, how these modifications should be arbitrated.
Along with the OWNERSHIP_STRENGTH, this QoS policy specifies if com.rti.dds.subscription.DataReader entities can receive updates to the same instance (identified by its key) from multiple com.rti.dds.publication.DataWriter entities at the same time.
There are two kinds of ownership, selected by the setting of the kind:
SHARED and EXCLUSIVE.
com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.SHARED_OWNERSHIP_QOS indicates that RTI Connext does not enforce unique ownership for each instance. In this case, multiple writers can update the same data type instance. The subscriber to the com.rti.dds.topic.Topic will be able to access modifications from all com.rti.dds.publication.DataWriter objects, subject to the settings of other QoS that may filter particular samples (e.g. the TIME_BASED_FILTER or HISTORY policy). In any case, there is no "filtering" of modifications made based on the identity of the com.rti.dds.publication.DataWriter that causes the modification.
com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.EXCLUSIVE_OWNERSHIP_QOS indicates that each instance of a data type can only be modified by one com.rti.dds.publication.DataWriter. In other words, at any point in time, a single com.rti.dds.publication.DataWriter owns each instance and is the only one whose modifications will be visible to the com.rti.dds.subscription.DataReader objects. The owner is determined by selecting the com.rti.dds.publication.DataWriter with the highest value of the com.rti.dds.infrastructure.OwnershipStrengthQosPolicy.value that is currently alive, as defined by the LIVELINESS policy, and has not violated its DEADLINE contract with regards to the data instance.
Ownership can therefore change as a result of:
The behavior of the system is as if the determination was made independently by each com.rti.dds.subscription.DataReader. Each com.rti.dds.subscription.DataReader may detect the change of ownership at a different time. It is not a requirement that at a particular point in time all the com.rti.dds.subscription.DataReader objects for that com.rti.dds.topic.Topic have a consistent picture of who owns each instance.
It is also not a requirement that the com.rti.dds.publication.DataWriter objects are aware of whether they own a particular instance. There is no error or notification given to a com.rti.dds.publication.DataWriter that modifies an instance it does not currently own.
The requirements are chosen to (a) preserve the decoupling of publishers and subscriber, and (b) allow the policy to be implemented efficiently.
It is possible that multiple com.rti.dds.publication.DataWriter objects with the same strength modify the same instance. If this occurs RTI Connext will pick one of the com.rti.dds.publication.DataWriter objects as the owner. It is not specified how the owner is selected. However, the algorithm used to select the owner guarantees that all com.rti.dds.subscription.DataReader objects will make the same choice of the particular com.rti.dds.publication.DataWriter that is the owner. It also guarantees that the owner remains the same until there is a change in strength, liveliness, the owner misses a deadline on the instance, or a new com.rti.dds.publication.DataWriter with higher same strength, or a new com.rti.dds.publication.DataWriter with same strength that should be deemed the owner according to the policy of the Service, modifies the instance.
Exclusive ownership is on an instance-by-instance basis. That is, a subscriber can receive values written by a lower strength com.rti.dds.publication.DataWriter as long as they affect instances whose values have not been set by the higher-strength com.rti.dds.publication.DataWriter.
The value of the com.rti.dds.infrastructure.OwnershipQosPolicyKind offered must exactly match the one requested or else they are considered incompatible.
It is expected that users may use DDS to set up redundant systems where multiple com.rti.dds.publication.DataWriter entities are "capable" of writing the same instance. In this situation, the com.rti.dds.publication.DataWriter entities are configured such that:
Both cases above use the com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.EXCLUSIVE_OWNERSHIP_QOS and arbitrate themselves by means of the com.rti.dds.infrastructure.OwnershipStrengthQosPolicy. Regardless of the scheme, the desired behavior from the com.rti.dds.subscription.DataReader point of view is that com.rti.dds.subscription.DataReader normally receives data from the primary unless the "primary" writer stops writing, in which case the com.rti.dds.subscription.DataReader starts to receive data from the secondary com.rti.dds.publication.DataWriter.
This approach requires some mechanism to detect that a com.rti.dds.publication.DataWriter (the primary) is no longer "writing" the data as it should. There are several reasons why this may happen and all must be detected (but not necessarily distinguished):
Arbitrating from a com.rti.dds.publication.DataWriter to one of a higher strength is simple and the decision can be taken autonomously by the com.rti.dds.subscription.DataReader. Switching ownership from a higher strength com.rti.dds.publication.DataWriter to one of a lower strength com.rti.dds.publication.DataWriter requires that the com.rti.dds.subscription.DataReader can make a determination that the stronger com.rti.dds.publication.DataWriter is "no longer writing the instance".
The kind of ownership.
[default] com.rti.dds.infrastructure.OwnershipQosPolicyKind.OwnershipQosPolicyKind.SHARED_OWNERSHIP_QOS