40 m_params(name, flags) {
51 const uint8_t *ptr =
event->payload;
52 size_t remaining =
event->payload_len;
66 string hyperspace_dir;
69 HT_INFOF(
"Entering CreateNamespace-%lld('%s', flags=%s, '%s') state=%s",
81 else if (is_namespace)
88 m_context->mml_writer->record_state(shared_from_this());
109 m_context->hyperspace->mkdirs(hyperspace_dir);
111 m_context->hyperspace->mkdir(hyperspace_dir);
123 HT_FATALF(
"Unrecognized state %d", state);
126 HT_INFOF(
"Leaving CreateNamespace-%lld('%s', flags=%s, '%s') state=%s",
136 os <<
" (id=" <<
m_id <<
")";
153 const uint8_t **bufp,
160 const uint8_t **bufp,
169 return "OperationCreateNamespace";
#define HT_THROW2F(_code_, _ex_, _fmt_,...)
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
void initialize_dependencies()
The FailureInducer simulates errors.
ContextPtr m_context
Pointer to Master context.
static std::string to_str(int flags)
Converts flags to human readable string.
virtual size_t encoded_length() const
Returns serialized object length.
std::string m_id
Namespace ID path.
void encode_state(uint8_t **bufp) const override
Encode operation 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.
Request parameters for create namespace operation.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
const string & name() const
Gets name of namespace to create.
Lib::Master::Request::Parameters::CreateNamespace m_params
Request parmaeters.
Perform operation if namespace does not exist.
OperationCreateNamespace(ContextPtr &context, const std::string &name, int32_t flags)
virtual void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
void set_state(int32_t state)
Compatibility Macros for C/C++.
int32_t flags()
Gets create flags.
Declarations for NamespaceFlag.
Functions to serialize/deserialize primitives to/from a memory buffer.
void execute() override
Executes (carries out) the operation.
uint8_t encoding_version_state() const override
Returns version of encoding format of state.
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.
DependencySet m_dependencies
Set of dependencies.
#define HT_INFOF(msg,...)
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Create intermediate namespaces.
Abstract base class for master operations.
const std::string name() override
Name of operation used for exclusivity.
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decode operation state.
This is a generic exception class for Hypertable.
const std::string label() override
Human readable label for operation.
size_t encoded_length_state() const override
Encoded length of operation state.
void display_state(std::ostream &os) override
Write human readable operation state to output stream.
DependencySet m_exclusivities
Set of exclusivities.
#define HT_MAYBE_FAIL(_label_)
void complete_ok(std::vector< MetaLog::EntityPtr > &additional)
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.