0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationEphemeral.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 
29 #ifndef Hypertable_Master_OperationEphemeral_h
30 #define Hypertable_Master_OperationEphemeral_h
31 
32 #include <ctime>
33 #include <set>
34 
35 #include "AsyncComm/Event.h"
36 
37 #include "Common/ScopeGuard.h"
38 #include "Common/Time.h"
39 
41 
42 #include "Context.h"
43 #include "Operation.h"
44 
45 namespace Hypertable {
46 
56  class OperationEphemeral : public Operation {
57  public:
58 
65  OperationEphemeral(ContextPtr &context, int32_t type) :
66  Operation(context, type) {
67  m_ephemeral = true;
68  }
69 
77  OperationEphemeral(ContextPtr &context, EventPtr &event, int32_t type) :
78  Operation(context, event, type) {
79  m_ephemeral = true;
80  }
81 
89  const MetaLog::EntityHeader &header_) :
90  Operation(context, header_) {
91  m_ephemeral = true;
92  }
93 
95  virtual ~OperationEphemeral() { }
96 
101  size_t encoded_length_state() const override {
102  HT_ASSERT(!"Ephemeral operation");
103  }
104 
109  void encode_state(uint8_t **bufp) const override {
110  HT_ASSERT(!"Ephemeral operation");
111  }
112 
117  void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override {
118  HT_ASSERT(!"Ephemeral operation");
119  }
120 
125  void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override {
126  HT_ASSERT(!"Ephemeral operation");
127  }
128 
133  uint8_t encoding_version_state() const override {
134  HT_ASSERT(!"Ephemeral operation");
135  }
136 
137  };
138 
141 }
142 
143 #endif // Hypertable_Master_OperationEphemeral_h
Abstract base class for ephemeral operations.
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decode operation state.
Declarations for Operation.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
OperationEphemeral(ContextPtr &context, int32_t type)
Constructor with operation type specifier.
Declarations for Event.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
#define HT_ASSERT(_e_)
Definition: Logger.h:396
virtual ~OperationEphemeral()
Destructor.
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decode operation state.
OperationEphemeral(ContextPtr &context, EventPtr &event, int32_t type)
Constructor with request Event and operation type specifier.
Declarations for MetaLog::Entity.
OperationEphemeral(ContextPtr &context, const MetaLog::EntityHeader &header_)
Constructor with MetaLog::EntityHeader.
Time related declarations.
size_t encoded_length_state() const override
Encoded length of operation state.
bool m_ephemeral
Indicates if operation is ephemeral and does not get persisted to MML.
Definition: Operation.h:583
Hypertable definitions
Abstract base class for master operations.
Definition: Operation.h:124
uint8_t encoding_version_state() const override
Returns version of encoding format.
Declarations for Context.
Executes user-defined functions when leaving the current scope.
void encode_state(uint8_t **bufp) const override
Encode operation state.