File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
fluss-client/src/test/java/org/apache/fluss/client/write Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3939import java .util .List ;
4040import java .util .concurrent .CompletableFuture ;
4141
42- import static org .apache .fluss .record .DefaultKvRecordBatch .RECORD_BATCH_HEADER_SIZE ;
42+ import static org .apache .fluss .record .LogRecordBatch .CURRENT_LOG_MAGIC_VALUE ;
43+ import static org .apache .fluss .record .LogRecordBatchFormat .recordBatchHeaderSize ;
4344import static org .apache .fluss .record .TestData .DATA1_PHYSICAL_TABLE_PATH ;
4445import static org .apache .fluss .record .TestData .DATA1_ROW_TYPE ;
4546import static org .apache .fluss .record .TestData .DATA1_TABLE_ID ;
@@ -70,7 +71,9 @@ void testTryAppendWithWriteLimit() throws Exception {
7071 writeLimit ,
7172 MemorySegment .allocateHeapMemory (writeLimit ));
7273
73- int maxRecordsPerBatch = (writeLimit - RECORD_BATCH_HEADER_SIZE ) / estimatedSizeInBytes ;
74+ int maxRecordsPerBatch =
75+ (writeLimit - recordBatchHeaderSize (CURRENT_LOG_MAGIC_VALUE ))
76+ / estimatedSizeInBytes ;
7477 for (int i = 0 ; i < maxRecordsPerBatch ; i ++) {
7578 boolean appendResult =
7679 logProducerBatch .tryAppend (createWriteRecord (), newWriteCallback ());
Original file line number Diff line number Diff line change 3939import java .util .List ;
4040import java .util .concurrent .CompletableFuture ;
4141
42- import static org .apache .fluss .record .DefaultKvRecordBatch .RECORD_BATCH_HEADER_SIZE ;
42+ import static org .apache .fluss .record .LogRecordBatch .CURRENT_LOG_MAGIC_VALUE ;
43+ import static org .apache .fluss .record .LogRecordBatchFormat .recordBatchHeaderSize ;
4344import static org .apache .fluss .record .TestData .DATA1_PHYSICAL_TABLE_PATH ;
4445import static org .apache .fluss .record .TestData .DATA1_ROW_TYPE ;
4546import static org .apache .fluss .record .TestData .DATA1_TABLE_ID ;
@@ -70,7 +71,9 @@ void testTryAppendWithWriteLimit() throws Exception {
7071 writeLimit ,
7172 MemorySegment .allocateHeapMemory (writeLimit ));
7273
73- int maxRecordsPerBatch = (writeLimit - RECORD_BATCH_HEADER_SIZE ) / estimatedSizeInBytes ;
74+ int maxRecordsPerBatch =
75+ (writeLimit - recordBatchHeaderSize (CURRENT_LOG_MAGIC_VALUE ))
76+ / estimatedSizeInBytes ;
7477 for (int i = 0 ; i < maxRecordsPerBatch ; i ++) {
7578 boolean appendResult =
7679 logProducerBatch .tryAppend (createWriteRecord (), newWriteCallback ());
You can’t perform that action at this time.
0 commit comments