Project
Loading...
Searching...
No Matches
DataSampling.h
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
12#ifndef FRAMEWORK_DATASAMPLING_H
13#define FRAMEWORK_DATASAMPLING_H
14
19
21#include "Framework/InputSpec.h"
22#include <string>
23#include <boost/property_tree/ptree_fwd.hpp>
24#include <optional>
25
26namespace o2::configuration
27{
29}
30
31namespace o2::framework
32{
33class CompletionPolicy;
34class ChannelConfigurationPolicy;
35} // namespace o2::framework
36
38{
39
40class Dispatcher;
41
73
75{
76 public:
78 DataSampling() = delete;
85 static void GenerateInfrastructure(framework::WorkflowSpec& workflow, const std::string& policiesSource, size_t threads = 1, const std::string& host = "");
86
93 static void GenerateInfrastructure(framework::WorkflowSpec& workflow, boost::property_tree::ptree const& policies, size_t threads = 1, const std::string& host = "");
95 static void CustomizeInfrastructure(std::vector<framework::CompletionPolicy>&);
97 static void CustomizeInfrastructure(std::vector<framework::ChannelConfigurationPolicy>&);
99 static std::vector<framework::InputSpec> InputSpecsForPolicy(const boost::property_tree::ptree& policiesTree, const std::string& policyName);
101 static std::vector<framework::OutputSpec> OutputSpecsForPolicy(const boost::property_tree::ptree& policiesTree, const std::string& policyName);
103 static std::optional<uint16_t> PortForPolicy(const boost::property_tree::ptree& policiesTree, const std::string& policyName);
105 static std::vector<std::string> MachinesForPolicy(const boost::property_tree::ptree& policiesTree, const std::string& policyName);
107 static std::string BindLocationForPolicy(const boost::property_tree::ptree& policiesTree, const std::string& policyName);
108
109 private:
110 static void DoGenerateInfrastructure(Dispatcher&, framework::WorkflowSpec& workflow, boost::property_tree::ptree const& policies, size_t threads = 1, const std::string& host = "");
111 // Internal functions, used by GenerateInfrastructure()
112 static std::string createDispatcherName();
113};
114
115} // namespace o2::utilities
116
117#endif // FRAMEWORK_DATASAMPLING_H
o2::configuration::ConfigurationInterface ConfigurationInterface
DataSampling()=delete
Deleted default constructor. This class is stateless.
static void CustomizeInfrastructure(std::vector< framework::CompletionPolicy > &)
Configures dispatcher to consume any data immediately.
static std::string BindLocationForPolicy(const boost::property_tree::ptree &policiesTree, const std::string &policyName)
Says if remote part (e.g. QC server) should bind the inter-machine channel, according to the configur...
static std::optional< uint16_t > PortForPolicy(const boost::property_tree::ptree &policiesTree, const std::string &policyName)
Provides the port to be used for a proxy of given DataSamplingPolicy. Expects the "dataSamplingPolici...
static void GenerateInfrastructure(framework::WorkflowSpec &workflow, const std::string &policiesSource, size_t threads=1, const std::string &host="")
Generates data sampling infrastructure.
static std::vector< framework::InputSpec > InputSpecsForPolicy(const boost::property_tree::ptree &policiesTree, const std::string &policyName)
Provides InputSpecs to receive data for given DataSamplingPolicy. Expects the "dataSamplingPolicies" ...
static std::vector< std::string > MachinesForPolicy(const boost::property_tree::ptree &policiesTree, const std::string &policyName)
Provides the machines where given DataSamplingPolicy is enabled. Expects the "dataSamplingPolicies" t...
static std::vector< framework::OutputSpec > OutputSpecsForPolicy(const boost::property_tree::ptree &policiesTree, const std::string &policyName)
Provides OutputSpecs of given DataSamplingPolicy. Expects the "dataSamplingPolicies" tree.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
A header which contains some meta-data generated by Data Sampling.