https://gitcode.net/apacherocketmq/rocketmq/-/commit/45946d475697f0b78e4d3b31105f75bb76e7ee19Ignore the existed queueId in static topi creation2021-11-18T10:15:44+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/25a588b81fd58dccb1e5f81e8a65859570a76a89Init the remapping command2021-11-18T12:00:15+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/e9cafe9fef748b92ea4d020e16bb95192ffaadffPolish the remapping logic2021-11-18T14:36:47+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/cabc3838ff68792498631da9e133c711167ff922Finish the remapping command2021-11-18T15:13:41+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/ffcc54897f76bc6754673fd686f170ea17fffec8Refactor the code package for static topic2021-11-18T15:20:16+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/82364fc28592980c8215edfaf4e20e254c39a861Polish the tools2021-11-18T15:52:54+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/165e133a64ae34fa992223f3472f6398d3c9cb2aEnable to run from file for createStaticTopic command2021-11-18T16:57:19+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/f225fd05de44f5e46dc5da34a27fe0b1e947f0efPolish the code for command2021-11-18T17:31:41+08:00dongeforeverdongeforever@apache.orghttps://gitcode.net/apacherocketmq/rocketmq/-/commit/f05cfb9295bc8439ee65f5d364e5f47ab7330e65Polish the static topic commands2021-11-18T17:36:58+08:00dongeforeverdongeforever@apache.org
thrownewRuntimeException("The topic name is inconsistent in broker "+broker);
}
if(topic!=null
&&!topic.equals(mappingDetail.getTopic())){
thrownewRuntimeException("The topic name is not match for broker "+broker);
}
if(maxEpoch!=-1
&&maxEpoch!=mappingDetail.getEpoch()){
thrownewRuntimeException(String.format("epoch dose not match %d != %d in %s",maxEpoch,mappingDetail.getEpoch(),mappingDetail.getBname()));
}else{
maxEpoch=mappingDetail.getEpoch();
}
if(maxNum!=-1
&&maxNum!=mappingDetail.getTotalQueues()){
thrownewRuntimeException(String.format("total queue number dose not match %d != %d in %s",maxNum,mappingDetail.getTotalQueues(),mappingDetail.getBname()));
thrownewRuntimeException(String.format("epoch dose not match %d != %d in %s",tmpMaxEpochAndNum.getKey(),mappingDetail.getEpoch(),mappingDetail.getBname()));
thrownewRuntimeException(String.format("total queue number dose not match %d != %d in %s",tmpMaxEpochAndNum.getValue(),mappingDetail.getTotalQueues(),mappingDetail.getBname()));
thrownewRuntimeException(String.format("The total queue number in config dose not match the real hosted queues %d != %d",maxEpochAndNum.getValue(),globalIdMap.size()));
}
for(inti=0;i<maxEpochAndNum.getValue();i++){
if(!globalIdMap.containsKey(i)){
thrownewRuntimeException(String.format("The queue number %s is not in globalIdMap",i));
}
}
}
}
if(queueNum<globalIdMap.size()){
if(queueNum<globalIdMap.size()){
thrownewRuntimeException(String.format("Cannot decrease the queue num for static topic %d < %d",queueNum,globalIdMap.size()));
thrownewRuntimeException(String.format("Cannot decrease the queue num for static topic %d < %d",queueNum,globalIdMap.size()));
...
@@ -183,48 +225,71 @@ public class UpdateStaticTopicSubCommand implements SubCommand {
...
@@ -183,48 +225,71 @@ public class UpdateStaticTopicSubCommand implements SubCommand {
if(queueNum==globalIdMap.size()){
if(queueNum==globalIdMap.size()){
thrownewRuntimeException("The topic queue num is equal the existed queue num, do nothing");
thrownewRuntimeException("The topic queue num is equal the existed queue num, do nothing");