0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MetaLogEntityRemoveOkLogs.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 
29 #ifndef Hypertable_RangeServer_MetaLogEntityRemoveOkLogs_h
30 #define Hypertable_RangeServer_MetaLogEntityRemoveOkLogs_h
31 
32 #include "MetaLogEntityTypes.h"
33 
36 
37 #include <Common/StringExt.h>
38 
39 namespace Hypertable {
40 
43 
47  public:
48 
53 
58 
61 
64 
68  void insert(const String &pathname);
69 
73  void insert(StringSet &logs);
74 
78  void remove(StringSet &logs);
79 
83  void get(StringSet &logs);
84 
88  uint32_t decode_version() {
89  return m_decode_version;
90  }
91 
102  void decode(const uint8_t **bufp, size_t *remainp,
103  uint16_t definition_version) override;
104 
108  const String name() override;
109 
114  void display(std::ostream &os) override;
115 
116  private:
117 
118  uint8_t encoding_version() const override;
119 
120  size_t encoded_length_internal() const override;
121 
122  void encode_internal(uint8_t **bufp) const override;
123 
124  void decode_internal(uint8_t version, const uint8_t **bufp,
125  size_t *remainp) override;
126 
127  void decode_old(const uint8_t **bufp, size_t *remainp);
128 
131 
134 
135  };
136 
138  typedef std::shared_ptr<MetaLogEntityRemoveOkLogs> MetaLogEntityRemoveOkLogsPtr;
139 
141 
142 }
143 
144 #endif // Hypertable_RangeServer_MetaLogEntityRemoveOkLogs_h
std::set< String > StringSet
STL Set managing Strings.
Definition: StringExt.h:42
void insert(const String &pathname)
Inserts a log into the remove ok set.
size_t encoded_length_internal() const override
Returns internal serialized length.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
const String name() override
Returns the entity name ("Range")
uint32_t decode_version()
Returns format of decoded entity.
MetaLog entity to track transfer logs that can be safely removed
Base class for MetaLog entities.
Definition: MetaLogEntity.h:62
Declarations for RangeState.
StringSet m_log_set
Set of log pathnames that can be safely removed.
Declarations for MetaLog::Entity.
void decode_old(const uint8_t **bufp, size_t *remainp)
uint32_t m_decode_version
Version of serialized entity decoded.
Hypertable definitions
uint8_t encoding_version() const override
Returns encoding version.
void decode(const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override
Reads serialized encoding of the entity.
std::shared_ptr< MetaLogEntityRemoveOkLogs > MetaLogEntityRemoveOkLogsPtr
Smart pointer to MetaLogEntityRemoveOkLogs.
RangeServer MetaLog entity type constants.
String extensions and helpers: sets, maps, append operators etc.
void display(std::ostream &os) override
Writes a human readable representation of the object state to an output stream.
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.