mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-28 20:09:14 +08:00
* [#6525] Make ConsumeQueueInterface extends from FileQueueLifeCycle * [apache#6525] forced typecast is removed * [#6525] remove all the forced convert
This commit is contained in:
@@ -41,7 +41,7 @@ import org.apache.rocketmq.store.SelectMappedBufferResult;
|
||||
import org.apache.rocketmq.store.config.BrokerRole;
|
||||
import org.apache.rocketmq.store.logfile.MappedFile;
|
||||
|
||||
public class BatchConsumeQueue implements ConsumeQueueInterface, FileQueueLifeCycle {
|
||||
public class BatchConsumeQueue implements ConsumeQueueInterface {
|
||||
protected static final Logger log = LoggerFactory.getLogger(LoggerName.STORE_LOGGER_NAME);
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.apache.rocketmq.common.message.MessageExtBrokerInner;
|
||||
import org.apache.rocketmq.store.DispatchRequest;
|
||||
import org.apache.rocketmq.store.MessageFilter;
|
||||
|
||||
public interface ConsumeQueueInterface {
|
||||
public interface ConsumeQueueInterface extends FileQueueLifeCycle {
|
||||
/**
|
||||
* Get the topic name
|
||||
* @return the topic this cq belongs to.
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ConsumeQueueStore {
|
||||
}
|
||||
|
||||
private FileQueueLifeCycle getLifeCycle(String topic, int queueId) {
|
||||
return (FileQueueLifeCycle) findOrCreateConsumeQueue(topic, queueId);
|
||||
return findOrCreateConsumeQueue(topic, queueId);
|
||||
}
|
||||
|
||||
public long rollNextFile(ConsumeQueueInterface consumeQueue, final long offset) {
|
||||
@@ -220,7 +220,7 @@ public class ConsumeQueueStore {
|
||||
FutureTask<Boolean> futureTask = new FutureTask<>(() -> {
|
||||
boolean ret = true;
|
||||
try {
|
||||
((FileQueueLifeCycle) logic).recover();
|
||||
logic.recover();
|
||||
} catch (Throwable e) {
|
||||
ret = false;
|
||||
log.error("Exception occurs while recover consume queue concurrently, " +
|
||||
|
||||
Reference in New Issue
Block a user