Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RCluster.cxx
Go to the documentation of this file.
1/// \file RCluster.cxx
2/// \author Jakob Blomer <jblomer@cern.ch>
3/// \date 2020-03-11
4/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
5/// is welcome!
6
7/*************************************************************************
8 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
9 * All rights reserved. *
10 * *
11 * For the licensing terms see $ROOTSYS/LICENSE. *
12 * For the list of contributors see $ROOTSYS/README/CREDITS. *
13 *************************************************************************/
14
15#include <ROOT/RCluster.hxx>
16
17#include <TError.h>
18
19#include <iterator>
20#include <utility>
21
23
24////////////////////////////////////////////////////////////////////////////////
25
27
28////////////////////////////////////////////////////////////////////////////////
29
31{
32 const auto itr = fOnDiskPages.find(key);
33 if (itr != fOnDiskPages.end())
34 return &(itr->second);
35 return nullptr;
36}
37
38void ROOT::Internal::RCluster::Adopt(std::unique_ptr<ROnDiskPageMap> pageMap)
39{
40 auto &pages = pageMap->fOnDiskPages;
41 fOnDiskPages.insert(std::make_move_iterator(pages.begin()), std::make_move_iterator(pages.end()));
42 pageMap->fOnDiskPages.clear();
43 fPageMaps.emplace_back(std::move(pageMap));
44}
45
47{
48 R__ASSERT(fClusterId == other.fClusterId);
49
50 auto &pages = other.fOnDiskPages;
51 fOnDiskPages.insert(std::make_move_iterator(pages.begin()), std::make_move_iterator(pages.end()));
52 other.fOnDiskPages.clear();
53
54 auto &columns = other.fAvailPhysicalColumns;
55 fAvailPhysicalColumns.insert(std::make_move_iterator(columns.begin()), std::make_move_iterator(columns.end()));
56 other.fAvailPhysicalColumns.clear();
57 std::move(other.fPageMaps.begin(), other.fPageMaps.end(), std::back_inserter(fPageMaps));
58 other.fPageMaps.clear();
59}
60
62{
63 fAvailPhysicalColumns.insert(physicalColumnId);
64}
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
std::vector< std::unique_ptr< ROnDiskPageMap > > fPageMaps
Multiple page maps can be combined in a single RCluster.
Definition RCluster.hxx:160
ColumnSet_t fAvailPhysicalColumns
Set of the (complete) columns represented by the RCluster.
Definition RCluster.hxx:162
ROOT::DescriptorId_t fClusterId
References the cluster identifier in the page source that created the cluster.
Definition RCluster.hxx:158
RCluster(ROOT::DescriptorId_t clusterId)
Definition RCluster.hxx:167
void SetColumnAvailable(ROOT::DescriptorId_t physicalColumnId)
Marks the column as complete; must be done for all columns, even empty ones without associated pages,...
Definition RCluster.cxx:61
const ROnDiskPage * GetOnDiskPage(const ROnDiskPage::Key &key) const
Definition RCluster.cxx:30
void Adopt(std::unique_ptr< ROnDiskPageMap > pageMap)
Move the given page map into this cluster; for on-disk pages that are present in both the cluster at ...
Definition RCluster.cxx:38
std::unordered_map< ROnDiskPage::Key, ROnDiskPage > fOnDiskPages
Lookup table for the on-disk pages.
Definition RCluster.hxx:164
A page as being stored on disk, that is packed and compressed.
Definition RCluster.hxx:40
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
On-disk pages within a page source are identified by the column and page number.
Definition RCluster.hxx:50