24#include <unordered_map>
30 std::uint64_t fFirstEntry = 0;
31 std::uint32_t fNPages = 0;
32 std::uint32_t fNEntries = 0;
33 std::uint32_t fBytesOnStorage = 0;
34 std::uint32_t fBytesInMemory = 0;
37 return fFirstEntry ==
other.fFirstEntry;
41 return fFirstEntry <
other.fFirstEntry;
49 std::uint64_t fLocalOrder = 0;
50 std::uint64_t fNElements = 0;
51 std::uint64_t fNPages = 0;
52 std::uint64_t fBytesOnStorage = 0;
53 std::uint32_t fElementSize = 0;
55 std::string fFieldName;
56 std::string fFieldDescription;
59 if (fFieldName ==
other.fFieldName)
60 return fLocalOrder <
other.fLocalOrder;
61 return fFieldName <
other.fFieldName;
85 std::vector<ColumnInfo>
columns;
87 std::unordered_map<DescriptorId_t, unsigned int>
cluster2Idx;
90 info.fFirstEntry =
cluster.second.GetFirstEntryIndex();
103 if (column.second.IsAliasColumn())
111 info.fPhysicalColumnId = column.second.GetPhysicalId();
112 info.fLogicalColumnId = column.second.GetLogicalId();
113 info.fFieldId = column.second.GetFieldId();
114 info.fLocalOrder = column.second.GetIndex();
116 info.fType = column.second.GetModel().GetType();
124 const auto &
pageRange =
cluster.second.GetPageRange(column.second.GetPhysicalId());
129 clusters[idx].fBytesOnStorage +=
page.fLocator.fBytesOnStorage;
132 info.fBytesOnStorage +=
page.fLocator.fBytesOnStorage;
141 output <<
"============================================================" << std::endl;
144 output <<
"------------------------------------------------------------" << std::endl;
152 output <<
" Compression rate: " << std::fixed << std::setprecision(2)
156 output <<
" Meta-data / data: " << std::fixed << std::setprecision(3)
158 output <<
"------------------------------------------------------------" << std::endl;
159 output <<
"CLUSTER DETAILS" << std::endl;
160 output <<
"------------------------------------------------------------" << std::endl;
163 for (
unsigned int i = 0; i <
clusters.size(); ++i) {
164 output <<
" # " << std::setw(5) << i
165 <<
" Entry range: [" <<
clusters[i].fFirstEntry <<
".."
168 <<
" # Pages: " <<
clusters[i].fNPages << std::endl;
170 <<
" Size on storage: " <<
clusters[i].fBytesOnStorage <<
" B" << std::endl;
172 <<
" Compression: " << std::fixed << std::setprecision(2)
173 << float(
clusters[i].fBytesInMemory) / float(
float(
clusters[i].fBytesOnStorage)) << std::endl;
176 output <<
"------------------------------------------------------------" << std::endl;
177 output <<
"COLUMN DETAILS" << std::endl;
178 output <<
"------------------------------------------------------------" << std::endl;
180 col.fFieldName = GetFieldName(col.fFieldId, *
this).substr(1);
181 col.fFieldDescription = GetFieldDescription(col.fFieldId, *
this);
184 for (
const auto &col :
columns) {
185 auto avgPageSize = (col.fNPages == 0) ? 0 : (col.fBytesOnStorage / col.fNPages);
187 std::string
nameAndType = std::string(
" ") + col.fFieldName +
" [#" + std::to_string(col.fLocalOrder) +
"]" +
189 std::string
id = std::string(
"{id:") + std::to_string(col.fLogicalColumnId) +
"}";
190 if (col.fLogicalColumnId != col.fPhysicalColumnId)
191 id +=
" --alias--> " + std::to_string(col.fPhysicalColumnId);
193 if (!col.fFieldDescription.empty())
194 output <<
" Description: " << col.fFieldDescription << std::endl;
195 output <<
" # Elements: " << col.fNElements << std::endl;
196 output <<
" # Pages: " << col.fNPages << std::endl;
199 output <<
" Size on storage: " << col.fBytesOnStorage <<
" B" << std::endl;
200 output <<
" Compression: " << std::fixed << std::setprecision(2)
201 << float(col.fElementSize * col.fNElements) / float(col.fBytesOnStorage) << std::endl;
202 output <<
"............................................................" << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t operator<(const TDatime &d1, const TDatime &d2)
Bool_t operator==(const TDatime &d1, const TDatime &d2)
The available trivial, native content types of a column.
static std::string GetTypeName(EColumnType type)
static std::unique_ptr< RColumnElementBase > Generate(EColumnType type)
If CppT == void, use the default C++ type for the given column type.
The on-storage meta-data of an ntuple.
std::unordered_map< DescriptorId_t, RClusterDescriptor > fClusterDescriptors
May contain only a subset of all the available clusters, e.g.
std::size_t GetNLogicalColumns() const
std::string GetName() const
std::uint64_t GetOnDiskHeaderSize() const
std::size_t GetNClusters() const
std::unordered_map< DescriptorId_t, RColumnDescriptor > fColumnDescriptors
NTupleSize_t GetNEntries() const
We know the number of entries from adding the cluster summaries.
std::size_t GetNFields() const
std::uint64_t GetOnDiskFooterSize() const
std::size_t GetNPhysicalColumns() const
void PrintInfo(std::ostream &output) const
const_iterator begin() const
const_iterator end() const
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr DescriptorId_t kInvalidDescriptorId