mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-26 11:30:36 +00:00
Reads the configuration from cassandra-rackdc.properties.
This file may include the following fields:
- dc: Local Data Center name
- rack: Local Rack name
- prefer_local: A boolean value that defines if cluster should prefer
local address - relevant for AWS cloud.
Class will schedule a timer that will re-read the property file and inform a
Gossiper if there are changes in the local configuration.
Differences from the Origin C* implementation:
- No support for a legacy property_file_snitch.
- Class supports overriding the property file name in a constructor.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
New in v4:
- Fix a debug compilation: define reload_property_file_period() to be a constexpr
method instead of a member.
- Don't stop() the snitch when snitch_is_ready is set to an exceptional state.
New in v2:
- Adjust to new file interface.
- Futurize reload_propery_file().
- Use trim() and split() from boost::algorithm.
- Read optimization and logging:
- Re-read the file only if it was changed since the last read.
- Use logging facilities from log.hh.
- Cleanups:
- Introduce bad_property_file_error exception.
- Remove unnecessary check after dma_read_exactly() call.
- Styling.
- Copyright.
- Move most of the functions implementation into the .cc file.
- Added stop() method.
11 lines
289 B
C++
11 lines
289 B
C++
/*
|
|
* Copyright (C) 2015 Cloudius Systems, Ltd.
|
|
*/
|
|
|
|
// Used to ensure that all .hh files build, as well as a place to put
|
|
// out-of-line implementations.
|
|
|
|
#include "locator/simple_snitch.hh"
|
|
#include "locator/rack_inferring_snitch.hh"
|
|
#include "locator/gossiping_property_file_snitch.hh"
|