Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void setWriterConnection(final Connection writerConnection,
() -> Messages.get(
"ReadWriteSplittingPlugin.setWriterConnection",
new Object[] {
writerHostSpec.getUrl()}));
writerHostSpec.getHostAndPort()}));
}

private void setReaderConnection(final Connection conn, final HostSpec host) {
Expand All @@ -290,7 +290,7 @@ private void setReaderConnection(final Connection conn, final HostSpec host) {
() -> Messages.get(
"ReadWriteSplittingPlugin.setReaderConnection",
new Object[] {
host.getUrl()}));
host.getHostAndPort()}));
}

void switchConnectionIfRequired(final boolean readOnly) throws SQLException {
Expand Down Expand Up @@ -332,7 +332,7 @@ void switchConnectionIfRequired(final boolean readOnly) throws SQLException {
"ReadWriteSplittingPlugin.fallbackToWriter",
new Object[] {
e.getMessage(),
this.pluginService.getCurrentHostSpec().getUrl()}));
this.pluginService.getCurrentHostSpec().getHostAndPort()}));
}
}
} else {
Expand Down Expand Up @@ -393,7 +393,7 @@ private void switchToWriterConnection(
}

LOGGER.finer(() -> Messages.get("ReadWriteSplittingPlugin.switchedFromReaderToWriter",
new Object[] {writerHost.getUrl()}));
new Object[] {writerHost.getHostAndPort()}));
}

private void switchCurrentConnectionTo(
Expand All @@ -409,7 +409,7 @@ private void switchCurrentConnectionTo(
LOGGER.finest(() -> Messages.get(
"ReadWriteSplittingPlugin.settingCurrentConnection",
new Object[] {
newConnectionHost.getUrl()}));
newConnectionHost.getHostAndPort()}));
}

private void switchToReaderConnection(final List<HostSpec> hosts)
Expand All @@ -436,15 +436,15 @@ private void switchToReaderConnection(final List<HostSpec> hosts)
try {
switchCurrentConnectionTo(this.readerConnection, this.readerHostSpec);
LOGGER.finer(() -> Messages.get("ReadWriteSplittingPlugin.switchedFromWriterToReader",
new Object[] {this.readerHostSpec.getUrl()}));
new Object[] {this.readerHostSpec.getHostAndPort()}));
} catch (SQLException e) {
if (e.getMessage() != null) {
LOGGER.warning(
() -> Messages.get("ReadWriteSplittingPlugin.errorSwitchingToCachedReaderWithCause",
new Object[] {this.readerHostSpec.getUrl(), e.getMessage()}));
new Object[] {this.readerHostSpec.getHostAndPort(), e.getMessage()}));
} else {
LOGGER.warning(() -> Messages.get("ReadWriteSplittingPlugin.errorSwitchingToCachedReader",
new Object[] {this.readerHostSpec.getUrl()}));
new Object[] {this.readerHostSpec.getHostAndPort()}));
}

this.readerConnection.close();
Expand All @@ -466,11 +466,11 @@ private void initializeReaderConnection(final @NonNull List<HostSpec> hosts) thr
getNewWriterConnection(writerHost);
}
LOGGER.warning(() -> Messages.get("ReadWriteSplittingPlugin.noReadersFound",
new Object[] {writerHost.getUrl()}));
new Object[] {writerHost.getHostAndPort()}));
} else {
getNewReaderConnection();
LOGGER.finer(() -> Messages.get("ReadWriteSplittingPlugin.switchedFromWriterToReader",
new Object[] {this.readerHostSpec.getUrl()}));
new Object[] {this.readerHostSpec.getHostAndPort()}));
}
}

Expand Down Expand Up @@ -501,7 +501,7 @@ private void getNewReaderConnection() throws SQLException {
Messages.get(
"ReadWriteSplittingPlugin.failedToConnectToReader",
new Object[]{
hostSpec.getUrl()}),
hostSpec.getHostAndPort()}),
e);
}
}
Expand All @@ -516,7 +516,7 @@ private void getNewReaderConnection() throws SQLException {
final HostSpec finalReaderHost = readerHost;
LOGGER.finest(
() -> Messages.get("ReadWriteSplittingPlugin.successfullyConnectedToReader",
new Object[] {finalReaderHost.getUrl()}));
new Object[] {finalReaderHost.getHostAndPort()}));
setReaderConnection(conn, readerHost);
switchCurrentConnectionTo(this.readerConnection, this.readerHostSpec);
}
Expand Down
Loading