33 #include <boost/algorithm/string.hpp>
42 m_params(name, flags) {
54 const uint8_t *ptr =
event->payload;
55 size_t remaining =
event->payload_len;
71 HT_INFOF(
"Entering DropNamespace-%lld(%s, flags=%s) state=%s",
86 m_context->mml_writer->record_state(shared_from_this());
101 hyperspace_dir =
m_context->toplevel_dir +
"/tables/" +
m_id;
102 m_context->hyperspace->unlink(hyperspace_dir);
119 HT_FATALF(
"Unrecognized state %d", state);
122 HT_INFOF(
"Leaving DropNamespace-%lld(%s, flags=%s) state=%s",
133 <<
" id=" <<
m_id <<
" ";
162 return "OperationDropNamespace";
const string & name() const
Gets name of namespace to drop.
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
The FailureInducer simulates errors.
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
ContextPtr m_context
Pointer to Master context.
std::string m_id
Namespace ID path.
void encode_state(uint8_t **bufp) const override
Encode operation state.
std::string String
A String is simply a typedef to std::string.
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
static std::string to_str(int flags)
Converts flags to human readable string.
virtual size_t encoded_length() const
Returns serialized object length.
uint8_t encoding_version_state() const override
Returns version of encoding format of state.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
size_t encoded_length_vstr(size_t len)
Computes the encoded length of vstr (vint64, data, null)
const char * get_text(int32_t state)
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
OperationDropNamespace(ContextPtr &context, const std::string &name, int32_t flags)
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decode operation state.
virtual void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
void set_state(int32_t state)
void display_state(std::ostream &os) override
Write human readable operation state to output stream.
Compatibility Macros for C/C++.
Declarations for NamespaceFlag.
Functions to serialize/deserialize primitives to/from a memory buffer.
size_t encoded_length_state() const override
Encoded length of operation state.
const std::string name() override
Name of operation used for exclusivity.
virtual void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
void encode_vstr(uint8_t **bufp, const void *buf, size_t len)
Encode a buffer as variable length string (vint64, data, null)
#define HT_FATALF(msg,...)
long long int Lld
Shortcut for printf formats.
Request parameters for drop namespace operation.
Lib::Master::Request::Parameters::DropNamespace m_params
Request parmaeters.
Perform operation if namespace exists.
DependencySet m_dependencies
Set of dependencies.
#define HT_INFOF(msg,...)
int32_t flags()
Gets drop flags.
Abstract base class for master operations.
void execute() override
Executes (carries out) the operation.
This is a generic exception class for Hypertable.
DependencySet m_exclusivities
Set of exclusivities.
#define HT_MAYBE_FAIL(_label_)
void complete_ok(std::vector< MetaLog::EntityPtr > &additional)
void initialize_dependencies()
const std::string label() override
Human readable label for operation.
Error codes, Exception handling, error logging.
void complete_error(int error, const String &msg, std::vector< MetaLog::EntityPtr > &additional)
Completes operation with error.
int code() const
Returns the error code.
Executes user-defined functions when leaving the current scope.