32 lock_guard<mutex> lock(m_mutex);
38 if (event->type == Event::MESSAGE) {
40 const uint8_t *decode_ptr =
event->payload + 4;
41 size_t decode_remain =
event->payload_len - 4;
45 range.
decode(&decode_ptr, &decode_remain);
51 m_error_msg =
format(
"Replay to %s failed - %s",
52 event->proxy ? event->proxy : event->addr.format().c_str(),
60 m_error_msg =
format(
"Replay to %s failed",
61 event->proxy ? event->proxy : event->addr.format().c_str());
63 m_error =
event->error;
68 if (m_outstanding == 0)
76 lock_guard<mutex> lock(m_mutex);
81 m_rsclient.phantom_update(addr, m_recover_location, m_plan_generation,
82 range, fragment, buffer,
this);
85 lock_guard<mutex> lock(m_mutex);
86 HT_ERROR_OUT <<
"Error sending phantom updates for range " << range
90 m_error_msg = e.what();
95 void ReplayDispatchHandler::wait_for_completion() {
96 unique_lock<mutex> lock(m_mutex);
97 m_cond.wait(lock, [
this](){
return m_outstanding == 0; });
A memory buffer of static size.
static int32_t response_code(const Event *event)
Returns the response code from an event event generated in response to a request message.
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...
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
void add(const Key &key, uint8_t flag, const void *value, uint32_t value_len, TableMutatorAsync *value_index_mutator, TableMutatorAsync *qualifier_index_mutator)
const char * get_text(int error)
Returns a descriptive error message.
Compatibility Macros for C/C++.
const char * decode_str16(const uint8_t **bufp, size_t *remainp)
Decodes a c-style string from the given buffer.
String to_str() const
Returns string representation of address.
virtual void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
Declarations for Protocol.
#define HT_INFOF(msg,...)
This is a generic exception class for Hypertable.
Qualified (with table identifier) range specification.
bool is_proxy() const
Returns true if address is of type CommAddress::PROXY.
#define HT_THROW(_code_, _msg_)
Address abstraction to hold either proxy name or IPv4:port address.
int code() const
Returns the error code.