Skip to content

Commit 5938626

Browse files
committed
fix tests
1 parent b7520ea commit 5938626

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

fluss-common/src/main/java/org/apache/fluss/record/AbstractRowMemoryLogRecordsBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import java.io.IOException;
2828

29-
import static org.apache.fluss.record.DefaultValueRecordBatch.RECORD_BATCH_HEADER_SIZE;
3029
import static org.apache.fluss.record.LogRecordBatch.CURRENT_LOG_MAGIC_VALUE;
3130
import static org.apache.fluss.record.LogRecordBatchFormat.BASE_OFFSET_LENGTH;
3231
import static org.apache.fluss.record.LogRecordBatchFormat.LENGTH_LENGTH;
@@ -36,6 +35,7 @@
3635
import static org.apache.fluss.record.LogRecordBatchFormat.NO_WRITER_ID;
3736
import static org.apache.fluss.record.LogRecordBatchFormat.crcOffset;
3837
import static org.apache.fluss.record.LogRecordBatchFormat.lastOffsetDeltaOffset;
38+
import static org.apache.fluss.record.LogRecordBatchFormat.recordBatchHeaderSize;
3939
import static org.apache.fluss.record.LogRecordBatchFormat.schemaIdOffset;
4040
import static org.apache.fluss.utils.Preconditions.checkArgument;
4141

fluss-common/src/main/java/org/apache/fluss/record/DefaultLogRecordBatch.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.nio.ByteBuffer;
3939
import java.util.NoSuchElementException;
4040

41-
import static org.apache.fluss.record.DefaultValueRecordBatch.RECORD_BATCH_HEADER_SIZE;
4241
import static org.apache.fluss.record.LogRecordBatchFormat.BASE_OFFSET_OFFSET;
4342
import static org.apache.fluss.record.LogRecordBatchFormat.COMMIT_TIMESTAMP_OFFSET;
4443
import static org.apache.fluss.record.LogRecordBatchFormat.LENGTH_OFFSET;

fluss-common/src/test/java/org/apache/fluss/record/MemoryLogRecordsCompactedBuilderTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ void testNoRecordAppendAndBaseOffset() throws Exception {
115115
// base offset 0
116116
MemoryLogRecordsCompactedBuilder builder = createBuilder(0, 1, 1024);
117117
MemoryLogRecords records = MemoryLogRecords.pointToBytesView(builder.build());
118-
assertThat(records.sizeInBytes()).isEqualTo(48); // only batch header
118+
assertThat(records.sizeInBytes())
119+
.isEqualTo(
120+
LogRecordBatchFormat.recordBatchHeaderSize(
121+
DEFAULT_MAGIC)); // only batch header
119122
LogRecordBatch batch = records.batches().iterator().next();
120123
batch.ensureValid();
121124
assertThat(batch.getRecordCount()).isEqualTo(0);
@@ -132,7 +135,8 @@ void testNoRecordAppendAndBaseOffset() throws Exception {
132135
// base offset 100
133136
builder = createBuilder(100, 1, 1024);
134137
records = MemoryLogRecords.pointToBytesView(builder.build());
135-
assertThat(records.sizeInBytes()).isEqualTo(48);
138+
assertThat(records.sizeInBytes())
139+
.isEqualTo(LogRecordBatchFormat.recordBatchHeaderSize(DEFAULT_MAGIC));
136140
batch = records.batches().iterator().next();
137141
batch.ensureValid();
138142
assertThat(batch.getRecordCount()).isEqualTo(0);

0 commit comments

Comments
 (0)