0.9.8.10
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
home
doug
src
hypertable
src
cc
Hypertable
RangeServer
PhantomRangeMap.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_PhantomRangeMap_h
23
#define Hypertable_RangeServer_PhantomRangeMap_h
24
25
#include "
TableInfoMap.h
"
26
#include "
PhantomRange.h
"
27
28
#include <
Hypertable/Lib/QualifiedRangeSpec.h
>
29
30
#include <
Common/PageArenaAllocator.h
>
31
32
#include <boost/thread/condition.hpp>
33
34
#include <map>
35
#include <memory>
36
#include <mutex>
37
#include <set>
38
#include <string>
39
40
namespace
Hypertable
{
41
using namespace
std
;
45
class
PhantomRangeMap
{
46
public
:
47
PhantomRangeMap
(
int
plan_generation);
48
virtual
~PhantomRangeMap
() { }
49
50
void
lock
() { m_mutex.lock(); }
51
void
unlock
() { m_mutex.unlock(); }
52
53
void
reset(
int
plan_generation);
54
63
void
insert(
const
QualifiedRangeSpec
&range,
const
RangeState
&state,
64
SchemaPtr
schema,
const
vector<int32_t> &fragments);
65
72
void
get
(
const
QualifiedRangeSpec
&range_spec,
PhantomRangePtr
&phantom_range);
73
74
TableInfoMapPtr
get_tableinfo_map
() {
return
m_tableinfo_map; }
75
76
int
get_plan_generation
() {
return
m_plan_generation; }
77
78
bool
initial()
const
;
79
80
void
set_loaded();
81
bool
loaded()
const
;
82
83
bool
replayed()
const
;
84
85
void
set_prepared();
86
bool
prepared()
const
;
87
88
void
set_committed();
89
bool
committed()
const
;
90
91
private
:
92
typedef
std::map<QualifiedRangeSpec, PhantomRangePtr>
Map
;
93
94
std::mutex
m_mutex
;
95
CharArena
m_arena
;
96
TableInfoMapPtr
m_tableinfo_map
;
97
Map
m_map
;
98
int
m_plan_generation
;
99
int
m_state
;
100
};
101
102
typedef
std::shared_ptr<PhantomRangeMap>
PhantomRangeMapPtr
;
103
104
}
105
106
#endif // Hypertable_RangeServer_PhantomRangeMap_h
Hypertable::PhantomRangeMap::lock
void lock()
Definition:
PhantomRangeMap.h:50
Hypertable::Logger::mutex
static std::mutex mutex
Definition:
Logger.cc:43
Hypertable::PhantomRangeMap
Provides a mapping from table name to TableInfo object.
Definition:
PhantomRangeMap.h:45
Hypertable::PhantomRangeMapPtr
std::shared_ptr< PhantomRangeMap > PhantomRangeMapPtr
Definition:
PhantomRangeMap.h:102
Hypertable::PhantomRangeMap::get_tableinfo_map
TableInfoMapPtr get_tableinfo_map()
Definition:
PhantomRangeMap.h:74
Hypertable::PhantomRangeMap::unlock
void unlock()
Definition:
PhantomRangeMap.h:51
Hypertable::PhantomRangeMap::m_map
Map m_map
Definition:
PhantomRangeMap.h:97
PageArenaAllocator.h
PageArena memory allocator for STL classes.
std
STL namespace.
Hypertable::PhantomRangeMap::get_plan_generation
int get_plan_generation()
Definition:
PhantomRangeMap.h:76
Hypertable::PhantomRangeMap::m_state
int m_state
Definition:
PhantomRangeMap.h:99
Hypertable::PhantomRangeMap::m_arena
CharArena m_arena
Definition:
PhantomRangeMap.h:95
PhantomRange.h
Declarations for PhantomRange.
TableInfoMap.h
Declarations for TableInfoMap.
QualifiedRangeSpec.h
Declarations for QualifiedRangeSpec and QualifiedRangeSpecManaged.
Hypertable::PageArena
The PageArena allocator is simple and fast, avoiding individual mallocs/frees.
Definition:
PageArena.h:69
Hypertable::PhantomRangeMap::~PhantomRangeMap
virtual ~PhantomRangeMap()
Definition:
PhantomRangeMap.h:48
Hypertable::TableInfoMapPtr
std::shared_ptr< TableInfoMap > TableInfoMapPtr
Shared smart pointer to TableInfoMap.
Definition:
TableInfoMap.h:223
Hypertable
Hypertable definitions
Definition:
ApplicationHandler.h:36
Hypertable::PhantomRangeMap::Map
std::map< QualifiedRangeSpec, PhantomRangePtr > Map
Definition:
PhantomRangeMap.h:92
Hypertable::PhantomRangeMap::m_mutex
std::mutex m_mutex
Definition:
PhantomRangeMap.h:94
Hypertable::PhantomRangeMap::m_tableinfo_map
TableInfoMapPtr m_tableinfo_map
Definition:
PhantomRangeMap.h:96
Hypertable::PhantomRangePtr
std::shared_ptr< PhantomRange > PhantomRangePtr
Shared smart pointer to PhantomRange.
Definition:
PhantomRange.h:120
Hypertable::QualifiedRangeSpec
Qualified (with table identifier) range specification.
Definition:
QualifiedRangeSpec.h:52
Hypertable::SchemaPtr
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
Definition:
Schema.h:465
Hypertable::RangeState
Range state.
Definition:
RangeState.h:48
Hypertable::PhantomRangeMap::m_plan_generation
int m_plan_generation
Definition:
PhantomRangeMap.h:98
Generated on Tue Dec 22 2015 18:43:16 for Hypertable by
1.8.8