Skip to content

Commit 1745770

Browse files
committed
Please consider the following formatting changes
1 parent f6f0c78 commit 1745770

File tree

8 files changed

+59
-60
lines changed

8 files changed

+59
-60
lines changed

Framework/CCDBSupport/src/AnalysisCCDBHelpers.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& ctx)
140140
std::cout << " Index for output is " << outputRouteIndex << std::endl;
141141
auto& spec = helper->routes[outputRouteIndex].matcher;
142142
std::vector<std::shared_ptr<arrow::BinaryViewBuilder>> builders;
143-
for (auto &_ : schema->fields()) {
143+
for (auto& _ : schema->fields()) {
144144
builders.emplace_back(std::make_shared<arrow::BinaryViewBuilder>());
145145
}
146146

@@ -166,15 +166,15 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& ctx)
166166
}
167167
auto responses = CCDBFetcherHelper::populateCacheWith(helper, ops, timingInfo, dtc, allocator);
168168
O2_SIGNPOST_START(ccdb, sid, "handlingResponses",
169-
"Got %zu responses from server.",
170-
responses.size());
169+
"Got %zu responses from server.",
170+
responses.size());
171171
if (builders.size() != responses.size()) {
172172
LOGP(fatal, "Not enough responses (expected {}, found {})", builders.size(), responses.size());
173173
}
174174
arrow::Status result;
175175
for (size_t bi = 0; bi < responses.size(); bi++) {
176-
auto &builder = builders[bi];
177-
auto &response = responses[bi];
176+
auto& builder = builders[bi];
177+
auto& response = responses[bi];
178178
char const* address = reinterpret_cast<char const*>(response.id.value);
179179
std::cout << "Inserting view (" << (void*)address << "," << response.size << ")" << std::endl;
180180
result &= builder->Append(std::string_view(address, response.size));
@@ -186,7 +186,7 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& ctx)
186186
}
187187
}
188188
arrow::ArrayVector arrays;
189-
for (auto &builder : builders) {
189+
for (auto& builder : builders) {
190190
arrays.push_back(*builder->Finish());
191191
}
192192
auto outTable = arrow::Table::Make(schema, arrays);

Framework/CCDBSupport/src/AnalysisCCDBHelpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace o2::framework
1717
{
1818

1919
struct AnalysisCCDBHelpers {
20-
static AlgorithmSpec fetchFromCCDB(ConfigContext const&ctx);
20+
static AlgorithmSpec fetchFromCCDB(ConfigContext const& ctx);
2121
};
2222

2323
} // namespace o2::framework

Framework/CCDBSupport/src/CCDBFetcherHelper.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ o2::ccdb::CcdbApi& CCDBFetcherHelper::getAPI(const std::string& path)
3838
return apis[entry == remappings.end() ? "" : entry->second];
3939
}
4040

41-
namespace {
41+
namespace
42+
{
4243
bool isOnlineRun(DataTakingContext const& dtc)
4344
{
4445
return dtc.deploymentMode == DeploymentMode::OnlineAUX || dtc.deploymentMode == DeploymentMode::OnlineDDS || dtc.deploymentMode == DeploymentMode::OnlineECS;
4546
}
46-
}
47+
} // namespace
4748

