-
Notifications
You must be signed in to change notification settings - Fork 14.8k
KAFKA-19752: Move UnifiedLogTest to storage module (1/N) #20635
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
base: trunk
Are you sure you want to change the base?
Conversation
35b5395 to
272cefe
Compare
This reverts commit 272cefe.
| * Helper functions for writing unit tests. | ||
| * <p> | ||
| * <b>Package-private:</b> Not intended for use outside {@code org.apache.kafka.common.test}. | ||
| * Use {@code org/apache/kafka/test/TestUtils} instead. |
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.
why we need this comment?
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.
Due to this package is not public, the intention is letting other person know where can find the TestUtil could be used.
If there is no comment, we need to extra time to find it
| build(); | ||
| } | ||
|
|
||
| public static MemoryRecords singletonRecords(byte[] value, byte[] key) { |
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.
Could you move those helpers to UnifiedLogTest?
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.
Sure.
chia7712
left a comment
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.
LGTM
there are some unused methods, but I assume they will be used in the follow-up
| } | ||
|
|
||
| log.updateHighWatermark(log.logEndOffset()); | ||
| log.deleteOldSegments(); |
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.
could you add assert to ensure it does delete some segments?
|
@TaiJuWu could you fix the conflicts? |
This PR migrates several unit tests from UnifiedLogTest.scala to
UnifiedLogTest.java as part of the ongoing effort to convert core broker
logic and tests to Java.
The following test methods have been rewritten and moved:
shouldDeleteSegmentsReadyToBeDeletedWhenCleanupPolicyIsCompactAndDelete
followerShouldSaveEpochInformationFromReplicatedMessagesToTheEpochCache
New Utility Methods: To support the Java tests, new utility methods,
including LogConfigBuilder and transactional append helpers, were added
to LogTestUtils.java.
Reviewers: Chia-Ping Tsai [email protected]