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

RMB-975: Define DB_HOST_ASYNC_READER, DB_PORT_ASYNC_READER #1162

Merged
merged 15 commits into from
Jul 19, 2024

Conversation

steveellis
Copy link
Contributor

https://folio-org.atlassian.net/browse/RMB-975

Breaks logic for constructing the three types of hosts out into its own class since it is now used by PostgresClient and PostgresClientWithAsyncReadConn. PostgresClientWithAsyncReadConn is responsible for setting the read host to be the async reader. Users can use the PostgresClient returned from PostgresClientWithAsyncReadConn.getInstanceas a drop in replacement ofPostgresClient`.

I opted to use inheritance rather than composition to make PostgresClientWithAsyncReadConn since extending it didn't require wrapping of all of the SELECT type of methods. If there are certain methods we don't want to support, it is easy enough to add overrides and throw an unsupported operation exception if needed.

Copy link

sonarqubecloud bot commented May 7, 2024

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
# Conflicts:
#	domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
- Added javadoc to async reader class
- Fixed up readme
- Simplified conditions in PostgresClientInitializer
- Consolidated two tests into one
@steveellis steveellis requested a review from julianladisch July 1, 2024 20:51
README.md Outdated Show resolved Hide resolved
README.md Outdated
The environment variables `DB_HOST_READER` and `DB_PORT_READER` are for the [Read and write database instances setup](#read-and-write-database-instances-setup).
The environment variables `DB_HOST_READER` and `DB_PORT_READER` are for the synchronously replicated [Read and write database instances setup](#read-and-write-database-instances-setup).

The environment variables `DB_HOST_ASYNC_READER` and `DB_PORT_ASYNC_READER` are for the [Asynchronously replicated read and write database instances setup](#asynchronously-replicated-read-and-write-database-instances-setup).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#asynchronously-replicated-read-and-write-database-instances-setup doesn't exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link doesn't work because the anchor doesn't exist on this README page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this one. Fixed.

README.md Outdated Show resolved Hide resolved
@steveellis steveellis requested a review from julianladisch July 17, 2024 19:54
Copy link

Copy link
Contributor

@julianladisch julianladisch 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, thanks!

@steveellis steveellis merged commit 24e2b7b into master Jul 19, 2024
4 checks passed
@steveellis steveellis deleted the RMB-975-define-async-reader branch July 19, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants