Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CCDB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ o2_add_library(CCDB
ROOT::Hist
O2::CommonUtils
FairMQ::FairMQ
libjalien::libjalienO2
TARGETVARNAME targetName)

o2_target_root_dictionary(CCDB
Expand Down
24 changes: 22 additions & 2 deletions CCDB/include/CCDB/CcdbApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
#include <TMessage.h>
#include "CCDB/CcdbObjectInfo.h"

#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libjalien isn't a ROOT library and doesn't have a ROOT dictionary. I noticed problems with ROOT interpreter when CcdbApi.h was included because it couldn't understand this type.

There is similar code in JAliEn-ROOT / AliEn-ROOT-Legacy, but maybe there is another way around it. In any case, if this header is not explicitly included in a ROOT interpreter session then maybe it works without it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sawenzel What do you advise?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hard opinion here. But usually this should not be necessary. One can already use o2::ccdb::CcdbApi in a ROOT session without including the header. And the protection could be put outside as well.
We can also merge as is and remove later.

#include <TJAlienCredentials.h>
#else
class TJAlienCredentials;
#endif

class TFile;
class TGrid;

Expand Down Expand Up @@ -276,6 +282,19 @@ class CcdbApi //: public DatabaseInterface
constexpr static const char* CCDBMETA_ENTRY = "ccdb_meta";
constexpr static const char* CCDBOBJECT_ENTRY = "ccdb_object";

/**
* Set curl SSL options. The client still will be able to connect to non-ssl endpoints
* @param curl curl handler
* @return
*/
static void curlSetSSLOptions(CURL* curl);

TObject* retrieve(std::string const& path, std::map<std::string, std::string> const& metadata, long timestamp) const;

TObject* retrieveFromTFile(std::string const& path, std::map<std::string, std::string> const& metadata, long timestamp,
std::map<std::string, std::string>* headers, std::string const& etag,
const std::string& createdNotAfter, const std::string& createdNotBefore) const;

private:
/**
* Initialize in local mode; Objects will be retrieved from snapshot
Expand Down Expand Up @@ -381,8 +400,9 @@ class CcdbApi //: public DatabaseInterface
std::string mUrl{};
std::string mSnapshotTopPath{};
bool mInSnapshotMode = false;
mutable TGrid* mAlienInstance = nullptr; // a cached connection to TGrid (needed for Alien locations)
bool mHaveAlienToken = false; // stores if an alien token is available
mutable TGrid* mAlienInstance = nullptr; // a cached connection to TGrid (needed for Alien locations)
bool mHaveAlienToken = false; // stores if an alien token is available
static std::unique_ptr<TJAlienCredentials> mJAlienCredentials; // access JAliEn credentials

ClassDefNV(CcdbApi, 1);
};
Expand Down
Loading