0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ReplayDispatchHandler.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_ReplayDispatchHandler_h
23 #define Hypertable_RangeServer_ReplayDispatchHandler_h
24 
27 
29 #include <AsyncComm/Comm.h>
30 
31 #include <condition_variable>
32 #include <map>
33 #include <mutex>
34 
35 namespace Hypertable {
36 
37  using namespace Lib;
38 
40 
41  public:
42  ReplayDispatchHandler(Comm *comm, const String &location,
43  int plan_generation, int32_t timeout_ms) :
44  m_rsclient(comm, timeout_ms), m_recover_location(location),
45  m_plan_generation(plan_generation) { }
46 
47  virtual void handle(EventPtr &event);
48 
49  void add(const CommAddress &addr, const QualifiedRangeSpec &range,
50  uint32_t fragment, StaticBuffer &buffer);
51 
52  void wait_for_completion();
53 
54  private:
56  std::condition_variable m_cond;
60  int32_t m_error {};
61  int m_plan_generation {};
62  size_t m_outstanding {};
63  };
64 }
65 
66 #endif // Hypertable_RangeServer_ReplayDispatchHandler_h
67 
A memory buffer of static size.
Definition: StaticBuffer.h:45
static std::mutex mutex
Definition: Logger.cc:43
ReplayDispatchHandler(Comm *comm, const String &location, int plan_generation, int32_t timeout_ms)
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Abstract base class for application dispatch handlers registered with AsyncComm.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
Declarations for RangeServerClient.
void add(const Key &key, uint8_t flag, const void *value, uint32_t value_len, TableMutatorAsync *value_index_mutator, TableMutatorAsync *qualifier_index_mutator)
Definition: IndexTables.cc:34
Declarations for DispatchHandler.
Declarations for QualifiedRangeSpec and QualifiedRangeSpecManaged.
Hypertable definitions
Entry point to AsyncComm service.
Definition: Comm.h:61
Declarations for Comm.
Client interface to RangeServer.
Definition: Client.h:63
Qualified (with table identifier) range specification.
Address abstraction to hold either proxy name or IPv4:port address.
Definition: CommAddress.h:52