21.2 Durability and Persistence Based on Virtual GUIDs
Every modification to the global dataspace made by a DataWriter is identified by a pair (virtual GUID, sequence number).
- The virtual GUID (Global Unique Identifier) is a 16-byte character identifier associated with a DataWriter or DataReader; it is used to uniquely identify this entity in the global data space.
- The sequence number is a 64-bit identifier that identifies changes published by a specific DataWriter.
Several DataWriters can be configured with the same virtual GUID. If each of these DataWriters publishes a sample with sequence number '0', the sample will only be received once by the DataReaders subscribing to the content published by the DataWriters (see Figure 21.4: Global Dataspace Changes).
Figure 21.4: Global Dataspace Changes
Additionally, Connext uses the virtual GUID to associate a persisted state (state in permanent storage) to the corresponding Entity.
For example, the history of a DataWriter will be persisted in a database table with a name generated from the virtual GUID of the DataWriter. If the DataWriter is restarted, it must have associated the same virtual GUID to restore its previous history.
Likewise, the state of a DataReader will be persisted in a database table whose name is generated from the DataReader virtual GUID (see Figure 21.5: History/State Persistence Based on Virtual GUID).
Figure 21.5: History/State Persistence Based on Virtual GUID
- A DataWriter’s virtual GUID can be configured using the member virtual_guid in the 47.5 DATA_WRITER_PROTOCOL QosPolicy (DDS Extension).
- A DataReader’s virtual GUID can be configured using the member virtual_guid in the 48.1 DATA_READER_PROTOCOL QosPolicy (DDS Extension).
The DDS_PublicationBuiltinTopicData and DDS_SubscriptionBuiltinTopicData structures include the virtual GUID associated with the discovered publication or subscription (see 28.2 Built-in DataReaders).