Skip to content
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

Merged
merged 8 commits into from
Jan 28, 2025
Merged

feat: custom endpoint support #218

merged 8 commits into from
Jan 28, 2025

Conversation

karenc-bq
Copy link
Contributor

@karenc-bq karenc-bq commented Jan 10, 2025

Summary

Support for RDS custom endpoints.

GUI:
image

Description

Review Status

  • This is ready for review
  • This is complete

Additional Reviewers

@karenc-bq karenc-bq added the wip Pull requests that are a work in progress label Jan 10, 2025
@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch 2 times, most recently from 098d646 to 1dbd66a Compare January 10, 2025 19:00
driver/rds_utils.cc Outdated Show resolved Hide resolved
driver/cache_map.cc Outdated Show resolved Hide resolved
driver/custom_endpoint_monitor.cc Outdated Show resolved Hide resolved
driver/custom_endpoint_monitor.cc Outdated Show resolved Hide resolved
driver/rds_utils.cc Outdated Show resolved Hide resolved
setupgui/windows/resource.h Outdated Show resolved Hide resolved
util/installer.cc Outdated Show resolved Hide resolved
driver/custom_endpoint_proxy.h Outdated Show resolved Hide resolved
driver/custom_endpoint_proxy.h Outdated Show resolved Hide resolved
Copy link
Contributor

@jkwuc89 jkwuc89 left a 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?

@karenc-bq
Copy link
Contributor Author

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

@karenc-bq karenc-bq changed the title [WIP] feat: custom endpoint support feat: custom endpoint support Jan 17, 2025
@karenc-bq karenc-bq added ready for review Pull requests that are ready to be reviewed and removed wip Pull requests that are a work in progress labels Jan 17, 2025
@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch 13 times, most recently from 77c9341 to 290d4d7 Compare January 23, 2025 09:39
@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch 2 times, most recently from 3b61688 to bd0e989 Compare January 24, 2025 19:41
@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch 3 times, most recently from 49e54de to 2abe8b3 Compare January 26, 2025 05:52
@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch from 2abe8b3 to 304c093 Compare January 26, 2025 23:40
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);
Copy link
Contributor Author

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

docs/using-the-aws-driver/CustomEndpoint.md Show resolved Hide resolved
setupgui/windows/odbcdialogparams.rc Show resolved Hide resolved
driver/topology_service.cc Outdated Show resolved Hide resolved
driver/custom_endpoint_proxy.cc Outdated Show resolved Hide resolved
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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/failover_handler.cc Outdated Show resolved Hide resolved
driver/host_info.cc Outdated Show resolved Hide resolved
Comment on lines 195 to 210
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);
}
}
}
Copy link
Contributor

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);
  }
}

@karenc-bq karenc-bq force-pushed the feat/custom-endpoints branch from 6b803c9 to da3e366 Compare January 28, 2025 19:17
integration/connection_string_builder.h Outdated Show resolved Hide resolved
driver/custom_endpoint_proxy.h Outdated Show resolved Hide resolved
docs/using-the-aws-driver/CustomEndpoint.md Outdated Show resolved Hide resolved
@karenc-bq karenc-bq merged commit f65ffec into main Jan 28, 2025
7 checks passed
@karenc-bq karenc-bq deleted the feat/custom-endpoints branch January 28, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Pull requests that are ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants