Commit 79924272 authored by Matthieu Dorier's avatar Matthieu Dorier

Merge branch 'master' of xgitlab.cels.anl.gov:sds/HEPnOS

parents 32aa8c28 db7cfa42
Storing and retrieving products
Creating and accessing DataSets
===============================
Creating and accessing events
=============================
Creating and accessing Products
===============================
Creating and accessing Runs
===========================
Creating and accessing objects
Creating and accessing SubRuns
==============================
Client connection
=================
Client connection and service shutdown
======================================
The following code sample showcases how to initialize a DataStore
object in a client program. This object is the main entry point to
the HEPnOS storage system. Its :code:`connect()` function takes
the name of a YAML file as a parameter, which should be the file
created by HEPnOS when starting up.
.. literalinclude:: ../../examples/01_init_shutdown/main.cpp
:language: cpp
The :code:`DataStore::shutdown()` method can be used to tell
HEPnOS to shutdown. This method should be called by only one client
and will terminate all the HEPnOS processes. If HEPnOS is setup to
use in-memory databases, you will loose all the data store in HEPnOS.
......@@ -27,8 +27,11 @@ Contents
organization.rst
deployment.rst
connection.rst
accessing.rst
products.rst
accessing_datasets.rst
accessing_runs.rst
accessing_subruns.rst
accessing_events.rst
accessing_products.rst
optimizations.rst
theta.rst
......
#include <iostream>
#include <string>
#include <hepnos.hpp>
using namespace hepnos;
int main(int argc, char** argv) {
if(argc != 2) {
std::cerr << "Usage: " << argv[0] << " <configfile>" << std::endl;
exit(-1)
}
std::string configFile(argv[1]);
DataStore datastore = DataStore::connect(configFile);
// ...
// only if you want to shutdown HEPnOS
datastore.shutdown();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment