-
Notifications
You must be signed in to change notification settings - Fork 522
fix(wal): filter inner trim record for range get #3000
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,7 @@ | |||||
| import static com.automq.stream.s3.wal.impl.object.ObjectUtils.floorAlignOffset; | ||||||
| import static com.automq.stream.s3.wal.impl.object.ObjectUtils.genObjectPathV1; | ||||||
|
|
||||||
| @SuppressWarnings("checkstyle:cyclomaticComplexity") | ||||||
| @EventLoopSafe | ||||||
| public class DefaultReader { | ||||||
| private static final Logger LOGGER = LoggerFactory.getLogger(DefaultReader.class); | ||||||
|
|
@@ -190,7 +191,11 @@ private void doRunBatchGet0(BatchReadTask readTask) { | |||||
| long nextRecordOffset = finalNextGetOffset; | ||||||
| int lastReadableBytes = buf.readableBytes(); | ||||||
| while (buf.readableBytes() > 0 && nextRecordOffset < readTask.endOffset.offset()) { | ||||||
| batches.add(ObjectUtils.decodeRecordBuf(buf)); | ||||||
| StreamRecordBatch batch = ObjectUtils.decodeRecordBuf(buf); | ||||||
| boolean isTriggerTrimRecord = batch.getCount() == 0 && batch.getStreamId() == -1L && batch.getEpoch() == -1L; | ||||||
|
||||||
| boolean isTriggerTrimRecord = batch.getCount() == 0 && batch.getStreamId() == -1L && batch.getEpoch() == -1L; | |
| boolean isTriggerTrimRecord = ObjectUtils.isTrimRecord(batch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cyclomatic complexity suppression is applied at the class level, which disables the check for all methods in the class. Consider applying this suppression more narrowly at the method level (e.g., on
doRunBatchGet0method) to maintain complexity checks for other methods.