-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom endpoint support #218
Conversation
098d646
to
1dbd66a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍 And thanks for breaking up changes into multiple commits. Will tests for this be added in this PR or a separate PR?
Will add the tests in this PR as well |
77c9341
to
290d4d7
Compare
3b61688
to
bd0e989
Compare
49e54de
to
2abe8b3
Compare
2abe8b3
to
304c093
Compare
Aws::RDS::Model::DescribeDBClusterEndpointsRequest request; | ||
request.SetDBClusterEndpointIdentifier(this->endpoint_identifier); | ||
// TODO: Investigate why filters returns `InvalidParameterCombination` error saying filter values are null. | ||
// request.AddFilters(filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will uncomment this once this fix is released on aws-sdk-cpp: aws/aws-sdk-cpp#3264
const std::string& custom_endpoint_host, | ||
const std::string& endpoint_identifier, const std::string& region, | ||
long long refresh_rate_nanos, ctpl::thread_pool& thread_pool, | ||
bool enable_logging, std::shared_ptr<Aws::RDS::RDSClient> client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you added the client
parameter to this version of the constructor but I don't see it being used in any of the initializers below. How is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in the unit test
driver/topology_service.cc
Outdated
if (allowed_list.size() > 0) { | ||
for (const auto& host : topology->get_instances()) { | ||
if (allowed_list.find(host->get_host_id()) != allowed_list.end()) { | ||
filtered_topology->add_host(host); | ||
} | ||
} | ||
} | ||
|
||
if (blocked_list.size() > 0) { | ||
for (const auto& host : filtered_topology->get_instances()) { | ||
// Remove blocked hosts from the filtered_topology. | ||
if (blocked_list.find(host->get_host_id()) != blocked_list.end()) { | ||
filtered_topology->remove_host(host); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that calling find
on an empty list will always return end()
, I think this block can be simplified as follows which eliminates traversing filtered_topology->get_instances()
twice.
for (const auto& host : topology->get_instances()) {
if (allowed_list.find(host->get_host_id()) != allowed_list.end()) {
filtered_topology->add_host(host);
}
if (blocked_list.find(host->get_host_id()) != blocked_list.end()) {
filtered_topology->remove_host(host);
}
}
6b803c9
to
da3e366
Compare
Summary
Support for RDS custom endpoints.
GUI:
Description
Review Status
Additional Reviewers