0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MoveRange.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_Master_Request_Parameters_MoveRange_h
28 #define Hypertable_Lib_Master_Request_Parameters_MoveRange_h
29 
30 #include <Common/Serializable.h>
31 
34 
35 #include <string>
36 
37 using namespace std;
38 
39 namespace Hypertable {
40 namespace Lib {
41 namespace Master {
42 namespace Request {
43 namespace Parameters {
44 
47 
49  class MoveRange : public Serializable {
50  public:
51 
54  MoveRange() {}
55 
65  MoveRange(const string &source, int64_t range_id,
66  const TableIdentifier &table, const RangeSpec &range_spec,
67  const string &transfer_log, int64_t soft_limit, bool is_split)
68  : m_source(source), m_range_id(range_id), m_table(table),
69  m_range_spec(range_spec), m_transfer_log(transfer_log),
70  m_soft_limit(soft_limit), m_is_split(is_split) { }
71 
74  const string& source() const { return m_source; }
75 
78  int64_t range_id() const { return m_range_id; }
79 
82  TableIdentifier &table() { return m_table; }
83 
86  RangeSpec &range_spec() { return m_range_spec; }
87 
90  const string& transfer_log() const { return m_transfer_log; }
91 
94  int64_t soft_limit() { return m_soft_limit; }
95 
98  bool is_split() { return m_is_split; }
99 
100  private:
101 
104  uint8_t encoding_version() const override;
105 
109  size_t encoded_length_internal() const override;
110 
113  void encode_internal(uint8_t **bufp) const override;
114 
121  void decode_internal(uint8_t version, const uint8_t **bufp,
122  size_t *remainp) override;
123 
125  string m_source;
126 
128  int64_t m_range_id;
129 
132 
135 
138 
140  int64_t m_soft_limit;
141 
144  };
145 
147 
148 }}}}}
149 
150 #endif // Hypertable_Lib_Master_Request_Parameters_MoveRange_h
MoveRange(const string &source, int64_t range_id, const TableIdentifier &table, const RangeSpec &range_spec, const string &transfer_log, int64_t soft_limit, bool is_split)
Constructor.
Definition: MoveRange.h:65
Range specification.
Definition: RangeSpec.h:40
Declarations for TableIdentifier and TableIdentifierManaged.
STL namespace.
int64_t m_range_id
Range MetaLog entry identifier
Definition: MoveRange.h:128
Request parameters for move range operation.
Definition: MoveRange.h:49
Wrapper for TableIdentifier providing member storage.
TableIdentifier & table()
Gets table identifier.
Definition: MoveRange.h:82
RangeSpec & range_spec()
Gets range specification.
Definition: MoveRange.h:86
Declarations for RangeSpec and RangeSpecManaged.
Declarations for Serializable.
Hypertable definitions
TableIdentifierManaged m_table
Table identifier of table to which range belongs
Definition: MoveRange.h:131
Mixin class that provides a standard serialization interface.
Definition: Serializable.h:65
RangeSpecManaged m_range_spec
Range specification.
Definition: MoveRange.h:134
const string & transfer_log() const
Gets transfer log.
Definition: MoveRange.h:90
int64_t range_id() const
Gets range MetaLog entry identifier.
Definition: MoveRange.h:78
Wrapper for RangeSpec providing member storage.
Definition: RangeSpec.h:89
const string & source() const
Gets name of source RangeServer.
Definition: MoveRange.h:74