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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
## I/Os

* Support for X source added (Java/Python) ([#X](https://github.com/apache/beam/issues/X)).
* [Java] Use API compatible with both com.google.cloud.bigdataoss:util 2.x and 3.x in BatchLoads ([#34105](https://github.com/apache/beam/pull/34105))

## New Features / Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ class BatchLoads<DestinationT, ElementT>
// If user triggering is supplied, we will trigger the file write after this many records are
// written.
static final int FILE_TRIGGERING_RECORD_COUNT = 500000;

// If user triggering is supplied, we will trigger the file write after this many bytes are
// written.
static final int DEFAULT_FILE_TRIGGERING_BYTE_COUNT =
AsyncWriteChannelOptions.UPLOAD_CHUNK_SIZE_DEFAULT; // 64MiB as of now
AsyncWriteChannelOptions.DEFAULT.getUploadChunkSize(); // 64MiB as of now
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also just inline the value, though it changes a bit in bigdataoss 2.x vs 3.x

2.x:

  public static final int UPLOAD_CHUNK_SIZE_GRANULARITY = 8 * 1024 * 1024;

  public static final int UPLOAD_CHUNK_SIZE_DEFAULT =
      Runtime.getRuntime().maxMemory() < 512 * 1024 * 1024
          ? UPLOAD_CHUNK_SIZE_GRANULARITY
          : 8 * UPLOAD_CHUNK_SIZE_GRANULARITY;

3.x:

  private static final int UPLOAD_CHUNK_SIZE_GRANULARITY = 8 * 1024 * 1024;

  private static final int DEFAULT_UPLOAD_CHUNK_SIZE =
      Runtime.getRuntime().maxMemory() < 512 * 1024 * 1024
          ? UPLOAD_CHUNK_SIZE_GRANULARITY
          : 3 * UPLOAD_CHUNK_SIZE_GRANULARITY;


// If using auto-sharding for unbounded data, we batch the records before triggering file write
// to avoid generating too many small files.
Expand Down
Loading