|
ROOT
Reference Guide |
|
Go to the documentation of this file.
16 #ifndef ROOT7_RPageStorage
17 #define ROOT7_RPageStorage
30 #include <unordered_set>
33 namespace Experimental {
220 virtual std::unique_ptr<RPageSource>
Clone()
const = 0;
Common user-tunable settings for storing ntuples.
virtual RNTupleDescriptor AttachImpl()=0
RPageStorage(const RPageStorage &other)=delete
A page is a slice of a column that is mapped into memory.
virtual void UnzipClusterImpl(RCluster *)
A collection of Counter objects with a name, a unit, and a description.
The interface of a task scheduler to schedule page (de)compression tasks.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const RNTupleReadOptions &options=RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
void CommitPage(ColumnHandle_t columnHandle, const RPage &page)
Write a page to the storage. The column must have been added before.
RPageSink(RPageSink &&)=default
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
Common functionality of an ntuple storage for both reading and writing.
ColumnSet_t fActiveColumns
The active columns are implicitly defined by the model fields or views.
void DropColumn(ColumnHandle_t) final
Unregisters a column.
basic_string_view< char > string_view
ColumnHandle_t AddColumn(DescriptorId_t fieldId, const RColumn &column) final
Register a new column.
std::vector< RClusterDescriptor::RPageRange > fOpenPageRanges
Keeps track of the written pages in the currently open cluster. Indexed by column id.
virtual void Reset()=0
Start a new set of tasks.
DescriptorId_t fLastClusterId
void SetTaskScheduler(RTaskScheduler *taskScheduler)
std::unordered_set< DescriptorId_t > ColumnSet_t
Derived from the model (fields) that are actually being requested at a given point in time.
A helper class for piece-wise construction of an RNTupleDescriptor.
virtual RClusterDescriptor::RLocator CommitPageImpl(ColumnHandle_t columnHandle, const RPage &page)=0
RTaskScheduler * fTaskScheduler
RNTupleDescriptorBuilder fDescriptorBuilder
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Common user-tunable settings for reading ntuples.
Abstract interface to read data from an ntuple.
DescriptorId_t fLastColumnId
void Attach()
Open the physical storage container for the tree.
RPageSink(const RPageSink &)=delete
virtual std::unique_ptr< RPageSource > Clone() const =0
Open the same storage multiple time, e.g. for reading in multiple threads.
A field translates read and write calls from/to underlying columns to/from tree values.
virtual RPage PopulatePage(ColumnHandle_t columnHandle, const RClusterIndex &clusterIndex)=0
Another version of PopulatePage that allows to specify cluster-relative indexes.
RPageStorage(std::string_view name)
The on-storage meta-data of an ntuple.
RColumnHandle ColumnHandle_t
The column handle identifies a column with the current open page storage.
DescriptorId_t fLastFieldId
Building the ntuple descriptor while writing is done in the same way for all the storage sink impleme...
NTupleSize_t GetNElements(ColumnHandle_t columnHandle)
ColumnHandle_t AddColumn(DescriptorId_t fieldId, const RColumn &column) final
Register a new column.
RPageSource(std::string_view ntupleName, const RNTupleReadOptions &fOptions)
virtual RClusterDescriptor::RLocator CommitClusterImpl(NTupleSize_t nEntries)=0
RPageSink & operator=(const RPageSink &)=delete
RPageSource(const RPageSource &)=delete
const RNTupleDescriptor & GetDescriptor() const
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
RPageStorage(RPageStorage &&other)=default
The RNTupleModel encapulates the schema of an ntuple.
RPageSource(RPageSource &&)=default
static std::unique_ptr< RPageSink > Create(std::string_view ntupleName, std::string_view location, const RNTupleWriteOptions &options=RNTupleWriteOptions())
Guess the concrete derived page source from the file name (location)
virtual void CreateImpl(const RNTupleModel &model)=0
RPageSink & operator=(RPageSink &&)=default
Abstract interface to write data into an ntuple.
virtual EPageStorageType GetType()=0
Whether the concrete implementation is a sink or a source.
RPageSink(std::string_view ntupleName, const RNTupleWriteOptions &options)
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
NTupleSize_t GetNEntries()
void DropColumn(ColumnHandle_t columnHandle) final
Unregisters a column.
ColumnId_t GetColumnId(ColumnHandle_t columnHandle)
RPageStorage & operator=(const RPageStorage &other)=delete
virtual void ReleasePage(RPage &page)=0
Every page store needs to be able to free pages it handed out.
RNTupleDescriptor fDescriptor
void CommitCluster(NTupleSize_t nEntries)
Finalize the current cluster and create a new one for the following data.
Generic information about the physical location of data.
RNTupleWriteOptions fOptions
void UnzipCluster(RCluster *cluster)
Parallel decompression and unpacking of the pages in the given cluster.
virtual RPage ReservePage(ColumnHandle_t columnHandle, std::size_t nElements=0)=0
Get a new, empty page for the given column that can be filled with up to nElements.
constexpr DescriptorId_t kInvalidDescriptorId
virtual ~RTaskScheduler()=default
EPageStorageType GetType() final
Whether the concrete implementation is a sink or a source.
virtual void CommitDatasetImpl()=0
A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into ...
virtual RPage PopulatePage(ColumnHandle_t columnHandle, NTupleSize_t globalIndex)=0
Allocates and fills a page that contains the index-th element.
virtual ColumnHandle_t AddColumn(DescriptorId_t fieldId, const RColumn &column)=0
Register a new column.
virtual std::unique_ptr< RCluster > LoadCluster(DescriptorId_t clusterId, const ColumnSet_t &columns)=0
Populates all the pages of the given cluster id and columns; it is possible that some columns do not ...
virtual void AddTask(const std::function< void(void)> &taskFunc)=0
Take a callable that represents a task.
std::int64_t ColumnId_t
Uniquely identifies a physical column within the scope of the current process, used to tag pages.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
RNTupleReadOptions fOptions
EPageStorageType GetType() final
Whether the concrete implementation is a sink or a source.
An in-memory subset of the packed and compressed pages of a cluster.
NTupleSize_t fPrevClusterNEntries
virtual void DropColumn(ColumnHandle_t columnHandle)=0
Unregisters a column.
std::vector< RClusterDescriptor::RColumnRange > fOpenColumnRanges
Keeps track of the number of elements in the currently open cluster. Indexed by column id.
void CommitDataset()
Finalize the current cluster and the entrire data set.
RPageSource & operator=(const RPageSource &)=delete
virtual RNTupleMetrics & GetMetrics()
Returns an empty metrics. Page storage implementations usually have their own metrics.
virtual void Wait()=0
Blocks until all scheduled tasks finished.
RPageSource & operator=(RPageSource &&)=default