0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellList.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, or any later version.
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_RangeServer_CellList_h
23 #define Hypertable_RangeServer_CellList_h
24 
25 #include "ScanContext.h"
26 
27 #include <Hypertable/Lib/Key.h>
28 
29 #include <Common/ByteString.h>
30 #include <Common/StlAllocator.h>
31 #include <Common/StringExt.h>
32 
33 namespace Hypertable {
34 
36  typedef std::shared_ptr<CellListScanner> CellListScannerPtr;
37 
42  class CellList {
43  public:
44  virtual ~CellList() { return; }
45 
52  virtual void add(const Key &key, const ByteString value) = 0;
53 
60  virtual CellListScannerPtr
62 
63  typedef std::pair<const char *, int64_t> SplitRowDataValue;
65  typedef std::map<const char *, int64_t, LtCstr,
66  SplitRowDataAlloc> SplitRowDataMapT;
67 
74  virtual void split_row_estimate_data(SplitRowDataMapT &split_row_data) {
75  HT_FATAL("Not Implemented!");
76  }
77 
86  virtual const char *get_start_row() { return m_start_row.c_str(); }
87 
96  virtual const char *get_end_row() { return m_end_row.c_str(); }
97 
98  protected:
99  std::string m_start_row;
100  std::string m_end_row;
101  };
102 
103 }
104 
105 #endif // Hypertable_RangeServer_CellList_h
virtual void split_row_estimate_data(SplitRowDataMapT &split_row_data)
Populates split_row_data with unique row and count estimates for this list.
Definition: CellList.h:74
std::string m_start_row
Definition: CellList.h:99
Stl compatible memory allocator based on a PageArena.
#define HT_FATAL(msg)
Definition: Logger.h:339
Scan context information.
Definition: ScanContext.h:52
std::string m_end_row
Definition: CellList.h:100
virtual const char * get_start_row()
Returns the start row of this cell list.
Definition: CellList.h:86
A class managing one or more serializable ByteStrings.
Definition: ByteString.h:47
std::map< const char *, int64_t, LtCstr, SplitRowDataAlloc > SplitRowDataMapT
Definition: CellList.h:66
Declarations for ScanContext.
STL Strict Weak Ordering for comparing c-style strings.
Definition: StringExt.h:45
Stl compatible memory allocator based on a PageArena.
Definition: StlAllocator.h:41
virtual ~CellList()
Definition: CellList.h:44
StlAllocator< SplitRowDataValue > SplitRowDataAlloc
Definition: CellList.h:64
virtual const char * get_end_row()
Returns the end row of this cell list.
Definition: CellList.h:96
std::pair< const char *, int64_t > SplitRowDataValue
Definition: CellList.h:63
virtual CellListScannerPtr create_scanner(ScanContext *scan_ctx)
Creates a scanner on this cell list.
Definition: CellList.h:61
Hypertable definitions
Provides access to internal components of opaque key.
Definition: Key.h:40
A serializable ByteString.
std::shared_ptr< CellListScanner > CellListScannerPtr
Definition: CellList.h:35
String extensions and helpers: sets, maps, append operators etc.
Abstract base class for cell lists (sorted lists of key/value pairs).
Definition: CellList.h:42
virtual void add(const Key &key, const ByteString value)=0
Inserts a key/value pair into the cell list.