4849
void CCDBFetcherHelper::initialiseHelper(CCDBFetcherHelper& helper, ConfigParamRegistry const& options)
4950
{

Framework/CCDBSupport/src/CCDBFetcherHelper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct CCDBFetcherHelper {
5656
// A fetch operation.
5757
struct FetchOp {
5858
// Where to put the blob
59-
OutputSpec &spec;
59+
OutputSpec& spec;
6060
// The url to fetch
6161
std::string url = "";
6262
// The timestamp to use
@@ -78,7 +78,7 @@ struct CCDBFetcherHelper {
7878
// The size of the buffer
7979
size_t size = 0;
8080
// Where to actually
81-
FetchOp *request = nullptr;
81+
FetchOp* request = nullptr;
8282
};
8383

8484
static ParserResult parseRemappings(char const*);
@@ -98,7 +98,7 @@ struct CCDBFetcherHelper {
9898
o2::ccdb::CcdbApi& getAPI(const std::string& path);
9999
static void initialiseHelper(CCDBFetcherHelper& helper, ConfigParamRegistry const& options);
100100
static auto populateCacheWith(std::shared_ptr<CCDBFetcherHelper> const& helper,
101-
std::vector<FetchOp> const &ops,
101+
std::vector<FetchOp> const& ops,
102102
TimingInfo& timingInfo,
103103
DataTakingContext& dtc,
104104
DataAllocator& allocator) -> std::vector<Response>;

Framework/CCDBSupport/src/CCDBHelpers.cxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ O2_DECLARE_DYNAMIC_LOG(ccdb);
3030
namespace o2::framework
3131
{
3232

33-
// Fill valid routes. Here we consider only the routes which have
33+
// Fill valid routes. Here we consider only the routes which have
3434
// Lifetime::Condition. Notice the way we do it for analysis will be
3535
// different.
36-
namespace {
37-
void fillValidRoutes(CCDBFetcherHelper& helper, std::vector<o2::framework::OutputRoute> const& outputRoutes) {
36+
namespace
37+
{
38+
void fillValidRoutes(CCDBFetcherHelper& helper, std::vector<o2::framework::OutputRoute> const& outputRoutes)
39+
{
3840
std::unordered_map<std::string, bool> accountedSpecs;
3941
for (auto& route : outputRoutes) {
4042
if (route.matcher.lifetime != Lifetime::Condition) {
@@ -54,7 +56,7 @@ void fillValidRoutes(CCDBFetcherHelper& helper, std::vector<o2::framework::Outpu
5456
}
5557
}
5658
}
57-
}
59+
} // namespace
5860

5961
auto getOrbitResetTime(o2::pmr::vector<char> const& v) -> Long64_t
6062
{
@@ -182,7 +184,7 @@ AlgorithmSpec CCDBHelpers::fetchFromCCDB()
182184
std::vector<CCDBFetcherHelper::FetchOp> ops;
183185
int runNumber = 0;
184186
std::string ccdbMetadataPrefix = "ccdb-metadata-";
185-
for (auto &route : helper->routes) {
187+
for (auto& route : helper->routes) {
186188
CCDBFetcherHelper::FetchOp op{.spec = route.matcher, .timestamp = timestamp, .runNumber = std::stoi(dtc.runNumber)};
187189
for (auto& meta : route.matcher.metadata) {
188190
if (meta.name == "ccdb-path") {

Framework/Core/include/Framework/ASoA.h

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ void accessingInvalidIndexFor(const char* getter);
5252
void dereferenceWithWrongType(const char* getter, const char* target);
5353
void missingFilterDeclaration(int hash, int ai);
5454
void notBoundTable(const char* tableName);
55-
void* extractCCDBPayload(char *payload, size_t size, TClass const* cl, const char* what);
55+
void* extractCCDBPayload(char* payload, size_t size, TClass const* cl, const char* what);
5656
} // namespace o2::soa
5757

58-
5958
namespace o2::soa
6059
{
6160
/// Generic identifier for a table type
@@ -2325,43 +2324,43 @@ consteval static std::string_view namespace_prefix()
23252324
}; \
23262325
[[maybe_unused]] static constexpr o2::framework::expressions::BindingNode _Getter_ { _Label_, _Name_::hash, o2::framework::expressions::selectArrowType<_Type_>() }
23272326

2328-
#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_) \
2329-
struct _Name_ : o2::soa::Column<std::span<std::byte>, _Name_> { \
2330-
static constexpr const char* mLabel = _Label_; \
2331-
static constexpr const char* query = _CCDBQuery_; \
2332-
static constexpr const uint32_t hash = crc32(namespace_prefix<_Name_>(), std::string_view{#_Getter_}); \
2333-
using base = o2::soa::Column<std::span<std::byte>, _Name_>; \
2334-
using type = std::span<std::byte>; \
2335-
using column_t = _Name_; \
2336-
_Name_(arrow::ChunkedArray const* column) \
2337-
: o2::soa::Column<std::span<std::byte>, _Name_>(o2::soa::ColumnIterator<std::span<std::byte>>(column)) \
2338-
{ \
2339-
} \
2340-
\
2341-
_Name_() = default; \
2342-
_Name_(_Name_ const& other) = default; \
2343-
_Name_& operator=(_Name_ const& other) = default; \
2344-
\
2345-
decltype(auto) _Getter_() const \
2346-
{ \
2347-
static std::byte* payload = nullptr; \
2348-
static _ConcreteType_* deserialised = nullptr; \
2349-
static TClass* c = TClass::GetClass(#_ConcreteType_); \
2350-
auto span = *mColumnIterator; \
2351-
if (payload != (std::byte*)span.data()) { \
2352-
payload = (std::byte*)span.data(); \
2353-
delete deserialised; \
2354-
TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \
2355-
deserialised = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \
2356-
} \
2357-
return *deserialised; \
2358-
} \
2359-
\
2360-
decltype(auto) \
2361-
get() const \
2362-
{ \
2363-
return _Getter_(); \
2364-
} \
2327+
#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_) \
2328+
struct _Name_ : o2::soa::Column<std::span<std::byte>, _Name_> { \
2329+
static constexpr const char* mLabel = _Label_; \
2330+
static constexpr const char* query = _CCDBQuery_; \
2331+
static constexpr const uint32_t hash = crc32(namespace_prefix<_Name_>(), std::string_view{#_Getter_}); \
2332+
using base = o2::soa::Column<std::span<std::byte>, _Name_>; \
2333+
using type = std::span<std::byte>; \
2334+
using column_t = _Name_; \
2335+
_Name_(arrow::ChunkedArray const* column) \
2336+
: o2::soa::Column<std::span<std::byte>, _Name_>(o2::soa::ColumnIterator<std::span<std::byte>>(column)) \
2337+
{ \
2338+
} \
2339+
\
2340+
_Name_() = default; \
2341+
_Name_(_Name_ const& other) = default; \
2342+
_Name_& operator=(_Name_ const& other) = default; \
2343+
\
2344+
decltype(auto) _Getter_() const \
2345+
{ \
2346+
static std::byte* payload = nullptr; \
2347+
static _ConcreteType_* deserialised = nullptr; \
2348+
static TClass* c = TClass::GetClass(#_ConcreteType_); \
2349+
auto span = *mColumnIterator; \
2350+
if (payload != (std::byte*)span.data()) { \
2351+
payload = (std::byte*)span.data(); \
2352+
delete deserialised; \
2353+
TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \
2354+
deserialised = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \
2355+
} \
2356+
return *deserialised; \
2357+
} \
2358+
\
2359+
decltype(auto) \
2360+
get() const \
2361+
{ \
2362+
return _Getter_(); \
2363+
} \
23652364
};
23662365

23672366
#define DECLARE_SOA_CCDB_COLUMN(_Name_, _Getter_, _ConcreteType_, _CCDBQuery_) \

Framework/Core/src/ASoA.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void missingOptionalPreslice(const char* label, const char* key)
177177
throw o2::framework::runtime_error_f(R"(Optional Preslice with missing binding used: table "%s" (or join based on it) does not have column "%s")", label, key);
178178
}
179179

180-
void* extractCCDBPayload(char *payload, size_t size, TClass const* cl, const char* what)
180+
void* extractCCDBPayload(char* payload, size_t size, TClass const* cl, const char* what)
181181
{
182182
Int_t previousErrorLevel = gErrorIgnoreLevel;
183183
gErrorIgnoreLevel = kFatal;

Framework/Core/src/ArrowSupport.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ o2::framework::ServiceSpec ArrowSupport::arrowBackendSpec()
455455
ac.providedTIMs.clear();
456456
ac.requestedTIMs.clear();
457457

458-
459458
auto inputSpecLessThan = [](InputSpec const& lhs, InputSpec const& rhs) { return DataSpecUtils::describe(lhs) < DataSpecUtils::describe(rhs); };
460459
auto outputSpecLessThan = [](OutputSpec const& lhs, OutputSpec const& rhs) { return DataSpecUtils::describe(lhs) < DataSpecUtils::describe(rhs); };
461460

@@ -565,8 +564,6 @@ o2::framework::ServiceSpec ArrowSupport::arrowBackendSpec()
565564
}
566565
}
567566

568-
569-
570567
// replace writer as some outputs may have become dangling and some are now consumed
571568
auto [outputsInputs, isDangling] = WorkflowHelpers::analyzeOutputs(workflow);
572569

0 commit comments

Comments
 (0)