0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TableDumper.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef Hypertable_Lib_TableDumper_h
23 #define Hypertable_Lib_TableDumper_h
24 
25 #include "Cells.h"
26 #include "Namespace.h"
27 #include "ScanSpec.h"
28 #include "TableSplit.h"
29 
30 #include <memory>
31 
32 namespace Hypertable {
33 
34  class TableDumper {
35 
36  public:
45  TableDumper(NamespacePtr &ns, const std::string &name, ScanSpec &scan_spec,
46  size_t target_node_count=20);
47 
54  bool next(Cell &cell);
55 
56  private:
60  std::vector<uint32_t> m_ordering;
61  uint32_t m_next;
62  std::list<TableScannerPtr> m_scanners;
63  std::list<TableScannerPtr>::iterator m_scanner_iter;
64  bool m_eod;
65  };
66 
68  typedef std::shared_ptr<TableDumper> TableDumperPtr;
69 
70  void copy(TableDumper &, CellsBuilder &);
71  inline void copy(TableDumperPtr &p, CellsBuilder &v) { copy(*p.get(), v); }
72 
73 }
74 
75 #endif // Hypertable_Lib_TableDumper_h
std::list< TableScannerPtr >::iterator m_scanner_iter
Definition: TableDumper.h:63
std::vector< uint32_t > m_ordering
Definition: TableDumper.h:60
std::shared_ptr< Namespace > NamespacePtr
Shared smart pointer to Namespace.
Definition: Namespace.h:333
Scan predicate and control specification.
Definition: ScanSpec.h:56
bool next(Cell &cell)
Get the next cell.
Definition: TableDumper.cc:83
std::list< TableScannerPtr > m_scanners
Definition: TableDumper.h:62
Hypertable definitions
void copy(TableDumper &, CellsBuilder &)
Definition: TableDumper.cc:129
TableDumper(NamespacePtr &ns, const std::string &name, ScanSpec &scan_spec, size_t target_node_count=20)
Constructs a TableDumper object.
Definition: TableDumper.cc:41
std::shared_ptr< TableDumper > TableDumperPtr
Smart pointer to TableDumper.
Definition: TableDumper.h:68
Encapsulates decomposed key and value.
Definition: Cell.h:32
TableSplitsContainer m_splits
Definition: TableDumper.h:58
std::shared_ptr< Table > TablePtr
Definition: Table.h:53