#include <RangeServer.h>
Public Member Functions | |
RangeServer (PropertiesPtr &, ConnectionManagerPtr &, ApplicationQueuePtr &, Hyperspace::SessionPtr &) | |
virtual | ~RangeServer () |
void | compact (ResponseCallback *, const TableIdentifier &, const char *row, int32_t flags) |
void | create_scanner (Response::Callback::CreateScanner *, const TableIdentifier &, const RangeSpec &, const ScanSpec &, QueryCache::Key *) |
void | destroy_scanner (ResponseCallback *cb, int32_t scanner_id) |
void | fetch_scanblock (Response::Callback::CreateScanner *, int32_t scanner_id) |
void | load_range (ResponseCallback *, const TableIdentifier &, const RangeSpec &, const RangeState &, bool needs_compaction) |
void | acknowledge_load (Response::Callback::AcknowledgeLoad *cb, const vector< QualifiedRangeSpec > &specs) |
void | update_schema (ResponseCallback *, const TableIdentifier &, const char *) |
void | update (Response::Callback::Update *cb, uint64_t cluster_id, const TableIdentifier &table, uint32_t count, StaticBuffer &buffer, uint32_t flags) |
Inserts data into a table. More... | |
void | batch_update (std::vector< UpdateRecTable * > &updates, ClockT::time_point expire_time) |
void | commit_log_sync (ResponseCallback *cb, uint64_t cluster_id, const TableIdentifier &table) |
void | drop_table (ResponseCallback *cb, const TableIdentifier &table) |
void | dump (ResponseCallback *, const char *, bool) |
void | dump_pseudo_table (ResponseCallback *cb, const TableIdentifier &table, const char *pseudo_table, const char *outfile) |
void | get_statistics (Response::Callback::GetStatistics *cb, const std::vector< SystemVariable::Spec > &specs, uint64_t generation) |
void | drop_range (ResponseCallback *, const TableIdentifier &, const RangeSpec &) |
void | relinquish_range (ResponseCallback *, const TableIdentifier &, const RangeSpec &) |
void | heapcheck (ResponseCallback *, const char *) |
void | metadata_sync (ResponseCallback *, const char *, uint32_t flags, std::vector< const char * > columns) |
void | replay_fragments (ResponseCallback *, int64_t op_id, const String &location, int32_t plan_generation, int32_t type, const vector< int32_t > &fragments, const RangeServerRecovery::ReceiverPlan &receiver_plan, int32_t replay_timeout) |
void | phantom_load (ResponseCallback *, const String &location, int32_t plan_generation, const vector< int32_t > &fragments, const vector< QualifiedRangeSpec > &specs, const vector< RangeState > &states) |
void | phantom_update (Response::Callback::PhantomUpdate *, const String &location, int32_t plan_generation, const QualifiedRangeSpec &range, int32_t fragment, EventPtr &event) |
void | phantom_prepare_ranges (ResponseCallback *, int64_t op_id, const String &location, int32_t plan_generation, const vector< QualifiedRangeSpec > &ranges) |
void | phantom_commit_ranges (ResponseCallback *, int64_t op_id, const String &location, int32_t plan_generation, const vector< QualifiedRangeSpec > &ranges) |
void | set_state (ResponseCallback *cb, const std::vector< SystemVariable::Spec > &specs, int64_t generation) |
void | table_maintenance_enable (ResponseCallback *cb, const TableIdentifier &table) |
Enables maintenance for a table. More... | |
void | table_maintenance_disable (ResponseCallback *cb, const TableIdentifier &table) |
Disables maintenance for a table. More... | |
void | wait_for_maintenance (ResponseCallback *cb) |
Blocks while the maintenance queue is non-empty. More... | |
void | group_commit () |
void | do_maintenance () |
MaintenanceSchedulerPtr & | get_scheduler () |
ApplicationQueuePtr | get_application_queue () |
void | master_change () |
bool | replay_finished () |
void | status (Response::Callback::Status *cb) |
void | shutdown () |
void | write_profile_data (const String &line) |
Private Types | |
typedef std::map< String, SchemaPtr > | TableSchemaMap |
typedef map< String, PhantomRangeMapPtr > | FailoverPhantomRangeMap |
Private Member Functions | |
void | initialize (PropertiesPtr &) |
void | local_recover () |
void | decode_table_id (const uint8_t **bufp, size_t *remainp, TableIdentifier *tid) |
void | get_table_schemas (TableSchemaMap &table_schemas) |
void | replay_load_range (TableInfoMap &replay_map, MetaLogEntityRangePtr &range_entity) |
void | replay_log (TableInfoMap &replay_map, CommitLogReaderPtr &log_reader) |
void | verify_schema (TableInfoPtr &, uint32_t generation, const TableSchemaMap *table_schemas=0) |
bool | live (const vector< QualifiedRangeSpec > &ranges) |
bool | live (const QualifiedRangeSpec &spec) |
void | group_commit_add (EventPtr &event, uint64_t cluster_id, SchemaPtr &schema, const TableIdentifier &table, uint32_t count, StaticBuffer &buffer, uint32_t flags) |
bool | test_and_set_get_statistics_outstanding (bool value) |
Performs a "test and set" operation on m_get_statistics_outstanding. More... | |
Static Private Member Functions | |
static void | map_table_schemas (const String &parent, const std::vector< DirEntryAttr > &listing, TableSchemaMap &table_schemas) |
Definition at line 94 of file RangeServer.h.
|
private |
Definition at line 291 of file RangeServer.h.
|
private |
Definition at line 230 of file RangeServer.h.
Apps::RangeServer::RangeServer | ( | PropertiesPtr & | props, |
ConnectionManagerPtr & | conn_mgr, | ||
ApplicationQueuePtr & | app_queue, | ||
Hyperspace::SessionPtr & | hyperspace | ||
) |
Compute maintenance threads
Check for and connect to commit log FS broker
Listen for incoming connections
Definition at line 110 of file RangeServer.cc.
|
virtual |
Definition at line 477 of file RangeServer.cc.
void Apps::RangeServer::acknowledge_load | ( | Response::Callback::AcknowledgeLoad * | cb, |
const vector< QualifiedRangeSpec > & | specs | ||
) |
Definition at line 1941 of file RangeServer.cc.
void Apps::RangeServer::batch_update | ( | std::vector< UpdateRecTable * > & | updates, |
ClockT::time_point | expire_time | ||
) |
Definition at line 2147 of file RangeServer.cc.
void Apps::RangeServer::commit_log_sync | ( | ResponseCallback * | cb, |
uint64_t | cluster_id, | ||
const TableIdentifier & | table | ||
) |
Definition at line 2018 of file RangeServer.cc.
void Apps::RangeServer::compact | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const char * | row, | ||
int32_t | flags | ||
) |
Definition at line 1131 of file RangeServer.cc.
void Apps::RangeServer::create_scanner | ( | Response::Callback::CreateScanner * | cb, |
const TableIdentifier & | table, | ||
const RangeSpec & | range_spec, | ||
const ScanSpec & | scan_spec, | ||
QueryCache::Key * | cache_key | ||
) |
Send back data
Definition at line 1427 of file RangeServer.cc.
|
private |
Definition at line 957 of file RangeServer.cc.
void Apps::RangeServer::destroy_scanner | ( | ResponseCallback * | cb, |
int32_t | scanner_id | ||
) |
Definition at line 1616 of file RangeServer.cc.
void Apps::RangeServer::do_maintenance | ( | ) |
Definition at line 3670 of file RangeServer.cc.
void Apps::RangeServer::drop_range | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const RangeSpec & | range_spec | ||
) |
Remove the range
Definition at line 2819 of file RangeServer.cc.
void Apps::RangeServer::drop_table | ( | ResponseCallback * | cb, |
const TableIdentifier & | table | ||
) |
Definition at line 2155 of file RangeServer.cc.
void Apps::RangeServer::dump | ( | ResponseCallback * | cb, |
const char * | outfile, | ||
bool | nokeys | ||
) |
Definition at line 2236 of file RangeServer.cc.
void Apps::RangeServer::dump_pseudo_table | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const char * | pseudo_table, | ||
const char * | outfile | ||
) |
Definition at line 2306 of file RangeServer.cc.
void Apps::RangeServer::fetch_scanblock | ( | Response::Callback::CreateScanner * | cb, |
int32_t | scanner_id | ||
) |
Send back data
Definition at line 1623 of file RangeServer.cc.
|
inline |
Definition at line 206 of file RangeServer.h.
|
inline |
Definition at line 204 of file RangeServer.h.
void Apps::RangeServer::get_statistics | ( | Response::Callback::GetStatistics * | cb, |
const std::vector< SystemVariable::Spec > & | specs, | ||
uint64_t | generation | ||
) |
Aggregate per-table stats
If created a mutator above, write data to sys/RS_METRICS
Definition at line 2463 of file RangeServer.cc.
|
private |
void Apps::RangeServer::group_commit | ( | ) |
Definition at line 3666 of file RangeServer.cc.
|
private |
Definition at line 3720 of file RangeServer.cc.
void Apps::RangeServer::heapcheck | ( | ResponseCallback * | cb, |
const char * | outfile | ||
) |
Definition at line 2373 of file RangeServer.cc.
|
private |
Create log directories
Definition at line 486 of file RangeServer.cc.
|
private |
Definition at line 3604 of file RangeServer.cc.
|
private |
Definition at line 3617 of file RangeServer.cc.
void Apps::RangeServer::load_range | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const RangeSpec & | range_spec, | ||
const RangeState & | range_state, | ||
bool | needs_compaction | ||
) |
Queue "range_start_row" update for sys/RS_METRICS table
Check for existence of and create, if necessary, range directory (md5 of endrow) under all locality group directories for this table
Take ownership of the range by writing the 'Location' column in the METADATA table, or /hypertable/root{location} attribute of Hyperspace if it is the root range.
Take ownership of the range
Definition at line 1720 of file RangeServer.cc.
|
private |
Create the logs
Definition at line 596 of file RangeServer.cc.
|
staticprivate |
void Hypertable::Apps::RangeServer::master_change | ( | ) |
void Apps::RangeServer::metadata_sync | ( | ResponseCallback * | cb, |
const char * | table_id, | ||
uint32_t | flags, | ||
std::vector< const char * > | columns | ||
) |
Definition at line 1289 of file RangeServer.cc.
void Apps::RangeServer::phantom_commit_ranges | ( | ResponseCallback * | cb, |
int64_t | op_id, | ||
const String & | location, | ||
int32_t | plan_generation, | ||
const vector< QualifiedRangeSpec > & | ranges | ||
) |
Take ownership of the range by writing the 'Location' column in the METADATA table, or /hypertable/root{location} attribute of Hyperspace if it is the root range.
Definition at line 3395 of file RangeServer.cc.
void Apps::RangeServer::phantom_load | ( | ResponseCallback * | cb, |
const String & | location, | ||
int32_t | plan_generation, | ||
const vector< int32_t > & | fragments, | ||
const vector< QualifiedRangeSpec > & | specs, | ||
const vector< RangeState > & | states | ||
) |
Definition at line 3033 of file RangeServer.cc.
void Apps::RangeServer::phantom_prepare_ranges | ( | ResponseCallback * | cb, |
int64_t | op_id, | ||
const String & | location, | ||
int32_t | plan_generation, | ||
const vector< QualifiedRangeSpec > & | ranges | ||
) |
Definition at line 3174 of file RangeServer.cc.
void Apps::RangeServer::phantom_update | ( | Response::Callback::PhantomUpdate * | cb, |
const String & | location, | ||
int32_t | plan_generation, | ||
const QualifiedRangeSpec & | range, | ||
int32_t | fragment, | ||
EventPtr & | event | ||
) |
Definition at line 3115 of file RangeServer.cc.
void Apps::RangeServer::relinquish_range | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const RangeSpec & | range_spec | ||
) |
Definition at line 2852 of file RangeServer.cc.
|
inline |
Definition at line 210 of file RangeServer.h.
void Apps::RangeServer::replay_fragments | ( | ResponseCallback * | cb, |
int64_t | op_id, | ||
const String & | location, | ||
int32_t | plan_generation, | ||
int32_t | type, | ||
const vector< int32_t > & | fragments, | ||
const RangeServerRecovery::ReceiverPlan & | receiver_plan, | ||
int32_t | replay_timeout | ||
) |
Definition at line 2890 of file RangeServer.cc.
|
private |
Lazily create sys/METADATA table pointer
Definition at line 976 of file RangeServer.cc.
|
private |
Definition at line 1052 of file RangeServer.cc.
void Apps::RangeServer::set_state | ( | ResponseCallback * | cb, |
const std::vector< SystemVariable::Spec > & | specs, | ||
int64_t | generation | ||
) |
Definition at line 2397 of file RangeServer.cc.
void Apps::RangeServer::shutdown | ( | ) |
Definition at line 397 of file RangeServer.cc.
void Apps::RangeServer::status | ( | Response::Callback::Status * | cb | ) |
Definition at line 375 of file RangeServer.cc.
void Apps::RangeServer::table_maintenance_disable | ( | ResponseCallback * | cb, |
const TableIdentifier & | table | ||
) |
Disables maintenance for a table.
This function disables maintenance for the table identified by table
, waits for any in progress maintenance on any of the table's ranges to complete, and then calls IndexUpdaterFactory::clear_cache() to drop any cached index tables.
cb | Response callback |
table | Table identifier |
Definition at line 2431 of file RangeServer.cc.
void Apps::RangeServer::table_maintenance_enable | ( | ResponseCallback * | cb, |
const TableIdentifier & | table | ||
) |
Enables maintenance for a table.
cb | Response callback |
table | Table identifier |
Definition at line 2408 of file RangeServer.cc.
|
inlineprivate |
Performs a "test and set" operation on m_get_statistics_outstanding.
value | New value for m_get_statistics_outstanding |
Definition at line 251 of file RangeServer.h.
void Apps::RangeServer::update | ( | Response::Callback::Update * | cb, |
uint64_t | cluster_id, | ||
const TableIdentifier & | table, | ||
uint32_t | count, | ||
StaticBuffer & | buffer, | ||
uint32_t | flags | ||
) |
Inserts data into a table.
TODO: set commit_interval.
Definition at line 2091 of file RangeServer.cc.
void Apps::RangeServer::update_schema | ( | ResponseCallback * | cb, |
const TableIdentifier & | table, | ||
const char * | schema_str | ||
) |
Definition at line 1995 of file RangeServer.cc.
|
private |
Definition at line 3635 of file RangeServer.cc.
void Apps::RangeServer::wait_for_maintenance | ( | ResponseCallback * | cb | ) |
Blocks while the maintenance queue is non-empty.
cb | Response callback |
Definition at line 3627 of file RangeServer.cc.
|
inline |
Definition at line 218 of file RangeServer.h.
|
private |
Definition at line 296 of file RangeServer.h.
|
private |
Definition at line 306 of file RangeServer.h.
|
private |
Definition at line 295 of file RangeServer.h.
|
private |
Definition at line 259 of file RangeServer.h.
|
private |
Definition at line 342 of file RangeServer.h.
|
private |
Definition at line 338 of file RangeServer.h.
|
private |
Definition at line 297 of file RangeServer.h.
|
private |
Definition at line 298 of file RangeServer.h.
|
private |
Definition at line 292 of file RangeServer.h.
|
private |
Definition at line 293 of file RangeServer.h.
|
private |
Ganglia metrics collector.
Definition at line 348 of file RangeServer.h.
|
private |
Indicates if a get_statistics() call is outstanding.
Definition at line 316 of file RangeServer.h.
|
private |
Definition at line 327 of file RangeServer.h.
|
private |
Definition at line 328 of file RangeServer.h.
|
private |
Definition at line 301 of file RangeServer.h.
|
private |
Definition at line 341 of file RangeServer.h.
|
private |
Definition at line 331 of file RangeServer.h.
|
private |
Definition at line 336 of file RangeServer.h.
|
private |
Definition at line 310 of file RangeServer.h.
|
private |
Definition at line 333 of file RangeServer.h.
|
private |
Flush method for METADATA commit log updates.
Definition at line 272 of file RangeServer.h.
|
private |
Flush method for USER commit log updates.
Definition at line 275 of file RangeServer.h.
|
private |
Definition at line 260 of file RangeServer.h.
|
private |
Definition at line 307 of file RangeServer.h.
|
private |
Smart pointer to maintenance scheduler.
Definition at line 322 of file RangeServer.h.
|
private |
Definition at line 300 of file RangeServer.h.
|
private |
Definition at line 299 of file RangeServer.h.
|
private |
Definition at line 337 of file RangeServer.h.
|
private |
Process metrics.
Definition at line 351 of file RangeServer.h.
|
private |
Definition at line 258 of file RangeServer.h.
|
private |
Table name-to-ID mapper
Definition at line 319 of file RangeServer.h.
|
private |
Definition at line 332 of file RangeServer.h.
|
private |
Definition at line 334 of file RangeServer.h.
|
private |
Definition at line 335 of file RangeServer.h.
|
private |
Definition at line 339 of file RangeServer.h.
|
private |
Definition at line 340 of file RangeServer.h.
|
private |
Definition at line 345 of file RangeServer.h.
|
private |
Definition at line 344 of file RangeServer.h.
|
private |
Definition at line 343 of file RangeServer.h.
|
private |
Configuration properties.
Definition at line 280 of file RangeServer.h.
|
private |
Definition at line 329 of file RangeServer.h.
|
private |
Definition at line 330 of file RangeServer.h.
|
private |
Outstanding scanner map.
Definition at line 304 of file RangeServer.h.
|
private |
Definition at line 305 of file RangeServer.h.
|
private |
Flag indicating if server is shutting down.
Definition at line 289 of file RangeServer.h.
|
private |
Flag indicating if server is starting up.
Definition at line 286 of file RangeServer.h.
|
private |
Definition at line 309 of file RangeServer.h.
|
private |
Timestamp (nanoseconds) of last metrics collection.
Definition at line 313 of file RangeServer.h.
|
private |
Definition at line 277 of file RangeServer.h.
|
private |
Smart pointer to timer handler.
Definition at line 325 of file RangeServer.h.
|
private |
Update pipeline for METADTA table.
Definition at line 263 of file RangeServer.h.
|
private |
Update pipeline for other (non-METADATA) system tables.
Definition at line 266 of file RangeServer.h.
|
private |
Update pipeline for USER tables.
Definition at line 269 of file RangeServer.h.
|
private |
Flag indicating if verbose logging is enabled.
Definition at line 283 of file RangeServer.h.