https://download.csdn.net/download/eidolon_foot/12568768
21. WRITER_DATA_LIFECYCLE
OpenDDS Developer's Guide(OpenDDS Version 3.14)
The
WRITER_DATA_LIFECYCLE
QoS policy controls the lifecycle of data instances managed by
a data writer. Here is the IDL for the Writer Data Lifecycle QoS policy:
WRITER DATA LIFECYCLE QoS策略控制由数据写入器管理的数据实例的生命周期。 下面是Writer数据生命周期QoS策略的IDL:
struct WriterDataLifecycleQosPolicy {
boolean autodispose_unregistered_instances;
};
When
autodispose_unregistered_instances
is set to
true
(the default), a data writer
disposes an instance when it is unregistered. In some cases, it may be desirable to prevent
an instance from being disposed when an instance is unregistered. This policy could, for
example, allow an
EXCLUSIVE
data writer to gracefully defer to the next data writer without
affecting the instance state. Deleting a data writer implicitly unregisters all of its instances
prior to deletion.
当autodispose_unregistered_instances设置为true(默认值)时,数据写入器在取消注册实例时将其处置。 在某些情况下,可能希望防止在未注册实例时处置该实例。 例如,此策略可以允许EXCLUSIVE数据写入器从容地推迟到下一个数据写入器,而不会影响实例状态。 删除数据写入器会在删除之前隐式注销其所有实例。
Data Distribution Service Version 1.4( formal/2015-04-10)
This policy controls the behavior of the
DataWriter
with regards to the lifecycle of the data-instances it manages, that is, the
data-instances that have been either explicitly registered with the
DataWriter
using the
register
operations (see 2.2.2.4.2.5 and
2.2.2.4.2.6) or implicitly by directly writing the data (see 2.2.2.4.2.11 and 2.2.2.4.2.12).
就其管理的数据实例的生命周期而言,此策略控制DataWriter的行为,也就是说,该数据实例已使用注册操作明确地注册到了DataWriter中(请参见2.2.2.4.2.5和
2.2.2.4.2.6)或直接写入数据隐式(请参见2.2.2.4.2.11和2.2.2.4.2.12)。
The
autodispose_unregistered_instances
flag controls the behavior when the
DataWriter
unregisters an instance by means of
the
unregister
operations (see 2.2.2.4.2.7 and 2.2.2.4.2.8):
当DataWriter通过注销操作注销实例时,autodispose_unregistered_instances标志控制行为(请参见2.2.2.4.2.7和2.2.2.4.2.8):
•
The setting ‘
autodispose_unregistered_instances
= TRUE’ causes the
DataWriter
to dispose the instance each time it
is unregistered. The behavior is identical to explicitly calling one of the
dispose
operations (2.2.2.4.2.13 and
2.2.2.4.2.14) on the instance prior to calling the
unregister
operation.
•设置“ autodispose_unregistered_instances = TRUE”会使DataWriter每次取消注册实例时都对其进行处置。 该行为与在调用取消注册操作之前在实例上显式调用处置操作之一(2.2.2.4.2.13和2.2.2.4.2.14)相同。
•
The setting ‘
autodispose_unregistered_instances
= FALSE’ will not cause this automatic disposition upon
unregistering. The application can still call one of the
dispose
operations prior to unregistering the instance and
accomplish the same effect. Refer to 2.2.3.23.3 for a description of the consequences of disposing and unregistering
instances.
•设置“ autodispose_unregistered_instances = FALSE”将不会导致注销后自动处理。 在注销实例之前,应用程序仍可以调用处理操作之一,并达到相同的效果。 有关处置和注销实例的后果的描述,请参见2.2.3.23.3。
Note that the deletion of a
DataWriter
automatically unregisters all data-instances it manages (2.2.2.4.1.6). Therefore the
setting of the
autodispose_unregistered_instances
flag will determine whether instances are ultimately disposed when the
DataWriter
is deleted either directly by means of the
Publisher::delete_datawriter
operation or indirectly as a consequence of
calling
delete_contained_entities
on the
Publisher
or the
DomainParticipant
that contains the
DataWriter
.
请注意,删除DataWriter会自动注销其管理的所有数据实例(2.2.2.4.1.6)。 因此,autodispose_unregistered_instances标志的设置将确定在直接通过Publisher::delete_datawriter操作删除DataWriter时,还是由于在发布者或包含DataWriter的DomainParticipant上调用delete_contained_entities而间接删除DataWriter时,是否最终处置了实例。
22. READER_DATA_LIFECYCLE
OpenDDS Developer's Guide(OpenDDS Version 3.14)
The
READER_DATA_LIFECYCLE
QoS policy controls the lifecycle of data instances managed by
a data reader. Here is the IDL for the Reader Data Lifecycle QoS policy:
READER DATA LIFECYCLE QoS策略控制由数据读取器管理的数据实例的生命周期。 这是读取器数据生命周期QoS策略的IDL:
struct ReaderDataLifecycleQosPolicy {
Duration_t autopurge_nowriter_samples_delay;
Duration_t autopurge_disposed_samples_delay;
};
Normally, a data reader maintains data for all instances until there are no more associated
data writers for the instance, the instance has been disposed, or the data has been taken by
the user.
通常,数据读取器将为所有实例维护数据,直到该实例不再有关联的数据写入器,该实例已被处置或该数据已由用户获取为止。
In some cases, it may be desirable to constrain the reclamation of these resources. This
policy could, for example, permit a late-joining data writer to prolong the lifetime of an
instance in fail-over situations.
在某些情况下,可能希望限制这些资源的回收。 例如,此策略可以允许后期加入的数据编写器在故障转移情况下延长实例的生命周期。
The
autopurge_nowriter_samples_delay
controls how long the data reader waits before
reclaiming resources once an instance transitions to the
NOT_ALIVE_NO_WRITERS
state. By
default,
autopurge_nowriter_samples_delay
is infinite.
一旦实例转换为NOT_ALIVE_NO_WRITERS状态,autopurge_nowriter_samples_delay控制数据读取器在回收资源之前等待多长时间。 默认情况下,autopurge_nowriter_samples_delay是无限的。
The
autopurge_disposed_samples_delay
controls how long the data reader waits before
reclaiming resources once an instance transitions to the
NOT_ALIVE_DISPOSED
state. By
default,
autopurge_disposed_samples_delay
is infinite.
一旦实例转换为NOT_ALIVE_DISPOSED状态,autopurge_disposed_samples_delay控制数据读取器在回收资源之前等待多长时间。 默认情况下,autopurge_disposed_samples_delay是无限的。
Data Distribution Service Version 1.4( formal/2015-04-10)
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.
该策略根据其管理的数据实例的生命周期来控制DataReader的行为,即该数据实例已接收并且DataReader为其维护一些内部资源的数据实例。
The
DataReader
internally maintains the samples that have not been taken by the application, subject to the constraints
imposed by other QoS policies such as HISTORY and RESOURCE_LIMITS.
根据其他QoS策略(例如“历史记录”和“资源限制”)施加的约束,DataReader在内部维护应用程序尚未获取的样本。
The
DataReader
also maintains information regarding the identity,
view_state
and
instance_state
of data-instances even after
all samples have been ‘taken.’ This is needed to properly compute the states when future samples arrive.
即使已经“采集”了所有样本,DataReader也会维护有关数据实例的身份,view_state和instance_state的信息。这是在以后的样本到达时正确计算状态所必需的。
Under normal circumstances the
DataReader
can only reclaim all resources for instances for which there are no writers and for
which all samples have been ‘taken.’ The last sample the
DataReader
will have taken for that instance will have an
instance_state
of either NOT_ALIVE_NO_WRITERS or NOT_ALIVE_DISPOSED depending on whether the last writer
that had ownership of the instance disposed it or not. Refer to Figure 2.11for a statechart describing the transitions possible for
the
instance_state
. In the absence of the READER_DATA_LIFECYCLE QoS this behavior could cause problems if the
application “forgets” to ‘take’ those samples. The ‘untaken’ samples will prevent the
DataReader
from reclaiming the
resources and they would remain in the
DataReader indefinitely.
在正常情况下,DataReader只能回收没有写程序且已“获取”所有样本的实例的所有资源。DataReader对该实例获取的最后一个样本的instance_state的NOT_ALIVE_NO_WRITERS或NOT_ALIVE_DISPOSED取决于 关于最后拥有实例所有权的作者是否将其处置。 关于状态图,请参见图2.11,该状态图描述了instance_state可能的转换。 在没有READER_DATA_LIFECYCLE QoS的情况下,如果应用程序“忘记”“采集”这些样本,则此行为可能会导致问题。 “未使用”样本将阻止DataReader回收资源,并且它们将无限期保留在DataReader中。
The
autopurge_nowriter_samples_delay
defines the maximum 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 samples will also be lost.
autopurge_nowriter_samples_delay定义了当实例的状态变为NOT_ALIVE_NO_WRITERS后,DataReader会维持有关该实例的信息的最大持续时间。 经过这段时间后,DataReader将清除有关实例的所有内部信息,所有未获取的样本也将丢失。
The
autopurge_disposed_samples_delay
defines the maximum duration for which the
DataReader
will maintain samples for
an instance once its
instance_state
becomes NOT_ALIVE_DISPOSED. After this time elapses, the
DataReader
will purge all
samples for the instance.
autopurge_disposed_samples_delay定义当实例的状态变为NOT_ALIVE_DISPOSED时,DataReader为其维护样本的最大持续时间。 经过这段时间后,DataReader将清除该实例的所有样本。