Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

support for exporting selected parts of hardware database into an sqlite database#108

Open
andreh12 wants to merge 6 commits into
cmsdaq:devfrom
andreh12:feature/persistent-daq-partition-sqlite
Open

support for exporting selected parts of hardware database into an sqlite database#108
andreh12 wants to merge 6 commits into
cmsdaq:devfrom
andreh12:feature/persistent-daq-partition-sqlite

Conversation

@andreh12

@andreh12 andreh12 commented Dec 22, 2017

Copy link
Copy Markdown

The code here is one of the solutions to #99. It allows to export selected dpset paths to a sqlite file and configure DAQAggregator.properties to read the hardware database from such an sqlite file.

Note that it was necessary to catch and rewrite one SQL query done by the RCMS code when reading the hardware database because this SQL query uses a vendor specific extension which is not understood by sqlite. The replacement query (see 356152d) is currently not 100% equivalent but internal discussions indicate that the database content is nowadays such that the difference does not matter.


The pull request includes a standalone application which extracts a list of given paths to an sqlite file. This can be built and run as follows:

  • run mvn assembly:assembly -DskipTests
  • remove the output file to avoid adding database content to it if exists already
  • run
java \
-cp target/DAQAggregator-1.17.6-jar-with-dependencies.jar \
rcms.utilities.daqaggregator.datasource.HwdbToSqlite
<dpsetpath1> \
<dpsetpath2> \
...
<outputfile.sqlite>

To configure the DAQAggregator to use this file, comment out the existing hwcfgdb.type fields in DAQAggregator.properties and add the following two lines:

hwcfgdb.type = SQLITE
hwcfgdb.dburl = jdbc:sqlite:/path/to/sqlite/file.sqlite

(note that when running the conversion program above you should ensure that DAQAggregator.properties is configured to use the original database to read from).


Doing both of the above steps, FlashlistDispatcherIT successfully runs from an sqlite file if one copies the appropriate dpset paths (some of which seem to be taken from the current configuration which is running online).

@andreh12 andreh12 changed the title Feature/persistent daq partition sqlite support for exporting selected parts of hardware database into an sqlite database Dec 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant