Skip to content

Commit

Permalink
[Java] Tidy up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Oct 3, 2024
1 parent 45e6644 commit 3dfb16c
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public void onStart()
recordingLog = new RecordingLog(ctx.clusterDir(), true);
backupArchive = AeronArchive.connect(ctx.archiveContext().clone());
recordingSignalPoller = new RecordingSignalPoller(
backupArchive.controlSessionId(), backupArchive.controlResponsePoller().subscription());
backupArchive.controlSessionId(),
backupArchive.controlResponsePoller().subscription());

final long nowMs = epochClock.time();
nextQueryDeadlineMsCounter.setOrdered(nowMs - 1);
Expand Down Expand Up @@ -565,23 +566,21 @@ else if (!logSourceValidator.isAcceptable(leaderMemberId, memberId))
{
CloseHelper.close(clusterArchiveAsyncConnect);

final AeronArchive.Context clusterArchiveContext = ctx.clusterArchiveContext().clone();
final ChannelUri logSupplierArchiveUri = ChannelUri.parse(
clusterArchiveContext.controlRequestChannel());
final AeronArchive.Context context = ctx.clusterArchiveContext().clone();
final ChannelUri logSupplierArchiveUri = ChannelUri.parse(context.controlRequestChannel());
logSupplierArchiveUri.put(ENDPOINT_PARAM_NAME, logSupplierMember.archiveEndpoint());
clusterArchiveContext.controlRequestChannel(logSupplierArchiveUri.toString());
context.controlRequestChannel(logSupplierArchiveUri.toString());

if (null != logSupplierMember.archiveResponseEndpoint())
{
final ChannelUri logSupplierResponseUri = ChannelUri.parse(
clusterArchiveContext.controlResponseChannel());
final ChannelUri logSupplierResponseUri = ChannelUri.parse(context.controlResponseChannel());
logSupplierResponseUri.put(MDC_CONTROL_MODE_PARAM_NAME, CONTROL_MODE_RESPONSE);
logSupplierResponseUri.remove(ENDPOINT_PARAM_NAME);
logSupplierResponseUri.put(MDC_CONTROL_PARAM_NAME, logSupplierMember.archiveResponseEndpoint());
clusterArchiveContext.controlResponseChannel(logSupplierResponseUri.toString());
context.controlResponseChannel(logSupplierResponseUri.toString());
}

clusterArchiveAsyncConnect = AeronArchive.asyncConnect(clusterArchiveContext);
clusterArchiveAsyncConnect = AeronArchive.asyncConnect(context);
}

final long nowMs = epochClock.time();
Expand Down

0 comments on commit 3dfb16c

Please sign in to comment.