Skip to content

Commit

Permalink
Update some service name in ha service
Browse files Browse the repository at this point in the history
  • Loading branch information
RongtongJin committed May 6, 2022
1 parent 541a6d0 commit ce534ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ private boolean transferData() throws Exception {
@Override
public String getServiceName() {
if (haService.getDefaultMessageStore().getBrokerConfig().isInBrokerContainer()) {
return haService.getDefaultMessageStore().getBrokerConfig().getLoggerIdentifier() + WriteSocketService.class.getSimpleName();
return haService.getDefaultMessageStore().getBrokerIdentity().getLoggerIdentifier() + WriteSocketService.class.getSimpleName();
}
return WriteSocketService.class.getSimpleName();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public void reOpen() throws IOException {
}

@Override public String getServiceName() {
if (haService.getDefaultMessageStore().getBrokerConfig().isInBrokerContainer()) {
return haService.getDefaultMessageStore().getBrokerIdentity().getLoggerIdentifier() + AutoSwitchHAClient.class.getSimpleName();
}
return AutoSwitchHAClient.class.getSimpleName();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

public class AutoSwitchHAConnection implements HAConnection {
/**
* Header protocol in syncing msg from master.
* Format: current state + body size + offset + epoch + epochStartOffset + additionalInfo(confirmOffset).
* If the msg is hankeShakeMsg, the body size = EpochEntrySize * EpochEntryNums, the offset is maxOffset in master.
* Header protocol in syncing msg from master. Format: current state + body size + offset + epoch +
* epochStartOffset + additionalInfo(confirmOffset). If the msg is hankeShakeMsg, the body size = EpochEntrySize *
* EpochEntryNums, the offset is maxOffset in master.
*/
public static final int MSG_HEADER_SIZE = 4 + 4 + 8 + 4 + 8 + 8;
public static final int EPOCH_ENTRY_SIZE = 12;
Expand Down Expand Up @@ -218,6 +218,9 @@ public void run() {

@Override
public String getServiceName() {
if (haService.getDefaultMessageStore().getBrokerConfig().isInBrokerContainer()) {
return haService.getDefaultMessageStore().getBrokerIdentity().getLoggerIdentifier() + ReadSocketService.class.getSimpleName();
}
return ReadSocketService.class.getSimpleName();
}

Expand Down Expand Up @@ -336,7 +339,7 @@ protected void onStop() {
@Override
public String getServiceName() {
if (haService.getDefaultMessageStore().getBrokerConfig().isInBrokerContainer()) {
return haService.getDefaultMessageStore().getBrokerConfig().getLoggerIdentifier() + WriteSocketService.class.getSimpleName();
return haService.getDefaultMessageStore().getBrokerIdentity().getLoggerIdentifier() + WriteSocketService.class.getSimpleName();
}
return WriteSocketService.class.getSimpleName();
}
Expand Down

0 comments on commit ce534ee

Please sign in to comment.