Skip to content

Commit

Permalink
Initial commit (#10454)
Browse files Browse the repository at this point in the history
This PR is a precursor to the recovery logic refactor work (KAFKA-12553).

I've renamed the file: core/src/test/scala/unit/kafka/log/LogUtils.scala to core/src/test/scala/unit/kafka/log/LogTestUtils.scala. Also I've renamed the underlying lass from LogUtils to LogTestUtils. This is going to help avoid a naming conflict with a new file called LogUtils.scala that I plan to introduce in core/src/main/scala/kafka/log/ as part of the recovery logic refactor. The new file will also contain a bunch of static functions.

Tests:
Relying on existing tests to catch regressions (if any) since this is a simple change.

Reviewers: Satish Duggana <satishd@apache.org>, Dhruvil Shah <dhruvil@confluent.io>, Jun Rao <junrao@gmail.com>
  • Loading branch information
kowshik authored Mar 31, 2021
1 parent b6278ee commit 7c5c739
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/test/scala/unit/kafka/log/LogSegmentTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LogSegmentTest {
def createSegment(offset: Long,
indexIntervalBytes: Int = 10,
time: Time = Time.SYSTEM): LogSegment = {
val seg = LogUtils.createSegment(offset, logDir, indexIntervalBytes, time)
val seg = LogTestUtils.createSegment(offset, logDir, indexIntervalBytes, time)
segments += seg
seg
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/unit/kafka/log/LogSegmentsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LogSegmentsTest {
private def createSegment(offset: Long,
indexIntervalBytes: Int = 10,
time: Time = Time.SYSTEM): LogSegment = {
LogUtils.createSegment(offset, logDir, indexIntervalBytes, time)
LogTestUtils.createSegment(offset, logDir, indexIntervalBytes, time)
}

private def assertEntry(segment: LogSegment, tested: java.util.Map.Entry[java.lang.Long, LogSegment]): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.io.File
import org.apache.kafka.common.record.FileRecords
import org.apache.kafka.common.utils.Time

object LogUtils {
object LogTestUtils {
/**
* Create a segment with the given base offset
*/
Expand Down

0 comments on commit 7c5c739

Please sign in to comment.