0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellCacheScanner.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_CellCacheScanner_h
23 #define Hypertable_RangeServer_CellCacheScanner_h
24 
25 #include "CellCache.h"
26 #include "CellListScanner.h"
27 #include "ScanContext.h"
28 
29 namespace Hypertable {
30 
35  public:
36  CellCacheScanner(CellCachePtr cellcache, ScanContext *scan_ctx);
37  virtual ~CellCacheScanner() { return; }
38  virtual void forward();
39  virtual bool get(Key &key, ByteString &value);
40 
41  virtual int64_t get_disk_read() { return 0; }
42 
43  typedef std::map<const SerializedKey, uint32_t> CellCacheMap;
44 
45  private:
46 
47  bool internal_get();
48  void internal_forward();
49  void load_entry_cache();
50 
52  public:
53  CellCacheEntry() : value(0) { };
54  Key key;
56  };
57 
58  CellCache::CellMap::iterator m_start_iter;
59  CellCache::CellMap::iterator m_end_iter;
60  CellCache::CellMap::iterator m_cur_iter;
61  CellCacheMap::iterator m_delete_iter;
65  std::vector<CellCacheEntry> m_entry_cache;
66  size_t m_entry_cache_next {};
67  CellCacheMap m_deletes;
68  bool m_in_deletes {};
69  bool m_eos {};
70  bool m_keys_only {};
71  };
72 }
73 
74 #endif // Hypertable_RangeServer_CellCacheScanner_h
75 
static std::mutex mutex
Definition: Logger.cc:43
virtual int64_t get_disk_read()
CellCacheEntry()
CellCache::CellMap::iterator m_cur_iter
std::map< const SerializedKey, uint32_t > CellCacheMap
Scan context information.
Definition: ScanContext.h:52
Key key
A class managing one or more serializable ByteStrings.
Definition: ByteString.h:47
ByteString value
Provides a scanning interface to a CellCache.
Declarations for ScanContext.
CellCacheScanner(CellCachePtr cellcache, ScanContext *scan_ctx)
std::vector< CellCacheEntry > m_entry_cache
CellCacheMap::iterator m_delete_iter
Hypertable definitions
Provides access to internal components of opaque key.
Definition: Key.h:40
CellCache::CellMap::iterator m_start_iter
std::shared_ptr< CellCache > CellCachePtr
Shared smart pointer to CellCache.
Definition: CellCache.h:163
CellCache::CellMap::iterator m_end_iter