Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public interface HoodieFileWriter<R extends IndexedRecord> {

void writeAvro(String key, R oldRecord) throws IOException;

long getBytesWritten();

default void prepRecordWithMetadata(R avroRecord, HoodieRecord record, String instantTime, Integer partitionId, AtomicLong recordIndex, String fileName) {
String seqId = HoodieRecord.generateSequenceId(instantTime, partitionId, recordIndex.getAndIncrement());
HoodieAvroUtils.addHoodieKeyToRecord((GenericRecord) avroRecord, record.getRecordKey(), record.getPartitionPath(), fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,4 @@ public void readFields(DataInput in) throws IOException {
writer.close();
writer = null;
}

@Override
public long getBytesWritten() {
return fs.getBytesWritten(file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,4 @@ public void close() throws IOException {

writer.close();
}

@Override
public long getBytesWritten() {
return fs.getBytesWritten(file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void writeAvroWithMetadata(R avroRecord, HoodieRecord record) throws IOEx

@Override
public boolean canWrite() {
return fs.getBytesWritten(file) < maxFileSize;
return getDataSize() < maxFileSize;
}

@Override
Expand All @@ -107,9 +107,4 @@ public void writeAvro(String key, IndexedRecord object) throws IOException {
writeSupport.add(key);
}
}

@Override
public long getBytesWritten() {
return fs.getBytesWritten(file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public void testFileSizeUpsertRecords() throws Exception {
counts++;
}
}
assertEquals(3, counts, "If the number of records are more than 1150, then there should be a new file");
assertEquals(5, counts, "If the number of records are more than 1150, then there should be a new file");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public HoodieInternalRowParquetWriter(Path file, HoodieRowParquetConfig parquetC

@Override
public boolean canWrite() {
return fs.getBytesWritten(file) < maxFileSize;
return getDataSize() < maxFileSize;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public void testFileSizeUpsertRecords() throws Exception {
counts++;
}
}
assertEquals(3, counts, "If the number of records are more than 1150, then there should be a new file");
assertEquals(5, counts, "If the number of records are more than 1150, then there should be a new file");
}

@Test
Expand Down