dockerzhang / incubator-inlong

Apache InLong - a one-stop data streaming platform
https://inlong.apache.org/
Apache License 2.0
0 stars 0 forks source link

[INLONG-40] Optimize message disk store classes's logic #40

Closed dockerzhang closed 3 years ago

dockerzhang commented 3 years ago

Recently, in actual testing and troubleshooting, we analyzed and organized the logic of file storage (org.apache.tubemq.server.broker.msgstore.disk), and found some problems that need to be optimized:

1. Because the data uses an out-of-date aging mechanism, the FileSegment file indexing method is not necessary,and this logic interferes will with the use of the system;

2. The FileReadView class is intended to construct a separate view of the read data processing, and at the same time control the read operation in the view. From the actual troubleshooting, this logic is not necessary, and no requests will read expired files, the class for read encapsulation is not needed;

3. The FileSegmentList class, from the test point of view, the use of List is not as good as the array method, and not faster, at the same time, this class is best to form a container without too much other business logic, so that the abstraction will be more suitable for its positioning.

I'll append my changes to improve them.

JIRA link - [INLONG-40] created by gosonzhang