-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
Quality Gate passedIssues Measures |
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Outdated
Show resolved
Hide resolved
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClientInitializer.java
Outdated
Show resolved
Hide resolved
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClientInitializer.java
Outdated
Show resolved
Hide resolved
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientTest.java
Outdated
Show resolved
Hide resolved
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClientWithAsyncReadConn.java
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
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). |
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.
#asynchronously-replicated-read-and-write-database-instances-setup doesn't exist.
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.
The link doesn't work because the anchor doesn't exist on this README page.
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.
Sorry I missed this one. Fixed.
Quality Gate passedIssues Measures |
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, thanks!
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
andPostgresClientWithAsyncReadConn
.PostgresClientWithAsyncReadConn
is responsible for setting the read host to be the async reader. Users can use thePostgresClient
returned from PostgresClientWithAsyncReadConn.getInstanceas a drop in replacement of
PostgresClient`.I opted to use inheritance rather than composition to make
PostgresClientWithAsyncReadConn
since extending it didn't require wrapping of all of theSELECT
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.