48 HT_INFOF(
"Entering SystemStatus-%lld state=%s",
53 uint32_t deadline = (uint32_t)((
double)
m_event->header.timeout_ms * 0.75);
54 Timer timer(deadline,
true);
58 set<string> locations;
59 vector<RangeServerConnectionPtr> servers;
60 vector<DispatchHandlerOperationSystemStatus::Result> results;
63 m_context->rsc_manager->get_servers(servers);
64 if (servers.empty()) {
68 results.reserve(servers.size());
69 for (
auto &rsc : servers) {
71 results.push_back(result);
72 locations.insert(result.location);
75 dispatch_handler.DispatchHandlerOperation::start(locations);
78 for (
auto &result : results) {
96 status.
set(result.status.get(),
108 "RangeServer quorum has not been reached");
118 return "OperationSystemStatus";
157 return format(
"RangeServer %s (%s) %s - %s",
158 result.
location.c_str(), address.c_str(),
166 address.c_str(), text.c_str());
String format_ipaddress()
Returns a string with a dotted notation ("127.0.0.1") without! the port.
size_t encoded_result_length() const override
Length of encoded operation result.
ContextPtr m_context
Pointer to Master context.
Holds Nagios-style program status information.
Abstract base class for ephemeral operations.
std::string String
A String is simply a typedef to std::string.
std::string status_text_from_result(DispatchHandlerOperationSystemStatus::Result &result)
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
virtual size_t encoded_length() const
Returns serialized object length.
Declarations for DispatchHandlerOperationSystemStatus.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Carries out scatter/gather requests for RangeServer status.
void set_status(const Hypertable::Status &status)
Sets status object.
const char * get_text(int32_t state)
void set(Code code, const std::string &text)
Sets status code and text.
Code
Enumeration for status codes.
EventPtr m_event
Pointer to client event (if any) that originated the operation.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
void execute() override
Executes (carries out) the operation.
virtual void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
Response::Parameters::SystemStatus m_params
const char * get_text(int error)
Returns a descriptive error message.
bool status(ContextPtr &context, Timer &timer, Status &status)
Runs a status check on the master.
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
const String label() override
Human readable label for operation.
Functions to serialize/deserialize primitives to/from a memory buffer.
OperationSystemStatus(ContextPtr &context, EventPtr &event)
bool wait_for_completion()
Waits for requests to complete.
void initialize(std::vector< Result > &results)
Performs initialization.
long long int Lld
Shortcut for printf formats.
Holds result of a RangeServer status request.
Declarations for general-purpose utility functions.
#define HT_INFOF(msg,...)
void get(Code *code, std::string &text) const
Gets status code and text.
const String name() override
Name of operation used for exclusivity.
A timer class to keep timeout states across AsyncComm related calls.
Declarations for StatusPersister.
void complete_ok(std::vector< MetaLog::EntityPtr > &additional)
std::string format_output_line(const std::string &service)
Formats a Nagios-style output line.
String extensions and helpers: sets, maps, append operators etc.
Error codes, Exception handling, error logging.
void encode_result(uint8_t **bufp) const override
Encode operation result.