Skip to content
Merged
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 @@ -64,10 +64,9 @@ public long targetFileSize() {
return targetFileSize;
}

@VisibleForTesting
boolean rollingFile() throws IOException {
private boolean rollingFile(boolean forceCheck) throws IOException {
return currentWriter.reachTargetSize(
recordCount % CHECK_ROLLING_RECORD_CNT == 0, targetFileSize);
forceCheck || recordCount % CHECK_ROLLING_RECORD_CNT == 0, targetFileSize);
}

@Override
Expand All @@ -81,7 +80,7 @@ public void write(T row) throws IOException {
currentWriter.write(row);
recordCount += 1;

if (rollingFile()) {
if (rollingFile(false)) {
closeCurrentWriter();
}
} catch (Throwable e) {
Expand All @@ -105,7 +104,7 @@ public void writeBundle(BundleRecords bundle) throws IOException {
currentWriter.writeBundle(bundle);
recordCount += bundle.rowCount();

if (rollingFile()) {
if (rollingFile(true)) {
closeCurrentWriter();
}
} catch (Throwable e) {
Expand Down
Loading