RTI Connext .Net APIs  Version 5.2.0
 All Classes Namespaces Functions Variables Enumerations Properties Groups Pages
DDS::OwnershipQosPolicy Struct Reference

Specifies whether it is allowed for multiple DDS::DataWriter (s) to write the same instance of the data and if so, how these modifications should be arbitrated. More...

#include <managed_infrastructure.h>

Static Public Member Functions

static System::String^ get_ownership_qos_policy_name ()
 Stringified human-readable name for DDS::OwnershipQosPolicy.
 

Public Attributes

OwnershipQosPolicyKind kind
 The kind of ownership.
 

Detailed Description

Specifies whether it is allowed for multiple DDS::DataWriter (s) to write the same instance of the data and if so, how these modifications should be arbitrated.

Entity:
DDS::Topic, DDS::DataReader, DDS::DataWriter
Status:
::DDS::StatusKind::OFFERED_INCOMPATIBLE_QOS_STATUS, ::DDS::StatusKind::REQUESTED_INCOMPATIBLE_QOS_STATUS
Properties:
RxO = YES
Changeable = UNTIL ENABLE
See Also
OWNERSHIP_STRENGTH

Usage

Along with the OWNERSHIP_STRENGTH, this QoS policy specifies if DDS::DataReader entities can receive updates to the same instance (identified by its key) from multiple DDS::DataWriter entities at the same time.

There are two kinds of ownership, selected by the setting of the kind: SHARED and EXCLUSIVE.

SHARED ownership

::DDS::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 DDS::Topic will be able to access modifications from all DDS::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 DDS::DataWriter that causes the modification.

EXCLUSIVE ownership

::DDS::OwnershipQosPolicyKind::EXCLUSIVE_OWNERSHIP_QOS indicates that each instance of a data type can only be modified by one DDS::DataWriter. In other words, at any point in time, a single DDS::DataWriter owns each instance and is the only one whose modifications will be visible to the DDS::DataReader objects. The owner is determined by selecting the DDS::DataWriter with the highest value of the DDS::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:

  • a DDS::DataWriter in the system with a higher value of the strength that modifies the instance,
  • a change in the strength value of the DDS::DataWriter that owns the instance, and
  • a change in the liveliness of the DDS::DataWriter that owns the instance.
  • a deadline with regards to the instance that is missed by the DDS::DataWriter that owns the instance.

The behavior of the system is as if the determination was made independently by each DDS::DataReader. Each DDS::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 DDS::DataReader objects for that DDS::Topic have a consistent picture of who owns each instance.

It is also not a requirement that the DDS::DataWriter objects are aware of whether they own a particular instance. There is no error or notification given to a DDS::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 DDS::DataWriter objects with the same strength modify the same instance. If this occurs RTI Connext will pick one of the DDS::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 DDS::DataReader objects will make the same choice of the particular DDS::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 DDS::DataWriter with higher same strength, or a new DDS::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 DDS::DataWriter as long as they affect instances whose values have not been set by the higher-strength DDS::DataWriter.

Compatibility

The value of the ::DDS::OwnershipQosPolicyKind offered must exactly match the one requested or else they are considered incompatible.

Relationship between registration, liveliness and ownership \endif <P> The need for registering/unregistering instances stems from two use cases: \li Ownership resolution on redundant systems <P> \li Detection of loss in topological connectivity <P> These two use cases also illustrate the semantic differences between the ::DDS::TypedDataWriter::unregister_instance and ::DDS::TypedDataWriter::dispose. <P> \ifnot BROKEN_SECTIONS @subsection Ownership_redundant_systems Ownership Resolution on Redundant Systems

It is expected that users may use DDS to set up redundant systems where multiple DDS::DataWriter entities are "capable" of writing the same instance. In this situation, the DDS::DataWriter entities are configured such that:

  • Either both are writing the instance "constantly"
  • Or else they use some mechanism to classify each other as "primary" and "secondary", such that the primary is the only one writing, and the secondary monitors the primary and only writes when it detects that the primary "writer" is no longer writing.

Both cases above use the ::DDS::OwnershipQosPolicyKind::EXCLUSIVE_OWNERSHIP_QOS and arbitrate themselves by means of the DDS::OwnershipStrengthQosPolicy. Regardless of the scheme, the desired behavior from the DDS::DataReader point of view is that DDS::DataReader normally receives data from the primary unless the "primary" writer stops writing, in which case the DDS::DataReader starts to receive data from the secondary DDS::DataWriter.

This approach requires some mechanism to detect that a DDS::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):

  • [crash] The writing process is no longer running (e.g. the whole application has crashed)
  • [connectivity loss] Connectivity to the writing application has been lost (e.g. network disconnection)

Arbitrating from a DDS::DataWriter to one of a higher strength is simple and the decision can be taken autonomously by the DDS::DataReader. Switching ownership from a higher strength DDS::DataWriter to one of a lower strength DDS::DataWriter requires that the DDS::DataReader can make a determination that the stronger DDS::DataWriter is "no longer writing the instance".

Member Data Documentation

OwnershipQosPolicyKind DDS::OwnershipQosPolicy::kind

The kind of ownership.

[default] ::DDS::OwnershipQosPolicyKind::SHARED_OWNERSHIP_QOS


RTI Connext .Net APIs Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc