Skip to content

Commit

Permalink
[core] Increase write-max-writers-to-spill and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Aug 5, 2024
1 parent da4fbb9 commit 68ed999
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/generated/core_configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@
</tr>
<tr>
<td><h5>write-max-writers-to-spill</h5></td>
<td style="word-wrap: break-word;">5</td>
<td style="word-wrap: break-word;">10</td>
<td>Integer</td>
<td>When in batch append inserting, if the writer number is greater than this option, we open the buffer cache and spill function to avoid out-of-memory. </td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public class CoreOptions implements Serializable {
public static final ConfigOption<Integer> WRITE_MAX_WRITERS_TO_SPILL =
key("write-max-writers-to-spill")
.intType()
.defaultValue(5)
.defaultValue(10)
.withDescription(
"When in batch append inserting, if the writer number is greater than this option, we open the buffer cache and spill function to avoid out-of-memory. ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
import org.apache.paimon.utils.SnapshotManager;
import org.apache.paimon.utils.StatsCollectorFactories;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;

import java.io.IOException;
Expand All @@ -58,6 +61,8 @@
/** {@link FileStoreWrite} for {@link AppendOnlyFileStore}. */
public class AppendOnlyFileStoreWrite extends MemoryFileStoreWrite<InternalRow> {

private static final Logger LOG = LoggerFactory.getLogger(AppendOnlyFileStoreWrite.class);

private final FileIO fileIO;
private final RawFileSplitRead read;
private final long schemaId;
Expand Down Expand Up @@ -228,6 +233,9 @@ protected void forceBufferSpill() throws Exception {
return;
}
forceBufferSpill = true;
LOG.info(
"Force buffer spill for append-only file store write, writer number is: {}",
writers.size());
for (Map<Integer, WriterContainer<InternalRow>> bucketWriters : writers.values()) {
for (WriterContainer<InternalRow> writerContainer : bucketWriters.values()) {
((AppendOnlyWriter) writerContainer.writer).toBufferedWriter();
Expand Down

0 comments on commit 68ed999

Please sign in to comment.