Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RCluster.cxx
Go to the documentation of this file.
1/// \file RCluster.cxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2020-03-11
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#include <ROOT/RCluster.hxx>
17
18#include <TError.h>
19
20#include <iterator>
21#include <utility>
22
24
25////////////////////////////////////////////////////////////////////////////////
26
28
29////////////////////////////////////////////////////////////////////////////////
30
33{
34 const auto itr = fOnDiskPages.find(key);
35 if (itr != fOnDiskPages.end())
36 return &(itr->second);
37 return nullptr;
38}
39
40void ROOT::Experimental::Internal::RCluster::Adopt(std::unique_ptr<ROnDiskPageMap> pageMap)
41{
42 auto &pages = pageMap->fOnDiskPages;
43 fOnDiskPages.insert(std::make_move_iterator(pages.begin()), std::make_move_iterator(pages.end()));
44 pageMap->fOnDiskPages.clear();
45 fPageMaps.emplace_back(std::move(pageMap));
46}
47
49{
50 R__ASSERT(fClusterId == other.fClusterId);
51
52 auto &pages = other.fOnDiskPages;
53 fOnDiskPages.insert(std::make_move_iterator(pages.begin()), std::make_move_iterator(pages.end()));
54 other.fOnDiskPages.clear();
55
56 auto &columns = other.fAvailPhysicalColumns;
57 fAvailPhysicalColumns.insert(std::make_move_iterator(columns.begin()), std::make_move_iterator(columns.end()));
58 other.fAvailPhysicalColumns.clear();
59 std::move(other.fPageMaps.begin(), other.fPageMaps.end(), std::back_inserter(fPageMaps));
60 other.fPageMaps.clear();
61}
62
64{
65 fAvailPhysicalColumns.insert(physicalColumnId);
66}
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
An in-memory subset of the packed and compressed pages of a cluster.
Definition RCluster.hxx:152
void SetColumnAvailable(DescriptorId_t physicalColumnId)
Marks the column as complete; must be done for all columns, even empty ones without associated pages,...
Definition RCluster.cxx:63
std::unordered_map< ROnDiskPage::Key, ROnDiskPage > fOnDiskPages
Lookup table for the on-disk pages.
Definition RCluster.hxx:169
const ROnDiskPage * GetOnDiskPage(const ROnDiskPage::Key &key) const
Definition RCluster.cxx:32
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:40
A page as being stored on disk, that is packed and compressed.
Definition RCluster.hxx:42
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:52