RongtongJin commented on code in PR #7082: URL: https://github.com/apache/rocketmq/pull/7082#discussion_r1278280501
########## broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java: ########## @@ -988,7 +988,15 @@ private RemotingCommand rewriteRequestForStaticTopic(SearchOffsetRequestHeader r continue; } if (mappingDetail.getBname().equals(item.getBname())) { - offset = this.brokerController.getMessageStore().getOffsetInQueueByTime(mappingContext.getTopic(), item.getQueueId(), timestamp); + MessageStore messageStore = this.brokerController.getMessageStore(); + if (messageStore instanceof DefaultMessageStore) { + // get offset with specific boundary type + offset = ((DefaultMessageStore) messageStore).getOffsetInQueueByTime(requestHeader.getTopic(), + requestHeader.getQueueId(), requestHeader.getTimestamp(), requestHeader.getBoundaryType()); + } else { + offset = messageStore.getOffsetInQueueByTime(requestHeader.getTopic(), requestHeader.getQueueId(), + requestHeader.getTimestamp()); + } Review Comment: I found that getOffsetInQueueByTime also exists in TieredMessageStore. Would it be better to abstract an interface instead of checking the type every time? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org