Project
Loading...
Searching...
No Matches
ccdb-populator-workflow.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include "CCDBPopulatorSpec.h"
16#include <regex>
17
18using namespace o2::framework;
19
20// we need to add workflow options before including Framework/runDataProcessing
21void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
22{
23 // option allowing to set parameters
24 std::vector<o2::framework::ConfigParamSpec> options{
25 {"name-extention", VariantType::String, "", {"optional extention of device name"}},
26 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
27
28 std::swap(workflowOptions, options);
29}
30
31// we need to add workflow options before including Framework/runDataProcessing
32void customize(std::vector<o2::framework::CompletionPolicy>& policies)
33{
34 // we customize the pipeline processors to consume data as it comes
37 auto matcher = [](o2::framework::DeviceSpec const& device) -> bool {
38 return std::regex_match(device.name.begin(), device.name.end(), std::regex("ccdb-populator.*"));
39 };
40 auto& pol = policies.emplace_back(CompletionPolicyHelpers::consumeWhenAll("ccdb-populator-consume-all", matcher));
41 pol.order = CompletionPolicy::CompletionOrder::Slot;
42}
43
44// ------------------------------------------------------------------
45
47
49{
50 WorkflowSpec specs;
51 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
52 specs.emplace_back(getCCDBPopulatorDeviceSpec(o2::base::NameConf::getCCDBServer(), configcontext.options().get<std::string>("name-extention")));
53 return specs;
54}
Definition of the Names Generator class.
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
static std::string getCCDBServer()
Definition NameConf.cxx:115
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
Helper class which holds commonly used policies.
static CompletionPolicy consumeWhenAll(const char *name, CompletionPolicy::Matcher matcher)
Default Completion policy. When all the parts of a record have arrived, consume them.