OpenSplice DDS enables seamless, timely, scalable and dependable data sharing between distributed applications and network-connected devices. Its technical and operational benefits have propelled adoption across multiple industries, such as Defence and Aerospace, SCADA, Gaming, Cloud Computing, Automotive, etc.
If you want to learn about OpenSplice DDS or discover some of its advanced features, this webcast is for you!
In this two-parts presentation we will cover most of the aspects tied to architecting and developing OpenSplice DDS systems. We will look into Quality of Services, data selectors concurrency and scalability concerns.
We will present the brand-new, and recently finalized, C++ and Java APIs for DDS, including examples of how this can be used with C++11 features. We will show how, increasingly popular, functional languages such as Scala can be used to efficiently and elegantly exploit the massive HW parallelism provided by modern multi-core processors.
Finally we will present some OpenSplice specific extensions for dealing very high-volumes of data – meaning several millions of messages per seconds.
3. Key Concepts to Remember
☐ OpenSplice DDS provides a mechanism for efficiently sharing user-
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
defined data among distributed applications and network
connected devices
OpenSplice DDS
Agricultural Vehicle Systems Large Scale SCADA Systems Smart Cities
Train Control Systems Complex Medical Devices Big Data (In-Memory) Analytics
4. Key Concepts to Remember
☐ OpenSplice DDS allows to build distributed systems by reasoning in
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
terms of application types as opposed to messages
OpenSplice DDS
TopicA
TopicE
...
TopicB
TopicD
TopicC
OpenSplice DDS Global Data Space
PS. long in IDL is a 32 bit integer
5. Key Concepts to Remember
☐ User defined data types are accessible through “local caches”.
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
These local caches can have a depth and store multiple updates
for the same data item
OpenSplice DDS
6. Key Concepts to Remember
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ Built-in dynamic discovery automatically establishes associations
between data writers and data readers
Data
Reader
Data
OpenSplice DDS
Writer
Data
Reader
Data TopicD
Writer
TopicA
Data
TopicB Reader
Data
Writer
TopicC
...
Data Data
Writer Reader
DDS Global Data Space
7. Anatomy of a DDS Application
[DDS C++ API 2010]
Domain
Domain
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
auto dp = DomainParticipant(domainId);
Participant
Session
// Create a Topic
Publisher
Topic
Subscriber
OpenSplice DDS
auto topic = Topic<ShapeType>(dp, “Circle”);
// Create a Publisher / Subscriber
auto pub = Publisher(dp);
auto sub = Subscriber(dp);
Reader/Writers for User Defined for Types DataWriter
DataReader
// Create a DataWriter/DataWriter
auto writer = DataWriter<ShapeType>(pub, topic); Reader/Writer for
auto reader = DataReader<ShapeType>(sub, topic);
application defined
Topic Types
8. Anatomy of a DDS Application
[DDS C++ API 2010]
Domain
Domain
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
auto
dp
=
DomainParticipant(domainId);
Participant
Session
//
Create
a
Topic
Publisher
Topic
Subscriber
OpenSplice DDS
auto
topic
=
Topic<ShapeType>(dp,
“Circle”);
//
Create
a
Publisher
/
Subscriber
auto
pub
=
Publisher(dp);
auto
sub
=
Subscriber(dp);
Reader/Writers for User Defined for Types DataWriter
DataReader
//
Write
data
writer.write(ShapeType(“RED”,
131,
107,
89)); Reader/Writer for
//
But
you
can
also
write
like
this... application defined
writer
<<
ShapeType(“RED”,
131,
107,
89);
Topic Types
//
Read
new
data
(loaned)
auto
data
=
reader.read();
9. Anatomy of a DDS Application
[DDS Java 5 API 2010]
Domain
Domain
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
DomainParticipantFactory
factory
=
DomainParticipantFactory.getInstance(env);
DomainParticipant
dp
=
factory.createParticipant(); Participant
Session
//
Create
a
Topic
Topic<ShapeType>
topic
=
Publisher
Topic
Subscriber
OpenSplice DDS
dp.createParticipant(“Circle”,
ShapeType.class);
//
Create
a
Publisher
/
Subscriber
Publisher
pub
=
dp.createPublisher();
Subscriber
sub
=
dp.createSubscriber();
Reader/Writers for User Defined for Types DataWriter
DataReader
//
Create
a
DataWriter/DataWriter
DataWriter<ShapeType>
dw
=pub.createDataWriter(topic);
Reader/Writer for
DataReader<ShapeType>
dr
=pub.createDataReader(topic);
application defined
Topic Types
10. Anatomy of a DDS Application
[DDS Java 5 API 2010]
Domain
Domain
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
DomainParticipantFactory
factory
=
DomainParticipantFactory.getInstance(env);
DomainParticipant
dp
=
factory.createParticipant(); Participant
Session
//
Create
a
Topic
Topic<ShapeType>
topic
=
Publisher
Topic
Subscriber
OpenSplice DDS
dp.createParticipant(“Circle”,
ShapeType.class);
//
Create
a
Publisher
/
Subscriber
Publisher
pub
=
dp.createPublisher();
Subscriber
sub
=
dp.createSubscriber();
Reader/Writers for User Defined for Types DataWriter
DataReader
//
write
data
dw.write(new
ShapeType(“RED”,
10,
20,
50);
Reader/Writer for
//
read
data application defined
Sample.Iterator<ShapeType>
data
=
dr.read();
Topic Types
13. QoS Model
☐ QoS-Policies control local and
end-to-end properties of DDS
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Type Matching
entities
QoS matching
QoS QoS QoS QoS QoS QoS QoS
☐ Local properties controlled by Topic
Name
QoS are related resource usage
Publisher Subscriber
... DataWriter writes Type reads DataReader
...
OpenSplice DDS
...
☐ End-to-end properties DomainParticipant DataWriter writes Type reads DataReader DomainParticipant
controlled by QoS are related Topic
Name
to temporal and spatial aspects QoS QoS QoS
of data distribution
☐ Some QoS-Policies are matched
based on a Request vs. Offered
Model thus QoS-enforcement
14. QoS Policies
[T: Topic] [DR: DataReader] [DW: DataWriter] [P: Publisher] [S: Subscriber] [DP: Domain Participant]
QoS Policy Applicability RxO Modifiable
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
USER_DATA DP, DR, DW N Y
TOPIC_DATA T N Y Configuration
GROUP_DATA P, S N Y
DURABILITY T, DR, DW Y N
OpenSplice DDS
DURABILITY T, DW N N
SERVICE Data Availability
HISTORY T, DR, DW N N
PRESENTATION P, S Y N
RELIABILITY T, DR, DW Y N
PARTITION P, S N Y
Data Delivery
DESTINATION T, DR, DW Y N
ORDER
LIFESPAN T, DW N Y
15. QoS Policies
[T: Topic] [DR: DataReader] [DW: DataWriter] [P: Publisher] [S: Subscriber] [DP: Domain Participant]
QoS Policy Applicability RxO Modifiable
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
DEADLINE T, DR, DW Y Y
LATENCY T, DR, DW Y Y
BUDGET Temporal/
TRANSPORT T, DW N Y Importance
PRIORITY Characteristics
OpenSplice DDS
TIME BASED DR N Y
FILTER
OWNERSHIP T, DR, DW Y N
OWNERSHIP DW N Y Replication
STRENGTH
LIVELINESS T, DR, DW Y N Fault-Detection
16. OpenSplice DDS
Partition
Data Delivery
Reliability
Presentation
Data Delivery
Order
Destination
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
17. Reliability QoS Policy
QoS Policy Applicability RxO Modifiable
RELIABILITY T, DR, DW Y N
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
The Reliability Policy controls the level of guarantee offered by
the DDS in delivering data to subscribers
☐ Reliable. In steady-state, and no data writer crashes, the
OpenSplice DDS
middleware guarantees that all samples in the DataWriter
history will eventually be delivered to all the DataReader
☐ Best Effort. Indicates that it is acceptable to not retry
propagation of any samples
18. Setting the Reliability Policy
[DDS C++ API 2010]
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
DataWriterQos
dwqos
=
pub.default_datawriter_qos()
<<
Reliability.Reliable();
OpenSplice DDS
-‐
or
-‐
DataWriterQos
dwqos
=
pub.default_datawriter_qos()
<<
Reliability.BestEffort();
19. Setting the Partition Policy
[DDS Java 5 API 2010]
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
final
PolicyFactory
pf
=
...
DataWriterQos
dwqos
=
pub.getDefaultDataWriterQos()
OpenSplice DDS
.withPolicies(pf.Reliability.withReliable());
-‐
or
-‐
DataWriterQos
dwqos
=
pub.getDefaultDataWriterQos()
.withPolicies(pf.Reliability.withBestEffort());
20. Partition QoS Policy
QoS Policy Applicability RxO Modifiable
☐ The Partition QoS Policy can PARTITION P, S N Y
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
be used as subjects for
organizing the flows of data
☐ The Partition QoS Policy is Subscriber
used to connect Publishers/ Publisher "tracks.kfo" "tracks.ufo"
OpenSplice DDS
Subscribers to a Partitions’
List which might also
contain wildcards, e.g. Subscriber
Publisher
tracks.*
☐ Topics instances are
published and subscribed Publisher Subscriber
across one or more Partition
Partitions
21. Setting the Partition Policy
[DDS C++ API 2010]
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
PublisherQos
pqos
=
dp.default_publisher_qos()
<<
Partition(“MyPartition”);
OpenSplice DDS
-‐
or
-‐
PublisherQos
pqos
=
dp.default_publisher_qos()
<<
Partition(myPartitionList);
22. Setting the Partition Policy
[DDS Java 5 API 2010]
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
final
PolicyFactory
pf
=
...
PublisherQos
pqos
=
dp.getDefaultPublisherQos()
OpenSplice DDS
.withPolicies(pf.Partition(“MyPartition”));
-‐
or
-‐
PublisherQos
pqos
=
dp.getDefaultPublisherQos()
.withPolicies(pf.Partition(myPartitionList));
23. Data Availability
History
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Data
OpenSplice DDS
Lifespan Durability
Availability
Ownership
Ownership
Strength
24. Durability QoS Policy
QoS Policy Applicability RxO Modifiable
DURABILITY T, DR, DW Y N
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
The DURABILITY QoS controls the data availability w.r.t. late joiners,
specifically the DDS provides the following variants:
☐ Volatile. No need to keep data instances for late joining data readers
OpenSplice DDS
☐ Transient Local. Data instance availability for late joining data reader is
tied to the data writer availability
☐ Transient. Data instance availability outlives the data writer
☐ Persistent. Data instance availability outlives system restarts
25. Volatile
Data
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
Data
Reader
OpenSplice DDS
DDS Global Data Space
‣ No Time Decoupling
‣ Readers get only data produced after they joined the Global Data Space
26. Volatile Late Joiner
Data
Data Reader
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
TopicA
Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ No Time Decoupling
‣ Readers get only data produced after they joined the Global Data Space
27. Volatile
Data
Data Reader
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
2
TopicA
Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ No Time Decoupling
‣ Readers get only data produced after they joined the Global Data Space
28. Transient Local
Data
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
Data
Reader
OpenSplice DDS
DDS Global Data Space
‣ Some Time Decoupling
‣ Data availability is tied to the availability of the data writer and the history settings
29. Transient Local Late Joiner
Data
Data Reader
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ Some Time Decoupling
‣ Data availability is tied to the availability of the data writer and the history settings
30. Transient Local
Data
Data Reader
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1 1
2
TopicA
Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ Some Time Decoupling
‣ Data availability is tied to the availability of the data writer and the history settings
31. Transient
Data
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
Data
Reader
OpenSplice DDS
DDS Global Data Space
‣ Time Decoupling
‣ Data availability is tied to the availability of the durability service -- a fully distributed
fault-tolerant service in the case of OpenSplice DDS.
32. Transient Late Joiner
Data
Data Reader
Writer
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
TopicA
1 Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ Time Decoupling
‣ Data availability is tied to the availability of the durability service -- a fully distributed
fault-tolerant service in the case of OpenSplice DDS.
33. Transient
Data
Reader
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
1 Data
Reader
OpenSplice DDS
1
DDS Global Data Space
‣ Time Decoupling
‣ Data availability is tied to the availability of the durability service -- a fully distributed
fault-tolerant service in the case of OpenSplice DDS.
34. Transient
Data
Reader
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
1
TopicA
1 Data
Reader
OpenSplice DDS
1
Data
Reader
DDS Global Data Space
Late Joiner
‣ Time Decoupling
‣ Data availability is tied to the availability of the durability service -- a fully distributed
fault-tolerant service in the case of OpenSplice DDS.
35. History QoS Policy
QoS Policy Applicability RxO Modifiable
HISTORY T, DR, DW N N
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
For DataWriters, the HISTORY QoS policy controls the amount of data that
can be made available to late joining DataReaders under
TRANSIENT_LOCAL Durability
OpenSplice DDS
For DataReader, the HISTORY QoS policy controls how many samples will
be kept on the reader cache
☐ Keep Last. DDS will keep the most recent “depth” samples of each
instance of data identified by its key
☐ Keep All. The DDS keep all the samples of each instance of data
identified by its key -- up to reaching some configurable resource limits
36. Ownership QoS Policy
QoS Policy Applicability RxO Modifiable
OWNERSHIP T, DR, DW Y N
STRENGTH DW N Y
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Availability of data producers can be controlled via two QoS Policies
☐ OWNERSHIP (SHARED vs. EXCLUSIVE)
OpenSplice DDS
☐ OWNERSHIP STRENGTH
☐ Instances of exclusively owned Topics can be modified (are
owned) by the higher strength writer
☐ Writer strength is used to coordinate replicated writers
37. Temporal Properties
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
TimeBasedFilter Deadline
[Inbound]
OpenSplice DDS
Throughput LatencyBudget Latency
[Outbound]
TransportPriority
38. Latency Budget QoS Policy
QoS Policy Applicability RxO Modifiable
LATENCY T, DR, DW Y Y
☐ The LATENCY_BUDGET QoS BUDGET
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
policy specifies the
maximum acceptable
delay from the time the
data is written until the data
OpenSplice DDS
is inserted in the receiver's
application-cache Latency = T1+T2+T3
DataWriter T3 DataReader
☐ A non-zero latency-budget T1
allows a DDS Batching
implementation to batch T2
samples and improve CPU/
Network utilization
39. Deadline QoS Policy
QoS Policy Applicability RxO Modifiable
DEADLINE T, DR, DW Y Y
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ The DEADLINE QoS policy allows to define the maximum inter-arrival
time between data samples
☐ DataWriter indicates that the application commits to write a new
OpenSplice DDS
value at least once every deadline period
☐ DataReaders are notified by the DDS when the DEADLINE QoS
contract is violated
DataWriter Deadline Deadline Deadline Deadline Deadline DataReader
Deadline Violation
40. Transport Priority QoS Policy
QoS Policy Applicability RxO Modifiable
TRANSPORT T, DW N Y
PRIORITY
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ The TRANSPORT_PRIORITY QoS policy is a hint to the infrastructure as
OpenSplice DDS
to how to set the priority of the underlying transport used to send
the data.
41. Time-Based Filter QoS Policy
QoS Policy Applicability RxO Modifiable
TIME BASED DR N Y
FILTER
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
mit
mit
☐ The Time Based Filter allows to
control the throughput at which
Latency = T1+T2+T3
data is received by a data reader
OpenSplice DDS
DataWriter T3 DataReader
☐ Samples produced more often
T2 than the minimum inter-arrival
time are not delivered to the data
reader
mit mit
mit = minimum inter-arrival time
produced sample delivered sample discarded sample
42. QoS Provider
☐ The new C++ and Java APIs introduce the concept of a QoS
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Provider
☐ This class allows to externally define policies and decouples the
mechanism used to define and access policy definition with policy
OpenSplice DDS
creation
//
QosProvider...
QosProvider
qos_provider(
"http://www.opensplice.org/demo/config/qos.xml",
"ishapes-‐profile");
DataReader<ShapeType>
dr(sub,
topic,
qos_provider.datareader_qos());
44. Soft State
☐ In distributed systems you often need to model soft-state -- a state
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
that is periodically updated
☐ Examples are the reading of a sensor (e.g. Temperature Sensor),
the position of a vehicle, etc.
OpenSplice DDS
☐ The QoS combination to model Soft-State is the following:
Reliability
=>
BestEffort
Durability
=>
Volatile
History
=>
KeepLast(n)
[with
n
=
1
in
most
of
the
cases]
Deadline
=>
updatePeriod
LatencyBudget
=>
updatePeriod/3
[rule
of
thumb]
DestinationOrder
=>
SourceTimestamp
[if
multiple
writers
per
instance]
45. Hard State
☐ In distributed systems you often need to model hard-state -- a state
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
that is sporadically updated and that often has temporal
persistence requirements
☐ Examples are system configuration, a price estimate, etc.
OpenSplice DDS
☐ The QoS combination to model Hard-State is the following:
Reliability
=>
Reliable
Durability
=>
Transient
|
Persistent
History
=>
KeepLast(n)
[with
n
=
1
in
most
of
the
cases]
DestinationOrder
=>
SourceTimestamp
[if
multiple
writers
per
instance]
46. Events
☐ In distributed systems you often need to model events -- the
occurrence of something noteworthy for our system
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ Examples are a collision alert, the temperature beyond a given
threshold, etc.
OpenSplice DDS
☐ The QoS combination to model Events is the following:
Reliability
=>
Reliable
Durability
=>
any
[depends
on
system
requirements]
History
=>
KeepAll
[on
both
DataWriter
and
DataReader!]
DestinationOrder
=>
SourceTimestamp
47. Streams
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ At times you need to deal with high volumes of frequently
changing soft-state
☐ You may have from several hundreds of thousands to several
OpenSplice DDS
millions of data readings that need to be distributed in your
system... Where each reading is usually from few tends to few
hundreds of bytes
☐ OpenSplice provide a special abstraction to deal with this situation
called Streams
48. Streams struct SCADASensor {
long sid;
float value;
};
#pragma stream SCADASensor
☐ OpenSplice Streams
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
transparently perform
batching and un- High Frequency High Frequency
batching of data based Samples Samples
on samples count or
OpenSplice DDS
time
StreamDataWriter StreamDataReader
☐ OpenSplice Streams Batching Un-Batching
also provide explicit Temporal or
Samples-Count
flush operation to force Driven Batching
the middleware to send
data
49. StreamDataWriter
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
StreamDataWriterQos
sqos(max_samples,
max_delay);
SCADASensorStreamDataWriter
sdw
=
new
SCADASensorStreamDataWriter(did,
sqos,
“ScadaSensorT”);
OpenSplice DDS
StreamId
sid
=
0;
//
Your
stream
Id
SCADASensor
data
=
...
sdw.append(sid,
data);
...
//
Explicitely
flush
the
stream
sdw.flush(sid);
50. StreamDataReader
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
SCADASensorStreamDataReader
sdr
=
new
SCADASensorStreamDataReader(did,
“ScadaSensorT”);
StreamId
sid
=
0;
//
Your
stream
Id
SCADASensorSeq
data;
OpenSplice DDS
//
Issue
a
blocking
get
sdw.get(sid,
data,
DDS::LENGTH_UNLIMITED,
DDS::DURATION_INFINITE);
//
Note:
//
-‐
get_with_filter
is
also
available
to
filter
data
//
-‐
The
Stream
Examples
are
shown
using
the
DDS
C++
2004
API
//
since
these
are
OpenSplice
specific
extensions.
//
DDS
C++
2010
counterparts
will
be
soon
available.
52. LongVariable Example
☐ The “distributed” version of the following code:
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
int
x;
int
y;
x
=
10;
y
=
20;
OpenSplice DDS
Topic Type
☐ Becomes:
// Create a Publisher struct LongVariable {
auto lvt = Topic<LongVariable>(dp, “TLongVariable”); @Key
string name;
// Create DataWriters long value;
auto dw = DataWriter<LongVariable>(pub, topic); };
// Write Data
dw.write(LongVariable(“x”,10));
dw.write(LongVariable(“y”,20)); PS. long in IDL is a 32 bit integer
53. Looking with the Spyglass
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Topic
TLongValue
struct LongVariable {
@Key
string name;
long value;
OpenSplice DDS
dw };
Policies
name value
x 10
y 20
54. Declaration vs. Assignement
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Assignment
{
Declaration
int
x; dw.write(LongVariable(“x”,10));
x
=
10;
Assignment
OpenSplice DDS
}
Resources
Reclamation
☐ Can we declare topic instances in DDS?
☐ Can we control resource reclamation?
55. Instance Registration
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
{
auto key = LongVariable(“x”,0)
Declaration
int
x; auto handle = Declaration
x
=
10; dw.register_instance(key);
Assignment
OpenSplice DDS
}
dw.write(LongVariable(“x”,10));
Assignment
Resources
Reclamation
☐ Instance registration provides a way of informing the system that the given data
writer will be writing the given instance
☐ This operation has an impact on instance life-cycle
☐ The write operation implicitly register the instance being written, if necessary
56. Instance Un-registration
☐ DDS provides a way for a DataWriter to “un-register” an
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
instance thus informing the system that he won’t be writing that
specific instance any more
This operation has an impact on instance life-cycle
OpenSplice DDS
☐
dw.unregister_instance(handle);
57. Instance Disposal
auto key = LongVariable(“x”,0)
{
Declaration auto handle =
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Declaration
int
x; dw.register_instance(key);
x
=
10;
} Assignment dw.write(LongVariable(“x”,10));
dw.dispose_instance(handle)
Assignment
OpenSplice DDS
Resources
Reclamation
Resources
Reclamation
☐ Allows to control resource reclamation for a given instance.
☐ The action of disposing an instance signifies that the system is done
with it...
58. Writer Data Lifecycle
The life-cycle of data on the Writer side is controlled by means of
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐
QoS policy we’ve not introduced yet, the WriterDataLifecycle
☐ This policy controls wether unregistered instances are automatically
OpenSplice DDS
disposed or not
☐ This is quite important since when a writer is disposed all its
instances are automatically unregistered and depending on the
setting of this QoS might also be disposed... Which in some cases is
not what you want!
59. Reader Data Lifecycle
☐ The lifecycle of the data-instances received by the DataReader is
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
controlled by the ReaderDataLifecycle policy
☐ This policy allow to control two properties
☐ autopurge_nowriter_samples_delay: the maximum duration for
OpenSplice DDS
which the DataReader will maintain information on an instance
once its state becomes NOT_ALIVE_NO_WRITERS
☐ autopurge_disposed_samples_delay: the maximum duration for
which the DataReader will maintain samples for an instance once
its state becomes NOT_ALIVE_DISPOSED
PS. The default setting for this policy is INFINITE for both delays
61. Why Functional Programming (FP)?
Some of the main reasons for the steep increase in the adoption of Functional
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
Programming languages are:
☐ Referential Transparency (no side effects): makes it easier to write reusable
code and facilitates concurrency (increasingly more important due to multi-
cores)
OpenSplice DDS
☐ Declarative style: makes code easier to understand (once you understand the
language)
☐ Higher Order abstractions: Higher order functions, pattern matching, algebraic
data types, Higher Kinds, makes it easier to express solutions in our domain
☐ Domain Specific Languages (DSL): Functional programming languages like
Haskel and Scala make it easy to develop DSLs
62. Why DDS and FP?
☐ Data Centricity and Stream Computing match very naturally with
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
functional programming
☐ All of a sudden your system can be easily modeled as streams of data
transformed by composable functions
OpenSplice DDS
☐ Referential transparency makes it easily parallelizable
F(x)
G(y,z)
63. struct
TempSensor
{
Example
long
id;
float
temp;
float
hum;
};
#pragma
keylist
TempSensor
id
Compute the moving average for temperature and humidity
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐
val
tst
=
Topic[TempSensor]("TempSensorT")
val
atst
=
Topic[TempSensor]("AverageTempSensorT")
OpenSplice DDS
val
rqos
=
DataReaderQos()
<=
History.KeepLast(windowSize)
val
dr
=
DataReader[TempSensor](tst,
rqos)
val
dw
=
DataWriter[TempSensor](atst)
reader.reactions
+=
{
case
DataAvailable(_)
=>
{
val
window
=
dr.history.data
val
tempAvg
=
(0F
/:
window)(_
+
_.temp)
/
window.length
val
humAvg
=
(0F
/:
window)(_
+
_.hum)
/
window.length
dw
!
new
TempSensor(-‐1,
tempAvg,
humAvg)
}
}
65. List Comprehension in DDS
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ When using the SCALA API, the DDS readers expose data as
LinearSeqOptimized thus making possible list comprehension to
address quite a few task
OpenSplice DDS
☐ Example
☐ dr read foreach (println)
☐ dr read map (transformer)
☐ ...
66. Examples
Compute the average shape and write it as a Gray Square:
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐
val data = dr history
val s0 = new ShapeType(“GRAY”, 0, 0 ,0)
OpenSplice DDS
dw ! scaleShape((s0 /: data) (sumShape), data.size)
☐ Filter samples:
(dr read) filter (_.x <= 100 && _.y <= 200)
68. DDS ISO C++ API 2010
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ github.com/kydos
☐ New C++ API
OpenSplice DDS
☐ Demo applications
☐ Alpha reference
implementation (simd-cxx)
☐ online docs
☐ kydos.github.com/dds-psm-cxx/
69. OpenSplice DDS
☐
☐
☐
New Java API
github.com/kydos
Demo applications
DDS Java 5 API 2010
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
70. DDS Scala API
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐ github.com/kydos
☐ Scala API for DDS
Set of demo showing how
OpenSplice DDS
☐
the API can be used
☐ Notice that this API can
also be used for scripting
DDS applications
72. Concluding Remarks
OpenSplice DDS provides a very powerful abstraction for building
Copyright
2011,
PrismTech
–
All
Rights
Reserved.
☐
distributed applications grounded on the concept of a fully
distributed global data space
OpenSplice DDS
☐ Topics are used to define the types that populate the global data
space while DataWriters and DataReaders are used to produce
and consume values
☐ DataReaders allow very flexible data access through cache
access operations