Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::RColumn Class Reference

A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into memory.

Definition at line 42 of file RColumn.hxx.

Public Member Functions

 RColumn (const RColumn &)=delete
 
 ~RColumn ()
 
void Append (const void *from)
 
void AppendV (const void *from, std::size_t count)
 
void CommitSuppressed ()
 
void ConnectPageSink (DescriptorId_t fieldId, RPageSink &pageSink, NTupleSize_t firstElementIndex=0U)
 Connect the column to a page sink.
 
void ConnectPageSource (DescriptorId_t fieldId, RPageSource &pageSource)
 Connect the column to a page source.
 
void Flush ()
 
std::uint16_t GetBitsOnStorage () const
 
RClusterIndex GetClusterIndex (NTupleSize_t globalIndex)
 
void GetCollectionInfo (const NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
 For offset columns only, look at the two adjacent values that define a collection's coordinates.
 
void GetCollectionInfo (RClusterIndex clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
 
ColumnId_t GetColumnIdSource () const
 
RColumnElementBaseGetElement () const
 
NTupleSize_t GetFirstElementIndex () const
 
NTupleSize_t GetGlobalIndex (RClusterIndex clusterIndex)
 
RPageStorage::ColumnHandle_t GetHandleSink () const
 
RPageStorage::ColumnHandle_t GetHandleSource () const
 
std::uint32_t GetIndex () const
 
NTupleSize_t GetNElements () const
 
RPageSinkGetPageSink () const
 
RPageSourceGetPageSource () const
 
std::uint16_t GetRepresentationIndex () const
 
void GetSwitchInfo (NTupleSize_t globalIndex, RClusterIndex *varIndex, std::uint32_t *tag)
 Get the currently active cluster id.
 
EColumnType GetType () const
 
template<typename CppT >
CppT * Map (const NTupleSize_t globalIndex)
 
template<typename CppT >
CppT * Map (RClusterIndex clusterIndex)
 
void MapPage (NTupleSize_t globalIndex)
 
void MapPage (RClusterIndex clusterIndex)
 
template<typename CppT >
CppT * MapV (const NTupleSize_t globalIndex, NTupleSize_t &nItems)
 
template<typename CppT >
CppT * MapV (RClusterIndex clusterIndex, NTupleSize_t &nItems)
 
void MergeTeams (RColumn &other)
 
RColumnoperator= (const RColumn &)=delete
 
void Read (const NTupleSize_t globalIndex, void *to)
 
void Read (RClusterIndex clusterIndex, void *to)
 
bool ReadPageContains (NTupleSize_t globalIndex) const
 
bool ReadPageContains (RClusterIndex clusterIndex) const
 
void ReadV (const NTupleSize_t globalIndex, const ClusterSize_t::ValueType count, void *to)
 
void ReadV (RClusterIndex clusterIndex, const ClusterSize_t::ValueType count, void *to)
 
bool TryMapPage (NTupleSize_t globalIndex)
 
bool TryMapPage (RClusterIndex clusterIndex)
 

Static Public Member Functions

template<typename CppT >
static std::unique_ptr< RColumnCreate (EColumnType type, std::uint32_t columnIdx, std::uint16_t representationIdx)
 

Private Member Functions

 RColumn (EColumnType type, std::uint32_t columnIndex, std::uint16_t representationIndex)
 
void FlushShadowWritePage ()
 When the main write page surpasses the 50% fill level, the (full) shadow write page gets flushed.
 
void HandleWritePageIfFull ()
 Used in Append() and AppendV() to handle the case when the main page reached the target size.
 

Private Attributes

std::uint32_t fApproxNElementsPerPage = 0
 For writing, the targeted number of elements, given by fApproxNElementsPerPage (in the write options) and the element size.
 
std::uint16_t fBitsOnStorage = 0
 
ColumnId_t fColumnIdSource = kInvalidColumnId
 The column id is used to find matching pages with content when reading.
 
std::unique_ptr< RColumnElementBasefElement
 Used to pack and unpack pages on writing/reading.
 
NTupleSize_t fFirstElementIndex = 0
 Global index of the first element in this column; usually == 0, unless it is a deferred column.
 
RPageStorage::ColumnHandle_t fHandleSink
 
RPageStorage::ColumnHandle_t fHandleSource
 
std::uint32_t fIndex
 Columns belonging to the same field are distinguished by their order.
 
std::size_t fLastGoodTeamIdx = 0
 Points into fTeam to the column that successfully returned the last page.
 
NTupleSize_t fNElements = 0
 The number of elements written resp. available in the column.
 
RPageSinkfPageSink = nullptr
 
RPageSourcefPageSource = nullptr
 
RPageRef fReadPageRef
 The currently mapped page for reading.
 
std::uint16_t fRepresentationIndex
 Fields can have multiple column representations, distinguished by representation index.
 
std::vector< RColumn * > fTeam
 The column team is a set of columns that serve the same column index for different representation IDs.
 
EColumnType fType
 
RPage fWritePage [2]
 A set of open pages into which new elements are being written.
 
int fWritePageIdx = 0
 Index of the current write page.
 

#include <ROOT/RColumn.hxx>

Constructor & Destructor Documentation

◆ RColumn() [1/2]

ROOT::Experimental::Internal::RColumn::RColumn ( EColumnType  type,
std::uint32_t  columnIndex,
std::uint16_t  representationIndex 
)
private

Definition at line 26 of file RColumn.cxx.

◆ RColumn() [2/2]

ROOT::Experimental::Internal::RColumn::RColumn ( const RColumn )
delete

◆ ~RColumn()

ROOT::Experimental::Internal::RColumn::~RColumn ( )

Definition at line 36 of file RColumn.cxx.

Member Function Documentation

◆ Append()

void ROOT::Experimental::Internal::RColumn::Append ( const void *  from)
inline

Definition at line 141 of file RColumn.hxx.

◆ AppendV()

void ROOT::Experimental::Internal::RColumn::AppendV ( const void *  from,
std::size_t  count 
)
inline

Definition at line 155 of file RColumn.hxx.

◆ CommitSuppressed()

void ROOT::Experimental::Internal::RColumn::CommitSuppressed ( )

Definition at line 98 of file RColumn.cxx.

◆ ConnectPageSink()

void ROOT::Experimental::Internal::RColumn::ConnectPageSink ( DescriptorId_t  fieldId,
RPageSink pageSink,
NTupleSize_t  firstElementIndex = 0U 
)

Connect the column to a page sink.

firstElementIndex can be used to specify the first column element index with backing storage for this column. On read back, elements before firstElementIndex will cause the zero page to be mapped.

Definition at line 44 of file RColumn.cxx.

◆ ConnectPageSource()

void ROOT::Experimental::Internal::RColumn::ConnectPageSource ( DescriptorId_t  fieldId,
RPageSource pageSource 
)

Connect the column to a page source.

Definition at line 65 of file RColumn.cxx.

◆ Create()

template<typename CppT >
static std::unique_ptr< RColumn > ROOT::Experimental::Internal::RColumn::Create ( EColumnType  type,
std::uint32_t  columnIdx,
std::uint16_t  representationIdx 
)
inlinestatic

Definition at line 123 of file RColumn.hxx.

◆ Flush()

void ROOT::Experimental::Internal::RColumn::Flush ( )

Definition at line 77 of file RColumn.cxx.

◆ FlushShadowWritePage()

void ROOT::Experimental::Internal::RColumn::FlushShadowWritePage ( )
inlineprivate

When the main write page surpasses the 50% fill level, the (full) shadow write page gets flushed.

Definition at line 110 of file RColumn.hxx.

◆ GetBitsOnStorage()

std::uint16_t ROOT::Experimental::Internal::RColumn::GetBitsOnStorage ( ) const
inline

Definition at line 359 of file RColumn.hxx.

◆ GetClusterIndex()

RClusterIndex ROOT::Experimental::Internal::RColumn::GetClusterIndex ( NTupleSize_t  globalIndex)
inline

Definition at line 293 of file RColumn.hxx.

◆ GetCollectionInfo() [1/2]

void ROOT::Experimental::Internal::RColumn::GetCollectionInfo ( const NTupleSize_t  globalIndex,
RClusterIndex collectionStart,
ClusterSize_t collectionSize 
)
inline

For offset columns only, look at the two adjacent values that define a collection's coordinates.

Definition at line 303 of file RColumn.hxx.

◆ GetCollectionInfo() [2/2]

void ROOT::Experimental::Internal::RColumn::GetCollectionInfo ( RClusterIndex  clusterIndex,
RClusterIndex collectionStart,
ClusterSize_t collectionSize 
)
inline

Definition at line 326 of file RColumn.hxx.

◆ GetColumnIdSource()

ColumnId_t ROOT::Experimental::Internal::RColumn::GetColumnIdSource ( ) const
inline

Definition at line 362 of file RColumn.hxx.

◆ GetElement()

RColumnElementBase * ROOT::Experimental::Internal::RColumn::GetElement ( ) const
inline

Definition at line 357 of file RColumn.hxx.

◆ GetFirstElementIndex()

NTupleSize_t ROOT::Experimental::Internal::RColumn::GetFirstElementIndex ( ) const
inline

Definition at line 363 of file RColumn.hxx.

◆ GetGlobalIndex()

NTupleSize_t ROOT::Experimental::Internal::RColumn::GetGlobalIndex ( RClusterIndex  clusterIndex)
inline

Definition at line 285 of file RColumn.hxx.

◆ GetHandleSink()

RPageStorage::ColumnHandle_t ROOT::Experimental::Internal::RColumn::GetHandleSink ( ) const
inline

Definition at line 367 of file RColumn.hxx.

◆ GetHandleSource()

RPageStorage::ColumnHandle_t ROOT::Experimental::Internal::RColumn::GetHandleSource ( ) const
inline

Definition at line 366 of file RColumn.hxx.

◆ GetIndex()

std::uint32_t ROOT::Experimental::Internal::RColumn::GetIndex ( ) const
inline

Definition at line 360 of file RColumn.hxx.

◆ GetNElements()

NTupleSize_t ROOT::Experimental::Internal::RColumn::GetNElements ( ) const
inline

Definition at line 356 of file RColumn.hxx.

◆ GetPageSink()

RPageSink * ROOT::Experimental::Internal::RColumn::GetPageSink ( ) const
inline

Definition at line 365 of file RColumn.hxx.

◆ GetPageSource()

RPageSource * ROOT::Experimental::Internal::RColumn::GetPageSource ( ) const
inline

Definition at line 364 of file RColumn.hxx.

◆ GetRepresentationIndex()

std::uint16_t ROOT::Experimental::Internal::RColumn::GetRepresentationIndex ( ) const
inline

Definition at line 361 of file RColumn.hxx.

◆ GetSwitchInfo()

void ROOT::Experimental::Internal::RColumn::GetSwitchInfo ( NTupleSize_t  globalIndex,
RClusterIndex varIndex,
std::uint32_t *  tag 
)
inline

Get the currently active cluster id.

Definition at line 336 of file RColumn.hxx.

◆ GetType()

EColumnType ROOT::Experimental::Internal::RColumn::GetType ( ) const
inline

Definition at line 358 of file RColumn.hxx.

◆ HandleWritePageIfFull()

void ROOT::Experimental::Internal::RColumn::HandleWritePageIfFull ( )
inlineprivate

Used in Append() and AppendV() to handle the case when the main page reached the target size.

If tail page optimization is enabled, switch the pages; the other page has been flushed when the main page reached 50%. Without tail page optimization, flush the current page to make room for future writes.

Definition at line 92 of file RColumn.hxx.

◆ Map() [1/2]

template<typename CppT >
CppT * ROOT::Experimental::Internal::RColumn::Map ( const NTupleSize_t  globalIndex)
inline

Definition at line 246 of file RColumn.hxx.

◆ Map() [2/2]

template<typename CppT >
CppT * ROOT::Experimental::Internal::RColumn::Map ( RClusterIndex  clusterIndex)
inline

Definition at line 253 of file RColumn.hxx.

◆ MapPage() [1/2]

void ROOT::Experimental::Internal::RColumn::MapPage ( NTupleSize_t  globalIndex)
inline

Definition at line 346 of file RColumn.hxx.

◆ MapPage() [2/2]

void ROOT::Experimental::Internal::RColumn::MapPage ( RClusterIndex  clusterIndex)
inline

Definition at line 347 of file RColumn.hxx.

◆ MapV() [1/2]

template<typename CppT >
CppT * ROOT::Experimental::Internal::RColumn::MapV ( const NTupleSize_t  globalIndex,
NTupleSize_t nItems 
)
inline

Definition at line 260 of file RColumn.hxx.

◆ MapV() [2/2]

template<typename CppT >
CppT * ROOT::Experimental::Internal::RColumn::MapV ( RClusterIndex  clusterIndex,
NTupleSize_t nItems 
)
inline

Definition at line 273 of file RColumn.hxx.

◆ MergeTeams()

void ROOT::Experimental::Internal::RColumn::MergeTeams ( RColumn other)

Definition at line 133 of file RColumn.cxx.

◆ operator=()

RColumn & ROOT::Experimental::Internal::RColumn::operator= ( const RColumn )
delete

◆ Read() [1/2]

void ROOT::Experimental::Internal::RColumn::Read ( const NTupleSize_t  globalIndex,
void *  to 
)
inline

Definition at line 185 of file RColumn.hxx.

◆ Read() [2/2]

void ROOT::Experimental::Internal::RColumn::Read ( RClusterIndex  clusterIndex,
void *  to 
)
inline

Definition at line 196 of file RColumn.hxx.

◆ ReadPageContains() [1/2]

bool ROOT::Experimental::Internal::RColumn::ReadPageContains ( NTupleSize_t  globalIndex) const
inline

Definition at line 351 of file RColumn.hxx.

◆ ReadPageContains() [2/2]

bool ROOT::Experimental::Internal::RColumn::ReadPageContains ( RClusterIndex  clusterIndex) const
inline

Definition at line 352 of file RColumn.hxx.

◆ ReadV() [1/2]

void ROOT::Experimental::Internal::RColumn::ReadV ( const NTupleSize_t  globalIndex,
const ClusterSize_t::ValueType  count,
void *  to 
)
inline

Definition at line 207 of file RColumn.hxx.

◆ ReadV() [2/2]

void ROOT::Experimental::Internal::RColumn::ReadV ( RClusterIndex  clusterIndex,
const ClusterSize_t::ValueType  count,
void *  to 
)
inline

Definition at line 226 of file RColumn.hxx.

◆ TryMapPage() [1/2]

bool ROOT::Experimental::Internal::RColumn::TryMapPage ( NTupleSize_t  globalIndex)

Definition at line 103 of file RColumn.cxx.

◆ TryMapPage() [2/2]

bool ROOT::Experimental::Internal::RColumn::TryMapPage ( RClusterIndex  clusterIndex)

Definition at line 118 of file RColumn.cxx.

Member Data Documentation

◆ fApproxNElementsPerPage

std::uint32_t ROOT::Experimental::Internal::RColumn::fApproxNElementsPerPage = 0
private

For writing, the targeted number of elements, given by fApproxNElementsPerPage (in the write options) and the element size.

We ensure this value to be >= 2 in Connect() so that we have meaningful "page full" and "page half full" events when writing the page.

Definition at line 67 of file RColumn.hxx.

◆ fBitsOnStorage

std::uint16_t ROOT::Experimental::Internal::RColumn::fBitsOnStorage = 0
private

Definition at line 45 of file RColumn.hxx.

◆ fColumnIdSource

ColumnId_t ROOT::Experimental::Internal::RColumn::fColumnIdSource = kInvalidColumnId
private

The column id is used to find matching pages with content when reading.

Definition at line 73 of file RColumn.hxx.

◆ fElement

std::unique_ptr<RColumnElementBase> ROOT::Experimental::Internal::RColumn::fElement
private

Used to pack and unpack pages on writing/reading.

Definition at line 77 of file RColumn.hxx.

◆ fFirstElementIndex

NTupleSize_t ROOT::Experimental::Internal::RColumn::fFirstElementIndex = 0
private

Global index of the first element in this column; usually == 0, unless it is a deferred column.

Definition at line 75 of file RColumn.hxx.

◆ fHandleSink

RPageStorage::ColumnHandle_t ROOT::Experimental::Internal::RColumn::fHandleSink
private

Definition at line 53 of file RColumn.hxx.

◆ fHandleSource

RPageStorage::ColumnHandle_t ROOT::Experimental::Internal::RColumn::fHandleSource
private

Definition at line 54 of file RColumn.hxx.

◆ fIndex

std::uint32_t ROOT::Experimental::Internal::RColumn::fIndex
private

Columns belonging to the same field are distinguished by their order.

E.g. for an std::string field, there is the offset column with index 0 and the character value column with index 1.

Definition at line 48 of file RColumn.hxx.

◆ fLastGoodTeamIdx

std::size_t ROOT::Experimental::Internal::RColumn::fLastGoodTeamIdx = 0
private

Points into fTeam to the column that successfully returned the last page.

Definition at line 84 of file RColumn.hxx.

◆ fNElements

NTupleSize_t ROOT::Experimental::Internal::RColumn::fNElements = 0
private

The number of elements written resp. available in the column.

Definition at line 69 of file RColumn.hxx.

◆ fPageSink

RPageSink* ROOT::Experimental::Internal::RColumn::fPageSink = nullptr
private

Definition at line 51 of file RColumn.hxx.

◆ fPageSource

RPageSource* ROOT::Experimental::Internal::RColumn::fPageSource = nullptr
private

Definition at line 52 of file RColumn.hxx.

◆ fReadPageRef

RPageRef ROOT::Experimental::Internal::RColumn::fReadPageRef
private

The currently mapped page for reading.

Definition at line 71 of file RColumn.hxx.

◆ fRepresentationIndex

std::uint16_t ROOT::Experimental::Internal::RColumn::fRepresentationIndex
private

Fields can have multiple column representations, distinguished by representation index.

Definition at line 50 of file RColumn.hxx.

◆ fTeam

std::vector<RColumn *> ROOT::Experimental::Internal::RColumn::fTeam
private

The column team is a set of columns that serve the same column index for different representation IDs.

Initially, the team has only one member, the very column it belongs to. Through MergeTeams(), two columns can join forces. The team is used to react on suppressed columns: if the current team member has a suppressed column for a MapPage() call, it get the page from the active column in the corresponding cluster.

Definition at line 82 of file RColumn.hxx.

◆ fType

EColumnType ROOT::Experimental::Internal::RColumn::fType
private

Definition at line 44 of file RColumn.hxx.

◆ fWritePage

RPage ROOT::Experimental::Internal::RColumn::fWritePage[2]
private

A set of open pages into which new elements are being written.

The pages are used in rotation. If tail page optimization is enabled, they are 50% bigger than the target size given by the write options. The current page is filled until the target size, but it is only committed once the other write page is filled at least 50%. If a flush occurs earlier, a slightly oversized, single page will be committed. Without tail page optimization, only one page is allocated equal to the target size.

Definition at line 61 of file RColumn.hxx.

◆ fWritePageIdx

int ROOT::Experimental::Internal::RColumn::fWritePageIdx = 0
private

Index of the current write page.

Definition at line 63 of file RColumn.hxx.

Libraries for ROOT::Experimental::Internal::RColumn:

The documentation for this class was generated from the following files: