Skip to content

Commit

Permalink
[ISSUE #7334] registerIncrementBrokerData for single topic update
Browse files Browse the repository at this point in the history
Signed-off-by: Ziy1-Tan <[email protected]>
  • Loading branch information
Ziy1-Tan authored and Ziy1-Tan committed Sep 11, 2023
1 parent 6fd0073 commit 5195450
Showing 1 changed file with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ public TopicConfig createTopicInSendMessageMethod(final String topic, final Stri
}

if (createNew) {
this.brokerController.registerBrokerAll(false, true, true);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {
this.brokerController.registerSingleTopicAll(topicConfig);
} else {
this.brokerController.registerIncrementBrokerData(topicConfig, dataVersion);
}
}

return topicConfig;
Expand Down Expand Up @@ -394,7 +398,11 @@ public TopicConfig createTopicInSendMessageBackMethod(
}

if (createNew) {
this.brokerController.registerBrokerAll(false, true, true);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {
this.brokerController.registerSingleTopicAll(topicConfig);
} else {
this.brokerController.registerIncrementBrokerData(topicConfig, dataVersion);
}
}

return topicConfig;
Expand Down Expand Up @@ -435,7 +443,11 @@ public TopicConfig createTopicOfTranCheckMaxTime(final int clientDefaultTopicQue
}

if (createNew) {
this.brokerController.registerBrokerAll(false, true, true);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {
this.brokerController.registerSingleTopicAll(topicConfig);
} else {
this.brokerController.registerIncrementBrokerData(topicConfig, dataVersion);
}
}

return topicConfig;
Expand All @@ -461,7 +473,11 @@ public void updateTopicUnitFlag(final String topic, final boolean unit) {
dataVersion.nextVersion(stateMachineVersion);

this.persist();
this.brokerController.registerBrokerAll(false, true, true);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {
this.brokerController.registerSingleTopicAll(topicConfig);
} else {
this.brokerController.registerIncrementBrokerData(topicConfig, dataVersion);
}
}
}

Expand All @@ -484,7 +500,11 @@ public void updateTopicUnitSubFlag(final String topic, final boolean hasUnitSub)
dataVersion.nextVersion(stateMachineVersion);

this.persist();
this.brokerController.registerBrokerAll(false, true, true);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {
this.brokerController.registerSingleTopicAll(topicConfig);
} else {
this.brokerController.registerIncrementBrokerData(topicConfig, dataVersion);
}
}
}

Expand Down

0 comments on commit 5195450

Please sign in to comment.