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 if (type == "sdl-standalone-cluster")
+ dbType = DatabaseConfiguration::DbType::SDL_STANDALONE_CLUSTER;
+ else if (type == "sdl-sentinel-cluster")
+ dbType = DatabaseConfiguration::DbType::SDL_SENTINEL_CLUSTER;
else
throw DatabaseConfiguration::InvalidDbType(type);
}
return serverAddresses;
}
+DatabaseConfiguration::Addresses DatabaseConfigurationImpl::getServerAddresses(const boost::optional<std::size_t>& addressIndex) const
+{
+ if (addressIndex)
+ return { HostAndPort(serverAddresses.at(*addressIndex)) };
+
+ return serverAddresses;
+}
+
DatabaseConfiguration::Addresses DatabaseConfigurationImpl::getDefaultServerAddresses() const
{
return { HostAndPort(getDefaultHost(), htons(DEFAULT_PORT)) };