LiebingYu commented on code in PR #1749:
URL: https://github.com/apache/fluss/pull/1749#discussion_r2379266714
##########
fluss-server/src/main/java/org/apache/fluss/server/log/LogLoader.java:
##########
@@ -117,6 +122,37 @@ public LoadedLogOffsets load() throws IOException {
nextOffset, activeSegment.getBaseOffset(),
activeSegment.getSizeInBytes()));
}
+ /**
+ * Just recovers the given segment, without adding it to the provided
segments.
+ *
+ * @param segment Segment to recover
+ * @return The number of bytes truncated from the segment
+ * @throws LogSegmentOffsetOverflowException if the segment contains
messages that cause index
+ * offset overflow
+ */
+ private int recoverSegment(LogSegment segment) throws Exception {
+ WriterStateManager writerStateManager =
+ new WriterStateManager(
+ logSegments.getTableBucket(),
+ logTabletDir,
+ this.writerStateManager.writerExpirationMs());
Review Comment:
This logic follow Kafka, and ceate a new WriterStateManager is a lightweight
operation. I think it's ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]