0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TableSplit.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_TABLESPLIT_H
23 #define HYPERTABLE_TABLESPLIT_H
24 
25 #include "Common/PageArena.h"
26 
27 #include <vector>
28 
29 namespace Hypertable {
30 
34 struct TableSplit {
36 
37  void clear() {
38  start_row = 0;
39  end_row = 0;
40  location = 0;
41  ip_address = 0;
42  hostname = 0;
43  }
44 
45  const char *start_row;
46  const char *end_row;
47  const char *location;
48  const char *ip_address;
49  const char *hostname;
50 };
51 
52 std::ostream &operator<<(std::ostream &os, const TableSplit &ts);
53 
54 // Builds a list of table splits (could manage storage)
56 public:
57 
59 
60  void set_start_row(const std::string &row) {
62  }
63 
64  void set_end_row(const std::string &row) {
66  }
67 
68  void set_location(const std::string &loc) {
70  }
71 
72  void set_ip_address(const std::string &ip) {
74  }
75 
76  void set_hostname(const std::string &h) {
78  }
79 
80  void clear() { m_table_split.clear(); }
81 
82  TableSplit &get() { return m_table_split; }
83 
84  CharArena &arena() { return m_arena; }
85 
86 private:
89 };
90 
91 class TableSplitsContainer : public std::vector<TableSplit> {
92 public:
93  CharArena &arena() { return m_arena; }
94 private:
96 };
97 
98 
99 
100 } // namespace Hypertable
101 
102 #endif // HYPERTABLE_TABLESPLIT_H
PageArena memory allocator.
Represents a table split.
Definition: TableSplit.h:34
void set_ip_address(const std::string &ip)
Definition: TableSplit.h:72
void set_hostname(const std::string &h)
Definition: TableSplit.h:76
const char * hostname
Definition: TableSplit.h:49
CharT * dup(const CharT *s)
Duplicate a null terminated string; memory is allocated from the pool.
Definition: PageArena.h:274
void set_location(const std::string &loc)
Definition: TableSplit.h:68
void set_end_row(const std::string &row)
Definition: TableSplit.h:64
const char * location
Definition: TableSplit.h:47
const char * ip_address
Definition: TableSplit.h:48
std::ostream & operator<<(std::ostream &os, const crontab_entry &entry)
Helper function to write crontab_entry to an ostream.
Definition: Crontab.cc:301
The PageArena allocator is simple and fast, avoiding individual mallocs/frees.
Definition: PageArena.h:69
void set_start_row(const std::string &row)
Definition: TableSplit.h:60
TableSplitBuilder(CharArena &a)
Definition: TableSplit.h:58
Hypertable definitions
const char * start_row
Definition: TableSplit.h:45
const char * end_row
Definition: TableSplit.h:46