0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ReplayFragments.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; either version 3
9  * of the 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 
26 
27 #ifndef Hypertable_Lib_RangeServer_Request_Parameters_ReplayFragments_h
28 #define Hypertable_Lib_RangeServer_Request_Parameters_ReplayFragments_h
29 
31 
32 #include <Common/Serializable.h>
33 
34 #include <string>
35 #include <vector>
36 
37 using namespace std;
38 
39 namespace Hypertable {
40 namespace Lib {
41 namespace RangeServer {
42 namespace Request {
43 namespace Parameters {
44 
47 
49  class ReplayFragments : public Serializable {
50  public:
51 
55 
65  ReplayFragments(int64_t op_id, const string &location,
66  int32_t plan_generation, int32_t type,
67  const vector<int32_t> &fragments,
68  const Lib::RangeServerRecovery::ReceiverPlan &receiver_plan,
69  int32_t replay_timeout)
70  : m_op_id(op_id), m_location(location.c_str()),
71  m_plan_generation(plan_generation), m_type(type),
72  m_fragments(fragments), m_receiver_plan(receiver_plan),
73  m_replay_timeout(replay_timeout) { }
74 
77  int64_t op_id() { return m_op_id; }
78 
81  const char *location() { return m_location; }
82 
85  int32_t plan_generation() { return m_plan_generation; }
86 
89  int32_t type() { return m_type; }
90 
93  const vector<int32_t> &fragments() { return m_fragments; }
94 
97  const Lib::RangeServerRecovery::ReceiverPlan &receiver_plan() { return m_receiver_plan; }
98 
101  int32_t replay_timeout() { return m_replay_timeout; }
102 
103  private:
104 
107  uint8_t encoding_version() const override;
108 
112  size_t encoded_length_internal() const override;
113 
116  void encode_internal(uint8_t **bufp) const override;
117 
124  void decode_internal(uint8_t version, const uint8_t **bufp,
125  size_t *remainp) override;
126 
128  int64_t m_op_id;
129 
131  const char *m_location;
132 
135 
137  int32_t m_type;
138 
140  vector<int32_t> m_fragments;
141 
144 
147 
148  };
149 
151 
152 }}}}}
153 
154 #endif // Hypertable_Lib_RangeServer_Request_Parameters_ReplayFragments_h
STL namespace.
const Lib::RangeServerRecovery::ReceiverPlan & receiver_plan()
Gets receiver plan.
Lib::RangeServerRecovery::ReceiverPlan m_receiver_plan
Receiver plan.
ReplayFragments(int64_t op_id, const string &location, int32_t plan_generation, int32_t type, const vector< int32_t > &fragments, const Lib::RangeServerRecovery::ReceiverPlan &receiver_plan, int32_t replay_timeout)
Constructor.
Declarations for Serializable.
const vector< int32_t > & fragments()
Gets fragments.
Hypertable definitions
Mixin class that provides a standard serialization interface.
Definition: Serializable.h:65
Request parameters for replay fragments function.
RangeServer recovery receiver plan.
Definition: ReceiverPlan.h:48