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.
- Introduce snitch_base class that implements all snitch functionality
except for get_rack() and get_datacenter() methods.
- Requires the inheriting classes to initialize _my_rack and _my_dc fields.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
New in v2:
- Returned copyright lines.
- Make _my_dc and _my_rack a non-optional for now.
- Styling and add an "override" qualifier to virtual functions implementations.
- Move most of snitch_base members into snitch_base.cc.
- snitch_base.hh: Add "Modified by Cloudius Systems" to a license.
- simple_snitch: copyright
- rack_inferring_snitch: copyright