0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MetaLogEntityRange.h
Go to the documentation of this file.
1 /*
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 
28 #ifndef Hypertable_RangeServer_MetaLogEntityRange_h
29 #define Hypertable_RangeServer_MetaLogEntityRange_h
30 
32 
37 
38 namespace Hypertable {
39 
42 
45  public:
46 
51 
58  MetaLogEntityRange(const TableIdentifier &table, const RangeSpec &spec,
59  const RangeState &state, bool needs_compaction);
60 
62  virtual ~MetaLogEntityRange() { }
63 
68 
72  const char *get_table_id();
73 
77  void set_table_generation(uint32_t generation);
78 
82  void get_range_spec(RangeSpecManaged &spec);
83 
88 
92  int get_state();
93 
98  void set_state(uint8_t state, const String &source);
99 
103  void set_state_bits(uint8_t bits);
104 
108  void clear_state_bits(uint8_t bits);
109 
111  void clear_state();
112 
116  uint64_t get_soft_limit();
117 
121  void set_soft_limit(uint64_t soft_limit);
122 
127 
131  void set_split_row(const String &row);
132 
137 
141  void set_transfer_log(const String &path);
142 
147 
151  void set_start_row(const String &row);
152 
157 
161  void set_end_row(const String &row);
162 
167  void get_boundary_rows(String &start, String &end);
168 
177 
181  void set_old_boundary_row(const String &row);
182 
186  bool get_needs_compaction();
187 
191  void set_needs_compaction(bool val);
192 
196  bool get_load_acknowledged();
197 
201  void set_load_acknowledged(bool val);
202 
206  String get_source();
207 
218  void decode(const uint8_t **bufp, size_t *remainp,
219  uint16_t definition_version) override;
220 
224  const String name() override;
225 
230  void display(std::ostream &os) override;
231 
233  static bool encountered_upgrade;
234 
235  private:
236 
237  uint8_t encoding_version() const override;
238 
239  size_t encoded_length_internal() const override;
240 
241  void encode_internal(uint8_t **bufp) const override;
242 
243  void decode_internal(uint8_t version, const uint8_t **bufp,
244  size_t *remainp) override;
245 
246  void decode_old(const uint8_t **bufp, size_t *remainp);
247 
250 
253 
256 
259 
262 
263  };
264 
266  typedef std::shared_ptr<MetaLogEntityRange> MetaLogEntityRangePtr;
267 
269 
270 } // namespace Hypertable
271 
272 #endif // Hypertable_RangeServer_MetaLogEntityRange_h
void get_table_identifier(TableIdentifier &table)
Copies table identifier.
size_t encoded_length_internal() const override
Returns internal serialized length.
String get_end_row()
Gets end row.
void set_soft_limit(uint64_t soft_limit)
Sets soft limit.
bool m_load_acknowledged
Load acknowledged flag.
uint8_t encoding_version() const override
Returns encoding version.
Range specification.
Definition: RangeSpec.h:40
void clear_state_bits(uint8_t bits)
Clears bits of range state.
String get_start_row()
Gets Start row.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
String get_source()
Gets source server.
String get_old_boundary_row()
Gets old boundary row.
Declarations for TableIdentifier and TableIdentifierManaged.
void set_table_generation(uint32_t generation)
Sets table generation.
bool get_needs_compaction()
Gets needs compaction flag.
bool m_needs_compaction
Needs compaction flag.
TableIdentifierManaged m_table
Table identifier
const String name() override
Returns the entity name ("Range")
void set_transfer_log(const String &path)
Sets transfer log.
virtual ~MetaLogEntityRange()
Destructor.
Base class for MetaLog entities.
Definition: MetaLogEntity.h:62
Wrapper for TableIdentifier providing member storage.
void set_load_acknowledged(bool val)
Sets load acknowledged flag.
Declarations for RangeState.
RangeStateManaged m_state
Range state
MetaLog entity for range state persisted in RSML.
void set_split_row(const String &row)
Sets split row.
String get_transfer_log()
Gets transfer log.
void get_boundary_rows(String &start, String &end)
Gets boundary rows (start and end rows)
const char * get_table_id()
Returns table id.
bool get_load_acknowledged()
Gets load acknowledged flag.
Declarations for MetaLog::Entity.
void display(std::ostream &os) override
Writes a human readable representation of the object state to an output stream.
uint64_t get_soft_limit()
Gets soft limit.
void get_range_state(RangeStateManaged &state)
Gets range state object.
void set_old_boundary_row(const String &row)
Sets old boundary row.
Declarations for RangeSpec and RangeSpecManaged.
void set_end_row(const String &row)
Sets end row.
Hypertable definitions
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
std::shared_ptr< MetaLogEntityRange > MetaLogEntityRangePtr
Smart pointer to MetaLogEntityRange.
void decode_old(const uint8_t **bufp, size_t *remainp)
void set_needs_compaction(bool val)
Sets needs compaction flag.
void set_start_row(const String &row)
Sets start row.
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.
String get_split_row()
Gets split row.
RangeServer MetaLog entity type constants.
Range state.
Definition: RangeState.h:48
RangeSpecManaged m_spec
Range spec
void clear_state()
Clears range state object.
void set_state_bits(uint8_t bits)
Sets bits of range state.
Wrapper for RangeSpec providing member storage.
Definition: RangeSpec.h:89
MetaLogEntityRange(const MetaLog::EntityHeader &header_)
Constructor initialized from Metalog entity header.
Range state with memory management.
Definition: RangeState.h:166
void decode(const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override
Reads serialized encoding of the entity.
void set_state(uint8_t state, const String &source)
Sets range state.
void get_range_spec(RangeSpecManaged &spec)
Gets range specification.
static bool encountered_upgrade
Flag indicating that old entity was encountered.