forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackendOCDB.cxx
More file actions
53 lines (43 loc) · 1.55 KB
/
Copy pathBackendOCDB.cxx
File metadata and controls
53 lines (43 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file BackendOCDB.cxx
/// \brief Implementation of the BackendOCDB class
/// \author Charis Kouzinopoulos <charalampos.kouzinopoulos@cern.ch>
#include "CCDB/BackendOCDB.h"
#include "CCDB/Condition.h"
#include "CCDB/ObjectHandler.h"
#include "TMessage.h"
#include <FairMQLogger.h>
#include <zlib.h>
#include <iostream>
using namespace o2::ccdb;
using namespace std;
// special class to expose protected TMessage constructor
class WrapTMessage : public TMessage
{
public:
WrapTMessage(void* buf, Int_t len) : TMessage(buf, len)
{
ResetBit(kIsOwner);
}
};
BackendOCDB::BackendOCDB() = default;
void BackendOCDB::Pack(const std::string& path, const std::string& key, std::string*& messageString)
{
LOG(ERROR) << "The PUT operation is not supported for the OCDB backend yet";
}
Condition* BackendOCDB::UnPack(std::unique_ptr<FairMQMessage> msg)
{
WrapTMessage tmsg(msg->GetData(), msg->GetSize());
Condition* aCondition = (Condition*)(tmsg.ReadObject(tmsg.GetClass()));
LOG(DEBUG) << "Received a condition from the server:";
aCondition->printConditionMetaData();
return aCondition;
}