#include "private/databaseconfigurationimpl.hpp"
#include <arpa/inet.h>
+#include <boost/crc.hpp>
using namespace shareddatalayer;
dbType = DatabaseConfiguration::DbType::REDIS_CLUSTER;
else if (type == "redis-sentinel")
dbType = DatabaseConfiguration::DbType::REDIS_SENTINEL;
+ else if (type == "sdl-cluster")
+ dbType = DatabaseConfiguration::DbType::SDL_CLUSTER;
else
throw DatabaseConfiguration::InvalidDbType(type);
}
return sentinelAddress;
}
+boost::optional<HostAndPort> DatabaseConfigurationImpl::getSentinelAddress(const boost::optional<std::size_t>& addressIndex) const
+{
+ if (addressIndex)
+ return { HostAndPort(serverAddresses.at(*addressIndex).getHost(), sentinelAddress->getPort()) };
+
+ return getSentinelAddress();
+}
+
void DatabaseConfigurationImpl::checkAndApplySentinelMasterName(const std::string& name)
{
sentinelMasterName = name;