DDS QoS - PRESENTATION

https://download.csdn.net/download/eidolon_foot/12568768

6. PRESENTATION

OpenDDS:

The PRESENTATION QoS policy controls how changes to instances by publishers are presented to data readers. It affects the relative ordering of these changes and the scope of this ordering. Additionally, this policy introduces the concept of coherent change sets. Here is the IDL for the Presentation QoS:

表示QoS策略控制如何将发布者对实例所做的更改呈现给数据读取器。它会影响这些更改的相对顺序和顺序的范围。此外,此策略引入了一致性变更集的概念。以下是演示QoS的IDL:

enum PresentationQosPolicyAccessScopeKind {
INSTANCE_PRESENTATION_QOS,
TOPIC_PRESENTATION_QOS,
GROUP_PRESENTATION_QOS
};
struct PresentationQosPolicy {
PresentationQosPolicyAccessScopeKind access_scope;
boolean coherent_access;
boolean ordered_access;
};
The scope of these changes (access_scope) specifies the level in which an application may be made aware:
这些更改的范围(access_scope)指定了应用程序可以感知的级别:
– INSTANCE_PRESENTATION_QOS (the default) indicates that changes occur to instances independently. Instance access essentially acts as a no-op with respect to coherent_access and ordered_access. Setting either of these values to true has no observable affect within the subscribing application.
–INSTANCE_PRESENTATION_QOS(默认值)表示实例的更改是独立发生的。实例访问本质上是对一致性访问和有序访问的no-op。将这些值设置为true在订阅应用程序中没有明显的影响。
– TOPIC_PRESENTATION_QOS indicates that accepted changes are limited to all instances within the same data reader or data writer.
–TOPIC_PRESENTATION_QOS表示接受的更改仅限于同一数据读取器或数据写入器中的所有实例。
– GROUP_PRESENTATION_QOS indicates that accepted changes are limited to all instances within the same publisher or subscriber.
–GROUP_PRESENTATION_QOS表示接受的更改仅限于同一发布服务器或订阅服务器内的所有实例。
Coherent changes (coherent_access) allow one or more changes to an instance be made available to an associated data reader as a single change. If a data reader does not receive the entire set of coherent changes made by a publisher, then none of the changes are made available. The semantics of coherent changes are similar in nature to those found in transactions provided by many relational databases. By default, coherent_access is false.
一致的变更(一致的存取)允许一个实例的一个或多个变更作为单一变更提供给相关的资料阅读器。如果数据读取器没有接收到发布者所做的全部一致更改,则所有更改都不可用。一致变化的语义本质上与许多关系数据库提供的事务中的语义相似。默认情况下,consistent_access为false。
Changes may also be made available to associated data readers in the order sent by the publisher (ordered_access). This is similar in nature to the DESTINATION_ORDER QoS policy,however ordered_access permits data to be ordered independently of instance ordering. By default, ordered_access is false.
也可以按发布者发送的顺序(按顺序访问)向关联的数据读取器提供更改。这在本质上类似于目的地的顺序QoS策略,但是有序的访问允许数据独立于实例排序进行排序。默认情况下,有序访问为false。
Note
This policy controls the ordering and scope of samples made available to the subscriber, but the subscriber application must use the proper logic in reading samples to guarantee the requested behavior. For more details, see Section 2.2.2.5.1.9 of the Version 1.4 DDS Specification.
注意
此策略控制提供给订阅服务器的示例的顺序和范围,但是订阅服务器应用程序必须在读取示例时使用正确的逻辑来保证请求的行为。有关详细信息,请参阅1.4版DDS规范的第2.2.2.5.1.9节。
formal/2015-04-10:
This QoS policy controls the extent to which changes to data-instances can be made dependent on each other and also the kind of dependencies that can be propagated and maintained by the Service.
这种QoS策略控制对数据实例的更改可以相互依赖的程度,以及服务可以传播和维护的依赖类型。
The setting of coherent_access controls whether the Service will preserve the groupings of changes made by the publishing application by means of the operations begin_coherent_change and end_coherent_change.
coherent_access的设置控制服务是否通过begin_coherent_change和end_coherent_change操作来保存发布应用程序所做的更改分组。
The setting of ordered_access controls whether the Service will preserve the order of changes.
有序访问的设置控制服务是否保留更改顺序。
The granularity is controlled by the setting of the access_scope .
粒度由访问范围的设置控制。
If coherent_access is set, then the access_scope controls the maximum extent of coherent changes. The behavior is as follows:
如果设置了一致的访问,则访问范围控制一致更改的最大范围。其行为如下:
If access_scope is set to INSTANCE, the use of begin_coherent_change and end_coherent_change has no effect on
how the subscriber can access the data because with the scope limited to each instance, changes to separate instances
are considered independent and thus cannot be grouped by a coherent change.
•如果access_scope设置为INSTANCE,那么使用begin_coherent_change和end_coherent_change对订阅者访问数据的方式没有影响,因为作用域仅限于每个实例,对单独实例的更改被视为独立的,因此不能通过一致性更改进行分组。
If access_scope is set to TOPIC, then coherent changes (indicated by their enclosure within calls to begin_coherent_change and end_coherent_change ) will be made available as such to each remote DataReader independently. That is, changes made to instances within each individual DataWriter will be available as coherent with respect to other changes to instances in that same DataWriter , but will not be grouped with changes made to instances belonging to a different DataWriter .
•如果access_scope设置为TOPIC,则一致性更改(由其在begin_coherent_change和end_coherent_change的调用中的范围指示)将独立地提供给每个远程数据读取器。也就是说,对每个单独DataWriter中实例所做的更改将与对同一DataWriter中实例的其他更改一致,但不会与对属于不同DataWriter的实例所做的更改分组。
If access_scope is set to GROUP, then coherent changes made to instances through a DataWriter attached to a common
Publisher are made available as a unit to remote subscribers.
•如果access_scope设置为GROUP,则通过连接到commonPublisher的DataWriter对实例所做的一致更改作为一个单元提供给远程订阅者。
If ordered_access is set, then the access_scope controls the maximum extent for which order will be preserved by the Service.
如果设置了有序访问,则访问范围控制服务将为其保留顺序的最大范围。
If access_scope is set to INSTANCE (the lowest level), then changes to each instance are considered unordered relative to changes to any other instance. That means that changes (creations, deletions, modifications) made to two instances are not necessarily seen in the order they occur. This is the case even if it is the same application thread making the changes using the same DataWriter .
•如果access_scope设置为INSTANCE(最低级别),则相对于对任何其他实例的更改,对每个实例的更改都被视为无序的。这意味着对两个实例所做的更改(创建、删除、修改)不一定按发生的顺序来查看。即使是同一个应用程序线程使用同一个DataWriter进行更改,也是如此。
If access_scope is set to TOPIC, changes (creations, deletions, modifications) made by a single DataWriter are made available to subscribers in the same order they occur. Changes made to instances through different DataWriter entities are not necessarily seen in the order they occur. This is the case, even if the changes are made by a single application thread using DataWriter objects attached to the same Publisher .
•如果access_scope设置为TOPIC,则单个DataWriter所做的更改(创建、删除、修改)将以相同的顺序提供给订阅服务器。通过不同的DataWriter实体对实例所做的更改不一定按发生的顺序显示。即使更改是由单个应用程序线程使用附加到同一发布服务器的DataWriter对象进行的,也是如此。
Finally, if access_scope is set to GROUP, changes made to instances via DataWriter entities attached to the same Publisher object are made available to subscribers on the same order they occur.
•最后,如果access_scope设置为GROUP,则通过附加到同一Publisher对象的DataWriter实体对实例所做的更改将以发生的相同顺序提供给订阅服务器。
Note that this QoS policy controls the scope at which related changes are made available to the subscriber. This means the subscriber can access the changes in a coherent manner and in the proper order; however, it does not necessarily imply that the Subscriber will indeed access the changes in the correct order. For that to occur, the application at the subscriber end must use the proper logic in reading the DataReader objects, as described in 2.2.2.5.1, Access to the data.
请注意,此QoS策略控制向订阅服务器提供相关更改的范围。这意味着订阅者可以以一致的方式以适当的顺序访问更改;但是,并不一定意味着订阅者确实会以正确的顺序访问更改。为了实现这一点,订阅服务器端的应用程序必须使用正确的逻辑来读取DataReader对象,如2.2.2.5.1“数据访问”所述。
The value offered is considered compatible with the value requested if and only if the following conditions are met:
当且仅当满足以下条件时,所提供的值才被视为与请求值兼容:
1 The inequality “offered access_scope >= requested access_scope ” evaluates to ‘TRUE.’ For the purposes of this inequality, the values of PRESENTATION access_scope are considered ordered such that INSTANCE < TOPIC < GROUP.
1 不等式“provided access_scope>=required access_scope”的计算结果为“TRUE”。出于该不等式的目的,PRESENTATION access_scope的值被认为是有序的,因此INSTANCE<TOPIC<GROUP。
2 Requested coherent_access is FALSE, or else both offered and requested coherent_access are TRUE.
2 请求的一致性访问为FALSE,否则提供的和请求的一致性访问都为TRUE。
3 Requested ordered_access is FALSE, or else both offered and requested ordered _access are TRUE.
3 请求的有序访问为FALSE,否则提供的和请求的有序访问都为TRUE。

