Skip to content

Commit

Permalink
[dataset] rename RForest RDataSet root-project#4 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
jblomer committed May 12, 2019
1 parent 1124e26 commit ef23679
Show file tree
Hide file tree
Showing 20 changed files with 152 additions and 148 deletions.
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RColumn.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Detail {
// clang-format off
/**
\class ROOT::Experimental::RColumn
\ingroup Forest
\ingroup DataSet
\brief A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into memory.
On the primitives data layer, the RColumn and RColumnElement are the equivalents to RField and RTreeValue on the
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RColumnElement.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Detail {
// clang-format off
/**
\class ROOT::Experimental::Detail::RColumnElement
\ingroup Forest
\ingroup DataSet
\brief A column element points either to the content of an RFieldValue or into a memory mapped page.
The content pointed to by fRawContent can be a single element or the first element of an array.
Expand Down
4 changes: 2 additions & 2 deletions tree/dataset/v7/inc/ROOT/RColumnModel.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RColumnElementBase;
// clang-format off
/**
\class ROOT::Experimental::EColumnType
\ingroup Forest
\ingroup DataSet
\brief The available trivial, native content types of a column
More complex types, such as classes, get translated into columns of such simple types by the RField.
Expand Down Expand Up @@ -62,7 +62,7 @@ constexpr std::size_t kColumnElementSizes[] =
// clang-format off
/**
\class ROOT::Experimental::RColumnModel
\ingroup Forest
\ingroup DataSet
\brief Holds the static meta-data of a column in a tree
*/
// clang-format on
Expand Down
8 changes: 4 additions & 4 deletions tree/dataset/v7/inc/ROOT/RDataSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Detail {
// clang-format off
/**
\class ROOT::Experimental::RForest
\ingroup Forest
\ingroup DataSet
\brief The RForest represents a live dataset, whose structure is defined by an RForestModel
RForest connects the static information of the RForestModel to a source or sink on physical storage.
Expand Down Expand Up @@ -82,7 +82,7 @@ enum class EForestInfo {
// clang-format off
/**
\class ROOT::Experimental::RInputForest
\ingroup Forest
\ingroup DataSet
\brief An RForest that is used to read data from storage
An input forest provides data from storage as C++ objects. The forest model can be created from the data on storage
Expand Down Expand Up @@ -158,7 +158,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::ROutputForest
\ingroup Forest
\ingroup DataSet
\brief An RForest that gets filled with entries (data) and writes them to storage
An output forest can be filled with entries. The caller has to make sure that the data that gets filled into a forest
Expand Down Expand Up @@ -201,7 +201,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::RCollectionForest
\ingroup Forest
\ingroup DataSet
\brief A virtual forest for collections that can be used to some extent like a real forest
*
* This class is between a field and a forest. It carries the offset column for the collection and the default entry
Expand Down
24 changes: 12 additions & 12 deletions tree/dataset/v7/inc/ROOT/RDataSetDescriptor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
namespace ROOT {
namespace Experimental {

class RForestDescriptorBuilder;
class RDataSetDescriptorBuilder;

class RFieldDescriptor {
friend class RForestDescriptorBuilder;
friend class RDataSetDescriptorBuilder;

private:
DescriptorId_t fFieldId = kInvalidDescriptorId;
Expand Down Expand Up @@ -60,7 +60,7 @@ public:


class RColumnDescriptor {
friend class RForestDescriptorBuilder;
friend class RDataSetDescriptorBuilder;

private:
DescriptorId_t fColumnId = kInvalidDescriptorId;;
Expand All @@ -84,7 +84,7 @@ public:


class RClusterDescriptor {
friend class RForestDescriptorBuilder;
friend class RDataSetDescriptorBuilder;

public:
struct RColumnInfo {
Expand All @@ -110,11 +110,11 @@ public:


/**
* Represents the on-disk (on storage) information about a forest. This can, for instance, be used
* Represents the on-disk (on storage) information about a data set. This can, for instance, be used
* by 3rd party utilies.
*/
class RForestDescriptor {
friend class RForestDescriptorBuilder;
class RDataSetDescriptor {
friend class RDataSetDescriptorBuilder;

private:
RForestVersion fVersion;
Expand All @@ -137,16 +137,16 @@ public:


/**
* Used by RPageStorage implementations in order to construct the RForestDescriptor from the various header parts.
* Used by RPageStorage implementations in order to construct the RDataSetDescriptor from the various header parts.
*/
class RForestDescriptorBuilder {
class RDataSetDescriptorBuilder {
private:
RForestDescriptor fDescriptor;
RDataSetDescriptor fDescriptor;

public:
const RForestDescriptor& GetDescriptor() const { return fDescriptor; }
const RDataSetDescriptor& GetDescriptor() const { return fDescriptor; }

void SetForest(std::string_view name, const RForestVersion &version);
void SetDataSet(std::string_view name, const RForestVersion &version);

void AddField(DescriptorId_t fieldId, const RForestVersion &fieldVersion, const RForestVersion &typeVersion,
std::string_view fieldName, std::string_view typeName, EForestStructure structure);
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RDataSetModel.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RCollectionForest;
// clang-format off
/**
\class ROOT::Experimental::RForestModel
\ingroup Forest
\ingroup DataSet
\brief The RForestModel encapulates the schema of a forest.
The forest model comprises a collection of hierarchically organized fields. From a frozen model, "entries"
Expand Down
6 changes: 3 additions & 3 deletions tree/dataset/v7/inc/ROOT/RDataSetView.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Experimental {
// clang-format off
/**
\class ROOT::Experimental::RForestViewContext
\ingroup Forest
\ingroup DataSet
\brief Used to loop over indexes (entries or collections) between start and end
*/
// clang-format on
Expand Down Expand Up @@ -66,7 +66,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::RForestView
\ingroup Forest
\ingroup DataSet
\brief An RForestView provides read-only access to a single field of the forest
(NB(jblomer): The forest view is very close to TTreeReader. Do we simply want to teach TTreeReader to deal with Forest?)
Expand Down Expand Up @@ -137,7 +137,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::RForestViewCollection
\ingroup Forest
\ingroup DataSet
\brief A tree view for a collection, that can itself generate new tree views for its nested fields.
*/
// clang-format on
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/REntry.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Experimental {
// clang-format off
/**
\class ROOT::Experimental::REntry
\ingroup Forest
\ingroup DataSet
\brief The REntry is a collection of values in a forest corresponding to a complete row in the data set
The entry provides a memory-managed binder for a set of values. Through shared pointers, the memory locations
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RField.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RPageStorage;
// clang-format off
/**
\class ROOT::Experimental::RFieldBase
\ingroup Forest
\ingroup DataSet
\brief A field translates read and write calls from/to underlying columns to/from tree values
A field is a serializable C++ type or a container for a collection of sub fields. The RFieldBase and its
Expand Down
4 changes: 2 additions & 2 deletions tree/dataset/v7/inc/ROOT/RFieldValue.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RFieldBase;
// clang-format off
/**
\class ROOT::Experimental::TreeValueBase
\ingroup Forest
\ingroup DataSet
\brief Represents transient storage of simple or complex C++ values.
The data carried by the tree value is used by the computational code and it is supposed to be serialized on Fill
Expand Down Expand Up @@ -68,7 +68,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::RFieldValue
\ingroup Forest
\ingroup DataSet
\brief A type-safe front for RFieldValueBase
Used when types are available at compile time by RForestModel::AddField()
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RPage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Detail {
// clang-format off
/**
\class ROOT::Experimental::Detail::RPage
\ingroup Forest
\ingroup DataSet
\brief A page is a fixed size slice of a column that is mapped into memory
The page provides a fixed-size opaque memory buffer for uncompressed data. It does not know how to interpret
Expand Down
2 changes: 1 addition & 1 deletion tree/dataset/v7/inc/ROOT/RPagePool.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RColumn;
// clang-format off
/**
\class ROOT::Experimental::Detail::RPagePool
\ingroup Forest
\ingroup DataSet
\brief A thread-safe cache of column pages.
The page pool encapsulated memory management for data written into a tree or read from a tree. Adding and removing
Expand Down
8 changes: 4 additions & 4 deletions tree/dataset/v7/inc/ROOT/RPageStorage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum class EPageStorageType {
// clang-format off
/**
\class ROOT::Experimental::Detail::RPageStorage
\ingroup Forest
\ingroup DataSet
\brief Manages tree meta-data, which is common for sinks and sources.
The tree meta-data contains of a list of fields, a unique identifier, and provenance information.
Expand Down Expand Up @@ -80,7 +80,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::Detail::RPageSink
\ingroup Forest
\ingroup DataSet
\brief Abstract interface to write data into a tree
The page sink takes the list of columns and afterwards a series of page commits and cluster commits.
Expand All @@ -107,7 +107,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::Detail::RPageSource
\ingroup Forest
\ingroup DataSet
\brief Abstract interface to read data from a tree
The page source is initialized with the columns of interest. Pages from those columns can then be
Expand All @@ -133,7 +133,7 @@ public:
virtual ForestSize_t GetNEntries() = 0;
virtual ForestSize_t GetNElements(ColumnHandle_t columnHandle) = 0;
virtual ColumnId_t GetColumnId(ColumnHandle_t columnHandle) = 0;
virtual const RForestDescriptor& GetDescriptor() const = 0;
virtual const RDataSetDescriptor& GetDescriptor() const = 0;
};

} // namespace Detail
Expand Down
8 changes: 4 additions & 4 deletions tree/dataset/v7/inc/ROOT/RPageStorageRoot.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::Detail::RPageSinkRoot
\ingroup Forest
\ingroup DataSet
\brief Storage provider that write Forest pages into a ROOT TFile
*/
// clang-format on
Expand Down Expand Up @@ -167,7 +167,7 @@ public:
// clang-format off
/**
\class ROOT::Experimental::Detail::RPageSourceRoot
\ingroup Forest
\ingroup DataSet
\brief Storage provider that reads Forest pages from a ROOT TFile
*/
// clang-format on
Expand All @@ -185,7 +185,7 @@ private:
RSettings fSettings;

RMapper fMapper;
RForestDescriptor fDescriptor;
RDataSetDescriptor fDescriptor;

public:
RPageSourceRoot(std::string_view forestName, RSettings settings);
Expand All @@ -199,7 +199,7 @@ public:
ForestSize_t GetNEntries() final;
ForestSize_t GetNElements(ColumnHandle_t columnHandle) final;
ColumnId_t GetColumnId(ColumnHandle_t columnHandle) final;
const RForestDescriptor& GetDescriptor() const final { return fDescriptor; }
const RDataSetDescriptor& GetDescriptor() const final { return fDescriptor; }
};

} // namespace Detail
Expand Down
18 changes: 9 additions & 9 deletions tree/dataset/v7/src/RDataSetDescriptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#include <ROOT/RDataSetUtil.hxx>
#include <ROOT/RStringView.hxx>

void ROOT::Experimental::RForestDescriptorBuilder::SetForest(std::string_view name, const RForestVersion &version) {
void ROOT::Experimental::RDataSetDescriptorBuilder::SetDataSet(std::string_view name, const RForestVersion &version) {
fDescriptor.fName = name.to_string();
fDescriptor.fVersion = version;
}

void ROOT::Experimental::RForestDescriptorBuilder::AddField(
void ROOT::Experimental::RDataSetDescriptorBuilder::AddField(
DescriptorId_t fieldId, const RForestVersion &fieldVersion, const RForestVersion &typeVersion,
std::string_view fieldName, std::string_view typeName, EForestStructure structure)
{
Expand All @@ -36,17 +36,17 @@ void ROOT::Experimental::RForestDescriptorBuilder::AddField(
fDescriptor.fFieldDescriptors[fieldId] = f;
}

void ROOT::Experimental::RForestDescriptorBuilder::SetFieldParent(DescriptorId_t fieldId, DescriptorId_t parentId)
void ROOT::Experimental::RDataSetDescriptorBuilder::SetFieldParent(DescriptorId_t fieldId, DescriptorId_t parentId)
{
fDescriptor.fFieldDescriptors[fieldId].fParentId = parentId;
}

void ROOT::Experimental::RForestDescriptorBuilder::AddFieldLink(DescriptorId_t fieldId, DescriptorId_t linkId)
void ROOT::Experimental::RDataSetDescriptorBuilder::AddFieldLink(DescriptorId_t fieldId, DescriptorId_t linkId)
{
fDescriptor.fFieldDescriptors[fieldId].fLinkIds.push_back(linkId);
}

void ROOT::Experimental::RForestDescriptorBuilder::AddColumn(
void ROOT::Experimental::RDataSetDescriptorBuilder::AddColumn(
DescriptorId_t columnId, DescriptorId_t fieldId, const RForestVersion &version, const RColumnModel &model)
{
RColumnDescriptor c;
Expand All @@ -57,17 +57,17 @@ void ROOT::Experimental::RForestDescriptorBuilder::AddColumn(
fDescriptor.fColumnDescriptors[columnId] = c;
}

void ROOT::Experimental::RForestDescriptorBuilder::SetColumnOffset(DescriptorId_t columnId, DescriptorId_t offsetId)
void ROOT::Experimental::RDataSetDescriptorBuilder::SetColumnOffset(DescriptorId_t columnId, DescriptorId_t offsetId)
{
fDescriptor.fColumnDescriptors[columnId].fOffsetId = offsetId;
}

void ROOT::Experimental::RForestDescriptorBuilder::AddColumnLink(DescriptorId_t columnId, DescriptorId_t linkId)
void ROOT::Experimental::RDataSetDescriptorBuilder::AddColumnLink(DescriptorId_t columnId, DescriptorId_t linkId)
{
fDescriptor.fColumnDescriptors[columnId].fLinkIds.push_back(linkId);
}

void ROOT::Experimental::RForestDescriptorBuilder::AddCluster(
void ROOT::Experimental::RDataSetDescriptorBuilder::AddCluster(
DescriptorId_t clusterId, RForestVersion version, ForestSize_t firstEntryIndex, ClusterSize_t nEntries)
{
RClusterDescriptor c;
Expand All @@ -78,7 +78,7 @@ void ROOT::Experimental::RForestDescriptorBuilder::AddCluster(
fDescriptor.fClusterDescriptors[clusterId] = c;
}

void ROOT::Experimental::RForestDescriptorBuilder::AddClusterColumnInfo(
void ROOT::Experimental::RDataSetDescriptorBuilder::AddClusterColumnInfo(
DescriptorId_t clusterId, const RClusterDescriptor::RColumnInfo &columnInfo)
{
fDescriptor.fClusterDescriptors[clusterId].fColumnInfos[columnInfo.fColumnId] = columnInfo;
Expand Down
4 changes: 2 additions & 2 deletions tree/dataset/v7/src/RPageStorageRoot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ void ROOT::Experimental::Detail::RPageSourceRoot::Attach()
delete forestHeader;

// TODO(jblomer): replace RMapper by a forest descriptor
RForestDescriptorBuilder descBuilder;
descBuilder.SetForest(fForestName, RForestVersion());
RDataSetDescriptorBuilder descBuilder;
descBuilder.SetDataSet(fForestName, RForestVersion());
fDescriptor = descBuilder.GetDescriptor();
}

Expand Down
Loading

0 comments on commit ef23679

Please sign in to comment.