0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationRecoverRanges.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_Master_OperationRecoverRanges_h
23 #define Hypertable_Master_OperationRecoverRanges_h
24 
25 #include "Operation.h"
26 
28 
29 #include <vector>
30 
31 namespace Hypertable {
32 
33  using namespace Lib;
34  using namespace std;
35 
37  public:
38  OperationRecoverRanges(ContextPtr &context, const String &location,
39  int type);
40 
42  const MetaLog::EntityHeader &header_);
43 
44  void execute() override;
45  const String name() override;
46  const String label() override;
47  void display_state(std::ostream &os) override;
48  uint8_t encoding_version_state() const override;
49  size_t encoded_length_state() const override;
50  void encode_state(uint8_t **bufp) const override;
51  void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
52  void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
53  void decode_request(const uint8_t **bufp, size_t *remainp);
54 
55  private:
56  // make sure all recovery participants are available
57  bool recovery_plan_has_changed();
58  bool validate_recovery_plan();
59  void initialize_obstructions_dependencies();
60  bool wait_for_quorum();
61  void create_futures();
62  bool get_new_recovery_plan();
63  bool prepare_to_commit();
64  bool replay_fragments();
65  bool phantom_load_ranges();
66  bool commit();
67  bool acknowledge();
68  void set_type_str();
69 
72  int32_t m_type;
76  int32_t m_timeout {};
77  int32_t m_plan_generation {};
78  time_t m_last_notification {};
79  };
80 
81 }
82 
83 #endif // Hypertable_Master_OperationRecoverRanges_h
std::set< String > StringSet
STL Set managing Strings.
Definition: StringExt.h:42
Declarations for Plan.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Declarations for Operation.
STL namespace.
RangeServer recovery plan.
Definition: Plan.h:49
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Hypertable definitions
Abstract base class for master operations.
Definition: Operation.h:124