45 #include <boost/algorithm/string.hpp>
57 m_params(name, parts) {
69 const uint8_t *ptr =
event->payload;
70 size_t remaining =
event->payload_len;
151 std::vector<Entity *> entities;
154 HT_INFOF(
"Entering RecreateIndexTables-%lld (table=%s, parts=%s) state=%s",
167 for (
auto cf_spec : schema->get_column_families()) {
180 m_context->mml_writer->record_state(shared_from_this());
222 HT_MAYBE_FAIL(
"recreate-index-tables-RESUME_TABLE_MAINTENANCE-a");
224 HT_MAYBE_FAIL(
"recreate-index-tables-RESUME_TABLE_MAINTENANCE-b");
234 HT_FATALF(
"Unrecognized state %d", state);
237 HT_INFOF(
"Leaving RecreateIndexTables-%lld (table=%s, parts=%s) state=%s",
274 return "OperationRecreateIndexTables";
278 return format(
"Recreate Index Tables (table=%s, parts=%s)",
297 m_context->hyperspace->attr_get(filename,
"schema", value_buf);
298 schema = string((
char *)value_buf.
base, strlen((
char *)value_buf.
base));
void display_state(std::ostream &os) override
Writes human readable representation of object to output stream.
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
Declarations for OperationToggleTableMaintenance.
The FailureInducer simulates errors.
ContextPtr m_context
Pointer to Master context.
const bool OFF
Constant representing off
std::string String
A String is simply a typedef to std::string.
Declarations for OperationDropTable.
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
bool validate_subops()
Handles the results of sub operations.
virtual size_t encoded_length() const
Returns serialized object length.
Declarations for OperationCreateTable.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
const TableParts & parts() const
Gets table parts.
Declarations for OperationRecreateIndexTables.
const char * get_text(int32_t state)
A dynamic, resizable and reference counted memory buffer.
Represents a set of table parts (sub-tables).
Declarations for ReferenceManager.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
const String label() override
Returns descriptive label for operation.
void execute() override
Carries out recreate index tables operation.
const string & name() const
Gets name of table to create.
Request parameters for recreate index tables operation.
virtual void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
void set_state(int32_t state)
Lib::Master::Request::Parameters::RecreateIndexTables m_params
Request parmaeters.
Compatibility Macros for C/C++.
void stage_subop(std::shared_ptr< Operation > operation)
Stages a sub operation for execution.
TableParts m_parts
Table parts to recreate.
Functions to serialize/deserialize primitives to/from a memory buffer.
void record_state()
Records operation state to the MML.
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
uint8_t encoding_version_state() const override
Returns encoding version of serialization format.
virtual void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
static Schema * new_instance(const std::string &buf)
Creates schema object from XML schema string.
#define HT_FATALF(msg,...)
const String name() override
Returns name of operation.
long long int Lld
Shortcut for printf formats.
void encode_state(uint8_t **bufp) const override
Writes serialized encoding of object state.
Declarations for general-purpose utility functions.
const bool ON
Constant representing on
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized encoding of object state.
#define HT_INFOF(msg,...)
uint8_t * base
Pointer to the allocated memory buffer.
bool value_index() const
Test if value index is included in set.
Abstract base class for master operations.
const std::string to_string() const
Returns human readable string describing table parts.
size_t encoded_length_state() const override
Returns serialized state length.
DependencySet m_exclusivities
Set of exclusivities.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
#define HT_MAYBE_FAIL(_label_)
void complete_ok(std::vector< MetaLog::EntityPtr > &additional)
bool fetch_schema(std::string &schema)
uint8_t decode_byte(const uint8_t **bufp, size_t *remainp)
Decodes a single byte from the given buffer.
OperationRecreateIndexTables(ContextPtr &context, std::string name, TableParts parts)
Constructor.
Error codes, Exception handling, error logging.
void complete_error(int error, const String &msg, std::vector< MetaLog::EntityPtr > &additional)
Completes operation with error.
Executes user-defined functions when leaving the current scope.
bool qualifier_index() const
Test if qualifier index is included in set.