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 40 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)
 
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
 
DescriptorId_t GetOnDiskId () 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
 
std::optional< std::pair< double, double > > GetValueRange () const
 
std::size_t GetWritePageCapacity () 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)
 
void SetBitsOnStorage (std::size_t bits)
 
void SetValueRange (double min, double max)
 
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 HandleWritePageIfFull ()
 Used when trying to append to a full write page.
 

Private Attributes

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.
 
DescriptorId_t fOnDiskId = kInvalidDescriptorId
 The column id in the column descriptor, once connected to a sink or source.
 
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
 The page into which new elements are being written.
 

#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 32 of file RColumn.cxx.

Member Function Documentation

◆ Append()

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

Definition at line 124 of file RColumn.hxx.

◆ AppendV()

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

Definition at line 136 of file RColumn.hxx.

◆ CommitSuppressed()

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

Definition at line 80 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 40 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 57 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 106 of file RColumn.hxx.

◆ Flush()

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

Definition at line 69 of file RColumn.cxx.

◆ GetBitsOnStorage()

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

Definition at line 331 of file RColumn.hxx.

◆ GetClusterIndex()

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

Definition at line 265 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 275 of file RColumn.hxx.

◆ GetCollectionInfo() [2/2]

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

Definition at line 298 of file RColumn.hxx.

◆ GetElement()

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

Definition at line 329 of file RColumn.hxx.

◆ GetFirstElementIndex()

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

Definition at line 344 of file RColumn.hxx.

◆ GetGlobalIndex()

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

Definition at line 257 of file RColumn.hxx.

◆ GetHandleSink()

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

Definition at line 348 of file RColumn.hxx.

◆ GetHandleSource()

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

Definition at line 347 of file RColumn.hxx.

◆ GetIndex()

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

Definition at line 341 of file RColumn.hxx.

◆ GetNElements()

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

Definition at line 328 of file RColumn.hxx.

◆ GetOnDiskId()

DescriptorId_t ROOT::Experimental::Internal::RColumn::GetOnDiskId ( ) const
inline

Definition at line 343 of file RColumn.hxx.

◆ GetPageSink()

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

Definition at line 346 of file RColumn.hxx.

◆ GetPageSource()

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

Definition at line 345 of file RColumn.hxx.

◆ GetRepresentationIndex()

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

Definition at line 342 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 308 of file RColumn.hxx.

◆ GetType()

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

Definition at line 330 of file RColumn.hxx.

◆ GetValueRange()

std::optional< std::pair< double, double > > ROOT::Experimental::Internal::RColumn::GetValueRange ( ) const
inline

Definition at line 336 of file RColumn.hxx.

◆ GetWritePageCapacity()

std::size_t ROOT::Experimental::Internal::RColumn::GetWritePageCapacity ( ) const
inline

Definition at line 351 of file RColumn.hxx.

◆ HandleWritePageIfFull()

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

Used when trying to append to a full write page.

If possible, expand the page. Otherwise, flush and reset to the minimal size.

Definition at line 79 of file RColumn.hxx.

◆ Map() [1/2]

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

Definition at line 219 of file RColumn.hxx.

◆ Map() [2/2]

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

Definition at line 226 of file RColumn.hxx.

◆ MapPage() [1/2]

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

Definition at line 318 of file RColumn.hxx.

◆ MapPage() [2/2]

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

Definition at line 319 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 233 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 245 of file RColumn.hxx.

◆ MergeTeams()

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

Definition at line 115 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 158 of file RColumn.hxx.

◆ Read() [2/2]

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

Definition at line 169 of file RColumn.hxx.

◆ ReadPageContains() [1/2]

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

Definition at line 323 of file RColumn.hxx.

◆ ReadPageContains() [2/2]

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

Definition at line 324 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 180 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 199 of file RColumn.hxx.

◆ SetBitsOnStorage()

void ROOT::Experimental::Internal::RColumn::SetBitsOnStorage ( std::size_t  bits)
inline

Definition at line 350 of file RColumn.hxx.

◆ SetValueRange()

void ROOT::Experimental::Internal::RColumn::SetValueRange ( double  min,
double  max 
)
inline

Definition at line 352 of file RColumn.hxx.

◆ TryMapPage() [1/2]

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

Definition at line 85 of file RColumn.cxx.

◆ TryMapPage() [2/2]

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

Definition at line 100 of file RColumn.cxx.

Member Data Documentation

◆ fElement

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

Used to pack and unpack pages on writing/reading.

Definition at line 66 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 64 of file RColumn.hxx.

◆ fHandleSink

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

Definition at line 50 of file RColumn.hxx.

◆ fHandleSource

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

Definition at line 51 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 45 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 73 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 58 of file RColumn.hxx.

◆ fOnDiskId

DescriptorId_t ROOT::Experimental::Internal::RColumn::fOnDiskId = kInvalidDescriptorId
private

The column id in the column descriptor, once connected to a sink or source.

Definition at line 62 of file RColumn.hxx.

◆ fPageSink

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

Definition at line 48 of file RColumn.hxx.

◆ fPageSource

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

Definition at line 49 of file RColumn.hxx.

◆ fReadPageRef

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

The currently mapped page for reading.

Definition at line 60 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 47 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 71 of file RColumn.hxx.

◆ fType

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

Definition at line 42 of file RColumn.hxx.

◆ fWritePage

RPage ROOT::Experimental::Internal::RColumn::fWritePage
private

The page into which new elements are being written.

The page will initially be small (just enough to hold RNTupleWriteOptions::fInitialNElementsPerPage elements) and expand as needed and as memory for page buffers is still available (RNTupleWriteOptions::fPageBufferBudget) or the maximum page size is reached (RNTupleWriteOptions::fMaxUnzippedPageSize).

Definition at line 56 of file RColumn.hxx.

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

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