I would like to import and export the topic data used in the OpenSplice Tuner. How can I do this?
How can I import and export the topic data used in the OpenSplice Tuner
In addition to injecting and consuming data, OpenSplice Tuner also provides facilities to export information from Vortex OpenSplice to a file on disk and the other way around.
There are two kinds of information that can be exported/imported.
- Topics in OpenSplice can be exported to a file on disk with OpenSplice Tuner. Once a Topic is exported, it can for instance be imported in another OpenSplice domain later on. It might also be useful to re-insert the Topic after a restart of OpenSplice.
- Samples for topics in OpenSplice can also be exported.
OpenSplice Tuner considers the Topic itself as metadata and the samples for a Topic as data. The Tuner exports both the metadata and data to disk in XML format.
The topic is exported as metadata and the export consists of
- Topic Name
- Topic Type Name
- Topic Key List
- Topic Data Type
- Topic Quality of Service
There are two ways to export the metadata. You can choose Edit>Export Metadata from the tuner menu. Alternatively you can right click a topic in the entity list and choose Edit>Export Metadata from the pop up menu.
The topic is the name of the topic you want to export and File is the location of the xml file where you want to save the data. Clicking on browse allows you to choose a location. When you click ok the input is validated. If everything is ok the data is exported. If it is not you will see an error message.
When you export the samples (or data) you also export the topics (metadata). There are two modes for exporting data:
- exporting data from an existing partition
- exporting data from partitions that match a user defined expression
Data can also be exported from an existing reader using the list view of the reader window and reader-writer window.
Export from an existing partition
You can export data from an existing partition by:
Choosing Edit>Export data> Existing Partition from the main tuner menu bar.
Right clicking a partition entity in the entity tree in the main window and then choosing Export data from the pop up menu
Right clicking a topic entity in the entity tree in the main window and choosing Export data from the pop up menu
The following fields are used in the resulting dialog box:
- The Topic field specifies the topic that is being exported
- The Partition field determines which partition the data will be exported from
- The Query field allows you to optionally specify a query to narrow down the data that is exported.
- The File field allows you to specify which xml file the data will be stored in. You can use the browse button to choose a file.
- The WaitForHistoricalData field determines whether the reader that is used to gain access to the data this is being exported will wait for historical data during creation. If this is ticked it will wait for a maximum of 30 seconds.
By default the Qos setting are copied from the Topic. These can be overridden using the ReaderQoS Tab.
Pressing the OK button will validate the data, if everything is fine the data will be exported to the file specified. If not an error message will be seen.
Export from an existing reader
To export data from a reader window or reader-writer window choose Edit> Export from the window menu. A dialog box will appear. The topic and partition are already know so you only need to choose the name of the xml file where you wish the data to be saved. You can use the Browse button to find the location. Pressing OK will validate the data and if everything is fine it will be saved. If it is not correct an error message will appear.
The tuner can be used to import metadata (topics) into a specific OpenSplice domain.
To import metadata choose
Edit > Import metadata
from the menu bar of the tuner window and in the dialog box choose the location of the xml file where the data is stored. If the input is not correct or a topic with the same name but other characteristics already exists in the connected domain, an error message will appear in the status bar of the dialog window.
The tuner can also be used to import data into a specific OpenSplice domain. When it imports the data the OpenSplice tuner checks to see if the metadata is already available and if not it imports it as well.
More information can be found in the OpenSplice Tuner Guide which is included with the distribution and is part of the OpenSplice documentation set.