0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PhantomLoad.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_PhantomLoad_h
28 #define Hypertable_Lib_RangeServer_Request_Parameters_PhantomLoad_h
29 
32 
33 #include <Common/Serializable.h>
34 
35 #include <string>
36 #include <vector>
37 
38 using namespace std;
39 
40 namespace Hypertable {
41 namespace Lib {
42 namespace RangeServer {
43 namespace Request {
44 namespace Parameters {
45 
48 
50  class PhantomLoad : public Serializable {
51  public:
52 
56 
64  PhantomLoad(const String &location, int32_t plan_generation,
65  const vector<int32_t> &fragments,
66  const vector<QualifiedRangeSpec> &range_specs,
67  const vector<RangeState> &range_states)
68  : m_location(location.c_str()), m_plan_generation(plan_generation),
69  m_fragments(fragments), m_range_specs(range_specs),
70  m_range_states(range_states) { }
71 
74  const char *location() const { return m_location; }
75 
78  int32_t plan_generation() const { return m_plan_generation; }
79 
82  const vector<int32_t> &fragments() const { return m_fragments; }
83 
86  const vector<QualifiedRangeSpec> &range_specs() const { return m_range_specs; }
87 
90  const vector<RangeState> &range_states() const { return m_range_states; }
91 
92  private:
93 
96  uint8_t encoding_version() const override;
97 
101  size_t encoded_length_internal() const override;
102 
105  void encode_internal(uint8_t **bufp) const override;
106 
113  void decode_internal(uint8_t version, const uint8_t **bufp,
114  size_t *remainp) override;
115 
117  const char *m_location;
118 
121 
123  vector<int32_t> m_fragments;
124 
126  vector<QualifiedRangeSpec> m_range_specs;
127 
129  vector<RangeState> m_range_states;
130 
131  };
132 
134 
135 }}}}}
136 
137 #endif // Hypertable_Lib_RangeServer_Request_Parameters_PhantomLoad_h
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
STL namespace.
Declarations for QualifiedRangeSpec and QualifiedRangeSpecManaged.
Declarations for RangeState.
vector< QualifiedRangeSpec > m_range_specs
Vector of range specifications.
Definition: PhantomLoad.h:126
vector< RangeState > m_range_states
Vector of range states.
Definition: PhantomLoad.h:129
const vector< QualifiedRangeSpec > & range_specs() const
Gets range specifications.
Definition: PhantomLoad.h:86
PhantomLoad(const String &location, int32_t plan_generation, const vector< int32_t > &fragments, const vector< QualifiedRangeSpec > &range_specs, const vector< RangeState > &range_states)
Constructor.
Definition: PhantomLoad.h:64
const vector< RangeState > & range_states() const
Gets range states.
Definition: PhantomLoad.h:90
Declarations for Serializable.
Hypertable definitions
int32_t plan_generation() const
Gets plan generation.
Definition: PhantomLoad.h:78
Mixin class that provides a standard serialization interface.
Definition: Serializable.h:65
Request parameters for phantom load function.
Definition: PhantomLoad.h:50
const vector< int32_t > & fragments() const
Gets fragments.
Definition: PhantomLoad.h:82