41 Inputs{{
"dataTPC",
"TPC",
"CLUSTERS"}},
42 Outputs{{
"TPC",
"CLUSTERS_P"}}}};
44 std::string configFilePath = std::string(getenv(
"O2_ROOT")) +
"/share/tests/test_DataSampling.json";
45 std::cout <<
"config file : "
46 <<
"json:/" << configFilePath << std::endl;
49 auto disp = std::find_if(workflow.begin(), workflow.end(),
51 return d.name.find(
"Dispatcher") != std::string::npos;
53 BOOST_REQUIRE(disp != workflow.end());
55 auto input = std::find_if(disp->inputs.begin(), disp->inputs.end(),
57 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS"), 0) && in.lifetime == Lifetime::Timeframe;
61 input = std::find_if(disp->inputs.begin(), disp->inputs.end(),
63 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS_P"), 0) && in.lifetime == Lifetime::Timeframe;
68 input = std::find_if(disp->inputs.begin(), disp->inputs.end(),
70 return DataSpecUtils::match(in, DataOrigin(
"Y"), DataDescription(
"Z"), 0) && in.lifetime == Lifetime::Timeframe;
74 auto output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
76 return DataSpecUtils::match(out, ConcreteDataMatcher{
"DS",
"tpcclusters0", 0}) && out.
lifetime == Lifetime::QA;
80 output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
82 return DataSpecUtils::match(out, ConcreteDataMatcher{
"DS",
"tpcclusters1", 0}) && out.lifetime == Lifetime::QA;
101 Inputs{{
"dataTPC",
"TPC",
"CLUSTERS"}},
102 Outputs{{
"TPC",
"CLUSTERS_P"}}},
109 workflow.insert(std::end(workflow), std::begin(processingStages), std::end(processingStages));
111 std::string configFilePath = std::string(getenv(
"O2_ROOT")) +
"/share/tests/test_DataSampling.json";
114 for (
int i = 0;
i < 3; ++
i) {
115 auto disp = std::find_if(workflow.begin(), workflow.end(),
117 return d.name.find(
"Dispatcher") != std::string::npos;
119 BOOST_REQUIRE(disp != workflow.end());
121 auto input = std::find_if(disp->inputs.begin(), disp->inputs.end(),
123 return DataSpecUtils::match(in, ConcreteDataMatcher{DataOrigin(
"TPC"), DataDescription(
"CLUSTERS"), static_cast<DataHeader::SubSpecificationType>(i)}) && in.
lifetime == Lifetime::Timeframe;
127 input = std::find_if(disp->inputs.begin(), disp->inputs.end(),
129 return DataSpecUtils::match(in, ConcreteDataMatcher{DataOrigin(
"TPC"), DataDescription(
"CLUSTERS_P"), static_cast<DataHeader::SubSpecificationType>(i)}) && in.
lifetime == Lifetime::Timeframe;
133 auto output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
135 return DataSpecUtils::match(out, ConcreteDataMatcher{
"DS",
"tpcclusters0", 0}) && out.lifetime == Lifetime::QA;
139 output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
141 return DataSpecUtils::match(out, ConcreteDataMatcher{
"DS",
"tpcclusters1", 0}) && out.lifetime == Lifetime::QA;
154 {
OutputSpec{
"TPC",
"CLUSTERS", 0, Lifetime::Timeframe}}},
159 {
"dataTPC",
"TPC",
"CLUSTERS", 0, Lifetime::Timeframe}},
161 {
"TPC",
"CLUSTERS_P", 0, Lifetime::Timeframe}}},
164 std::string configFilePath = std::string(getenv(
"O2_ROOT")) +
"/share/tests/test_DataSampling.json";
167 auto disp = std::find_if(workflow.begin(), workflow.end(),
169 return d.name.find(
"Dispatcher") != std::string::npos;
172 BOOST_REQUIRE(disp != workflow.end());
229 std::string configFilePath =
"json:/" + std::string(getenv(
"O2_ROOT")) +
"/share/tests/test_DataSampling.json";
230 std::unique_ptr<ConfigurationInterface> config = ConfigurationFactory::getConfiguration(configFilePath);
231 auto policiesTree = config->getRecursive(
"dataSamplingPolicies");
246 BOOST_REQUIRE(port.has_value());
260 auto disp = std::find_if(workflow.begin(), workflow.end(),
262 return d.name.find(
"Dispatcher") != std::string::npos;
264 BOOST_REQUIRE(disp != workflow.end());
266 auto input1 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
268 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS"), 0) && in.lifetime == Lifetime::Timeframe;
271 auto input2 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
273 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS_P"), 0) && in.lifetime == Lifetime::Timeframe;
276 auto input3 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
278 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"RAWDATA"), 0) && in.lifetime == Lifetime::Timeframe;
287 auto disp = std::find_if(workflow.begin(), workflow.end(),
289 return d.name.find(
"Dispatcher") != std::string::npos;
291 BOOST_REQUIRE(disp != workflow.end());
293 auto input1 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
295 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS"), 0) && in.lifetime == Lifetime::Timeframe;
298 auto input2 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
300 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS_P"), 0) && in.lifetime == Lifetime::Timeframe;
309 auto disp = std::find_if(workflow.begin(), workflow.end(),
311 return d.name.find(
"Dispatcher") != std::string::npos;
313 BOOST_REQUIRE(disp != workflow.end());
315 auto input1 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
317 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS"), 0) && in.lifetime == Lifetime::Timeframe;
320 auto input2 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
322 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"CLUSTERS_P"), 0) && in.lifetime == Lifetime::Timeframe;
325 auto input3 = std::find_if(disp->inputs.begin(), disp->inputs.end(),
327 return DataSpecUtils::match(in, DataOrigin(
"TPC"), DataDescription(
"RAWDATA"), 0) && in.lifetime == Lifetime::Timeframe;
346 auto policy1 = std::make_unique<DataSamplingPolicy>(
"policy1");
347 policy1->registerPath({
"vcxz",
"TST",
"AAAA", 0}, {{
"erwv"},
"DS",
"AAAA"});
349 auto policy2 = std::make_unique<DataSamplingPolicy>(
"policy2");
350 policy2->registerPath({
"fdsa",
"TST",
"AAAA", 0}, {{
"fdsf"},
"DS",
"BBBB"});
352 auto policy3 = std::make_unique<DataSamplingPolicy>(
"policy3");
353 policy3->registerPath({
"asdf", {
"TST",
"AAAA"}}, {{
"erwv"},
"DS",
"CCCC"});
361 BOOST_REQUIRE_EQUAL(inputs.size(), 2);
370 auto policy1 = std::make_unique<DataSamplingPolicy>(
"policy1");
371 policy1->registerPath({
"vcxz",
"TST",
"AAAA", 0}, {{
"erwv"},
"DS",
"AAAA"});
373 auto policy2 = std::make_unique<DataSamplingPolicy>(
"policy2");
374 policy2->registerPath({
"fdsa",
"TST",
"AAAA", 0}, {{
"fdsf"},
"DS",
"BBBB"});
376 auto policy3 = std::make_unique<DataSamplingPolicy>(
"policy3");
377 policy3->registerPath({
"asdf", {
"TST",
"AAAA"}}, {{
"erwv"},
"DS",
"CCCC"});
385 BOOST_REQUIRE_EQUAL(inputs.size(), 2);
393 auto policy1 = std::make_unique<DataSamplingPolicy>(
"policy1");
394 policy1->registerPath({
"vcxz",
"TST",
"AAAA", 0}, {{
"erwv"},
"DS",
"AAAA"});
396 auto policy2 = std::make_unique<DataSamplingPolicy>(
"policy2");
397 policy2->registerPath({
"sfsd",
"TST",
"BBBB", 0}, {{
"fdsf"},
"DS",
"BBBB"});
399 auto policy3 = std::make_unique<DataSamplingPolicy>(
"policy3");
400 policy3->registerPath({
"asdf", {
"TST",
"CCCC"}}, {{
"erwv"},
"DS",
"CCCC"});
408 BOOST_REQUIRE_EQUAL(inputs.size(), 4);
418 auto policy1 = std::make_unique<DataSamplingPolicy>(
"policy1");
419 policy1->registerPath({
"random",
"TST",
"AAAA", 0}, {{
"erwv"},
"DS",
"XYZ", 0});
421 auto policy2 = std::make_unique<DataSamplingPolicy>(
"policy2");
422 policy2->registerPath({
"random0",
"TST",
"AAAA", 0}, {{
"fdsf"},
"DS",
"BBBB", 0});
423 policy2->registerPath({
"random1",
"TST",
"AAAA", 1}, {{
"fdsf"},
"DS",
"BBBB", 1});
430 BOOST_REQUIRE_EQUAL(inputs.size(), 3);