用ChatGPT

《OpenDDS Developer's Guide》:

这段文字是关于OpenDDS开发者指南中的PRESENTATION服务质量(Quality of Service, QoS)策略部分内容。PRESENTATION QoS策略控制发布者(publishers)对实例更改的呈现方式,以及向数据读取器(data readers)提供这些更改的相对顺序和这些顺序的范围。此外,该策略引入了一致性变更集的概念。
下面是PRESENTATION QoS相关IDL定义及简要翻译和解释:

enum PresentationQosPolicyAccessScopeKind {
  INSTANCE_PRESENTATION_QOS,
  TOPIC_PRESENTATION_QOS,
  GROUP_PRESENTATION_QOS
};

struct PresentationQosPolicy {
  PresentationQosPolicyAccessScopeKind access_scope;
  boolean coherent_access;
  boolean ordered_access;
};

访问范围(access_scope)指出应用程序可以认识到的变更级别:
- INSTANCE_PRESENTATION_QOS(默认值)表示各个实例的更改是独立进行的。在订阅者应用程序中,实例访问基本上在coherent_access和ordered_access方面没有作用。将这些值中的任何一个设置为true,在订阅应用程序中是不会有可观察的影响的。
- TOPIC_PRESENTATION_QOS表示接受的更改限于同一数据读取器或数据写入器内的所有实例。
- GROUP_PRESENTATION_QOS表示接受的更改限于同一发布者(publisher)或订阅者(subscriber)内的所有实例。
一致性变更(coherent_access)允许对实例的一个或多个更改作为单一更改提供给关联的数据读取器。如果数据读取器没有接收到发布者所做的全部一致性变更集,则这些变更都不会被提供给数据读取器。一致性变更的语义与许多关系型数据库提供的事务类似。默认情况下,coherent_access为false。
更改还可以按照发布者发送的顺序提供给关联的数据读取器(ordered_access)。这类似于DESTINATION_ORDER QoS策略的本质,然而ordered_access允许数据独立于实例排序进行排序。默认情况下,ordered_access为false。
注意:该策略控制了样本对订阅者可用的顺序和范围,但是订阅者应用程序必须使用适当的逻辑来读取样本以保证请求的行为。更多细节,请参考DDS规范版本1.4的第2.2.2.5.1.9节。

