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
LocationInitializer.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
26
27
#ifndef Hypertable_RangeServer_LocationInitializer_h
28
#define Hypertable_RangeServer_LocationInitializer_h
29
30
#include <
Hypertable/RangeServer/Context.h
>
31
32
#include <
Hypertable/Lib/RangeServer/Protocol.h
>
33
34
#include <
Hyperspace/Session.h
>
35
36
#include <
AsyncComm/ConnectionInitializer.h
>
37
38
#include <
Common/String.h
>
39
40
#include <condition_variable>
41
#include <mutex>
42
43
namespace
Hypertable
{
44
45
using namespace
Lib
;
46
49
51
class
LocationInitializer
:
public
ConnectionInitializer
{
52
53
public
:
54
57
LocationInitializer
(std::shared_ptr<Context> &context);
58
60
virtual
bool
is_removed(
const
String
&path,
61
Hyperspace::SessionPtr
&hyperspace);
62
63
CommBuf
*create_initialization_request()
override
;
64
bool
process_initialization_response(
Event
*event)
override
;
65
uint64_t
initialization_command
()
override
{
return
Lib::RangeServer::Protocol::COMMAND_INITIALIZE
; }
66
68
String
get
();
69
71
void
wait_for_handshake();
72
74
void
set_lock_held
() { m_lock_held=
true
; }
75
76
private
:
77
79
std::shared_ptr<Context>
m_context
;
80
82
std::mutex
m_mutex
;
83
85
std::condition_variable
m_cond
;
86
88
String
m_location
;
89
91
String
m_location_file
;
92
94
bool
m_location_persisted {};
95
97
bool
m_handshake_complete {};
98
100
bool
m_lock_held {};
101
};
102
104
typedef
std::shared_ptr<LocationInitializer>
LocationInitializerPtr
;
105
107
}
108
109
110
#endif // Hypertable_RangeServer_LocationInitializer_h
Hypertable::Logger::mutex
static std::mutex mutex
Definition:
Logger.cc:43
Hypertable::Event
Network communication event.
Definition:
Event.h:54
Hypertable::LocationInitializer::m_location_file
String m_location_file
Local pathname to location file.
Definition:
LocationInitializer.h:91
Hypertable::LocationInitializerPtr
std::shared_ptr< LocationInitializer > LocationInitializerPtr
Shared smart pointer to LocationInitializer.
Definition:
LocationInitializer.h:104
Hypertable::String
std::string String
A String is simply a typedef to std::string.
Definition:
String.h:44
ConnectionInitializer.h
Declarations for ConnectionInitializer.
Context.h
Declarations for Context.
Hypertable::LocationInitializer::m_cond
std::condition_variable m_cond
Condition variable signalling completion of initialization handshake.
Definition:
LocationInitializer.h:85
Protocol.h
Declarations for RangeServerProtocol.
Hyperspace::SessionPtr
std::shared_ptr< Session > SessionPtr
Definition:
Session.h:734
Hypertable::LocationInitializer::m_location
String m_location
Assigned location (proxy name)
Definition:
LocationInitializer.h:88
Hypertable::LocationInitializer::initialization_command
uint64_t initialization_command() override
Command code (see CommHeader::command) for initialization response message.
Definition:
LocationInitializer.h:65
Hypertable
Hypertable definitions
Definition:
ApplicationHandler.h:36
Hypertable::ConnectionInitializer
Driver interface for connection initialization handshake in ConnectionManager.
Definition:
ConnectionInitializer.h:43
Hypertable::LocationInitializer::m_mutex
std::mutex m_mutex
Mutex for serializing concurrent access.
Definition:
LocationInitializer.h:82
Hypertable::CommBuf
Message buffer for holding data to be transmitted over a network.
Definition:
CommBuf.h:79
String.h
A String class based on std::string.
Hypertable::LocationInitializer
Obtains location string (proxy name) for the range server.
Definition:
LocationInitializer.h:51
Lib
Hypertable::LocationInitializer::set_lock_held
void set_lock_held()
Signals that Hyperspace lock on location file is held.
Definition:
LocationInitializer.h:74
Hypertable::Lib::RangeServer::Protocol::COMMAND_INITIALIZE
Definition:
Protocol.h:78
Session.h
Hypertable::LocationInitializer::m_context
std::shared_ptr< Context > m_context
Range server context
Definition:
LocationInitializer.h:79
Generated on Tue Dec 22 2015 18:43:16 for Hypertable by
1.8.8