Skip to content

Commit

Permalink
[ISSUE #6525]Make ConsumeQueueInterface extends from FileQueueLifeCyc…
Browse files Browse the repository at this point in the history
…le (#6534)

* [#6525] Make ConsumeQueueInterface extends from FileQueueLifeCycle

* [#6525] forced typecast is removed

* [#6525] remove all the forced convert
  • Loading branch information
Abhijeetmishr committed Apr 15, 2023
1 parent d3a8fe0 commit d1b14b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
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);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void setTopicConfigTable(ConcurrentMap<String, TopicConfig> topicConfigTa
}

private FileQueueLifeCycle getLifeCycle(String topic, int queueId) {
return (FileQueueLifeCycle) findOrCreateConsumeQueue(topic, queueId);
return findOrCreateConsumeQueue(topic, queueId);
}

public long rollNextFile(ConsumeQueueInterface consumeQueue, final long offset) {
Expand Down Expand Up @@ -220,7 +220,7 @@ public boolean recoverConcurrently() {
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, " +
Expand Down

0 comments on commit d1b14b0

Please sign in to comment.