《Data Distribution Service (DDS)》Version 1.4 :

这段文字是从《Data Distribution Service (DDS)》版本1.4的官方文件中提取出来的,主要讲述了DDS系统中的一种QoS(Quality of Service,服务质量)策略,即展示(Presentation)QoS策略。下面,用中文进行翻译并详细解释它的含义。
展示QoS策略控制数据实例之间依赖关系的程度以及这些依赖关系如何被服务保持和传播。
- coherent_access 设置控制服务是否保持发布应用程序通过`begin_coherent_change`和`end_coherent_change`操作所做的更改分组。
- ordered_access 设置控制服务是否保持更改顺序。
- access_scope 设置控制这些细粒度。
如果设置了`coherent_access`,那么`access_scope`设置就决定了保持一致性的最大范围。行为如下:
- 如果`access_scope`设置为`INSTANCE`(实例级别),那么`begin_coherent_change`和`end_coherent_change`的使用对订阅者如何访问数据没有影响,因为范围限制为每个实例,不同实例的更改被认为是独立的,因此无法被认为是一致的更改。
- 如果`access_scope`设置为`TOPIC`(主题级别),那么一致的更改会按照它们被包围在`begin_coherent_change`和`end_coherent_change`调用中的方式被独立地提供给每个远程DataReader。即,每个单独DataWriter内实例的更改将与该DataWriter内其他实例的更改保持一致,但不与属于不同DataWriter的实例的更改分组。
- 如果`access_scope`设置为`GROUP`(组级别),则通过附加到共同Publisher的DataWriter所做的对实例的一致更改将作为一个单元提供给远程订阅者。
如果设置了`ordered_access`,那么`access_scope`设置将控制服务保存顺序的最大范围:
- 如果`access_scope`设置为`INSTANCE`,那么对每个实例的更改被认为是无序的,相对于对任何其他实例的更改。这意味着对两个实例的更改(创建、删除、修改)不一定按照它们发生的顺序被看到。即使是同一个应用程序线程使用同一个DataWriter进行更改也是如此。
- 如果`access_scope`设置为`TOPIC`,由单个DataWriter所做的更改(创建、删除、修改)将按照它们发生的顺序提供给订阅者。通过不同DataWriter实体对实例所做的更改不一定按照它们发生的顺序被看到。即使更改是由一个应用程序线程使用附加到同一个Publisher上的DataWriter对象所做的,也是如此。
- 最后,如果`access_scope`设置为`GROUP`,那么通过附加到同一个Publisher对象上的DataWriter实体对实例所做的更改将按照它们发生的顺序提供给订阅者。
请注意,这种QoS策略控制了与订阅者相关的更改在何种范围内可以获得。这意味着订阅者可以以一致的方式按正确的顺序访问这些更改;然而,这并不意味着订阅者确实按照正确的顺序访问了这些更改。为了实现这一点,订阅者端的应用程序必须使用适当的逻辑读取DataReader对象,如2.2.2.5.1节“数据访问”中所描述。
提供的值仅当满足以下条件时,才与请求的值兼容:
1. 不等式“offered access_scope >= requested access_scope”得出结果为'TRUE'。对于这个不等式,PRESENTATION access_scope的值认为是有顺序的,即INSTANCE < TOPIC < GROUP。
2. 请求的`coherent_access`为FALSE,或者提供和请求的`coherent_access`都为TRUE。
3. 请求的`ordered_access`为FALSE,或者提供和请求的`ordered_access`都为TRUE。
通过上述解释和翻译,我们可以看到,DDS展示QoS策略主要用于控制数据实例更改的依赖关系和顺序,以及如何在不同的实例、主题和组间保持一致性和顺序。这对于确保分布式系统中的数据一致性以及高效和可靠的信息分发至关重要。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

109702008

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值