Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ConsumeQueueInterface extends from FileQueueLifeCycle #6525

Closed
ni-ze opened this issue Apr 1, 2023 · 6 comments · Fixed by #6534
Closed

Make ConsumeQueueInterface extends from FileQueueLifeCycle #6525

ni-ze opened this issue Apr 1, 2023 · 6 comments · Fixed by #6534
Assignees
Labels

Comments

@ni-ze
Copy link
Contributor

ni-ze commented Apr 1, 2023

The issue tracker is used for bug reporting purposes ONLY whereas feature request needs to follow the RIP process. To avoid unnecessary duplication, please check whether there is a previous issue before filing a new one.

It is recommended to start a discussion thread in the mailing lists or github discussions in cases of discussing your deployment plan, API clarification, and other non-bug-reporting issues.
We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.

Please ensure that your bug report is clear and self-contained. Otherwise, it would take additional rounds of communication, thus more time, to understand the problem itself.

Generally, fixing an issue goes through the following steps:

  1. Understand the issue reported;
  2. Reproduce the unexpected behavior locally;
  3. Perform root cause analysis to identify the underlying problem;
  4. Create test cases to cover the identified problem;
  5. Work out a solution to rectify the behavior and make the newly created test cases pass;
  6. Make a pull request and go through peer review;

As a result, it would be very helpful yet challenging if you could provide an isolated project reproducing your reported issue. Anyway, please ensure your issue report is informative enough for the community to pick up. At a minimum, include the following hints:

BUG REPORT

  1. Please describe the issue you observed:

ConsumeQueue BatchConsumeQueue and SparseConsumeQueue implement interface FileQueueLifeCycle and FileQueueLifeCycle, so the fellow convert will not throw ClassCastException. However, It better to prevent from grammatical level.
image

public interface ConsumeQueueInterface extends FileQueueLifeCycle{
...
}
  • What did you do (The steps to reproduce)?

  • What is expected to see?

  • What did you see instead?

  1. Please tell us about your environment:

  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):

FEATURE REQUEST

  1. Please describe the feature you are requesting.

  2. Provide any additional detail on your proposed use case for this feature.

  3. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

  4. If there are some sub-tasks involved, use -[] for each sub-task and create a corresponding issue to map to the sub-task:

@Abhijeetmishr
Copy link
Contributor

Abhijeetmishr commented Apr 1, 2023

@ni-ze can I work on this issue ?

@ni-ze
Copy link
Contributor Author

ni-ze commented Apr 2, 2023

@Abhijeetmishr Sure.

@Abhijeetmishr
Copy link
Contributor

@Abhijeetmishr Sure.

working on it

@Abhijeetmishr
Copy link
Contributor

One possible solution to this issue is to refactor the code so that the ConsumeQueueInterface class extends the FileQueueLifeCycle class. This would allow the ConsumeQueueInterface class to inherit all of the functionality of the FileQueueLifeCycle class, and avoid the need for duplicated code.

Implementation: To implement this solution, we would first modify the FileQueueLifeCycle class to include any methods or functionality that are currently duplicated in the ConsumeQueueInterface class. We would then modify the Consume QueueInterface class to extend the File Queue Life Cycle class, so that it can inherit this functionality.

Thank you for suggestion working on it.

@Abhijeetmishr
Copy link
Contributor

@ni-ze we are typecasting here

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

but interface is not extending FileQueueLifeCycle.
So it will throw typecast error.

@Abhijeetmishr
Copy link
Contributor

@ni-ze @Oliverwqcwrw Please review this.

Abhijeetmishr added a commit to Abhijeetmishr/rocketmq that referenced this issue Apr 4, 2023
Abhijeetmishr added a commit to Abhijeetmishr/rocketmq that referenced this issue Apr 13, 2023
ni-ze pushed a commit that referenced this issue Apr 15, 2023
…le (#6534)

* [#6525] Make ConsumeQueueInterface extends from FileQueueLifeCycle

* [#6525] forced typecast is removed

* [#6525] remove all the forced convert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants