Project
Loading...
Searching...
No Matches
FullHistoryMerger.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 ALICEO2_FULLHISTORYMERGER_H
13#define ALICEO2_FULLHISTORYMERGER_H
14
19
21#include "Mergers/ObjectStore.h"
22
23#include <Framework/Task.h>
24
25namespace o2::monitoring
26{
27class Monitoring;
28}
29
30namespace o2::mergers
31{
32
37{
38 public:
42 ~FullHistoryMerger() override;
43
45 void init(framework::InitContext& ctx) override;
47 void run(framework::ProcessingContext& ctx) override;
48
50 void endOfStream(framework::EndOfStreamContext& eosContext) override;
51
52 private:
54
55 ObjectStore mMergedObject = std::monostate{};
56 std::pair<std::string, framework::DataRef> mFirstObjectSerialized;
57 std::unordered_map<std::string, ObjectStore> mCache;
58
59 MergerConfig mConfig;
60 std::unique_ptr<monitoring::Monitoring> mCollector;
61 int mCyclesSinceReset = 0;
62
63 // stats
64 int mTotalObjectsMerged = 0;
65 int mObjectsMerged = 0;
66 int mTotalUpdatesReceived = 0;
67 int mUpdatesReceived = 0;
68
69 private:
70 void updateCache(const framework::DataRef& ref);
71 void mergeCache();
72 void publish(framework::DataAllocator& allocator);
73 void clear();
74 bool shouldFinishCycle(const framework::InputRecord& inputs) const;
75};
76
77} // namespace o2::mergers
78
79#endif //ALICEO2_FULLHISTORYMERGER_H
Definition of O2 MergerConfig, v0.1.
Definition of ObjectStore for Mergers, v0.1.
o2::monitoring::Monitoring Monitoring
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
FullHistoryMerger data processor class.
void endOfStream(framework::EndOfStreamContext &eosContext) override
Callback for CallbackService::Id::EndOfStream.
~FullHistoryMerger() override
Default destructor.
void run(framework::ProcessingContext &ctx) override
FullHistoryMerger process callback.
void init(framework::InitContext &ctx) override
FullHistoryMerger init callback.
std::variant< std::monostate, TObjectPtr, VectorOfTObjectPtrs, MergeInterfacePtr > ObjectStore
Definition ObjectStore.h:45
uint32_t SubSpecificationType
Definition DataHeader.h:620