Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set buffer size to 8MB for export jobs to reduce ram usage #4366

Merged
merged 2 commits into from
Jul 18, 2024
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 @@ -23,6 +23,7 @@
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.extensions.gcp.options.GcpOptions;
import org.apache.beam.sdk.extensions.gcp.options.GcsOptions;
import org.apache.beam.sdk.io.DefaultFilenamePolicy;
import org.apache.beam.sdk.io.FileSystems;
import org.apache.beam.sdk.io.Read;
Expand Down Expand Up @@ -95,7 +96,10 @@
*/
@InternalExtensionOnly
public class ExportJob {
public interface ExportOptions extends GcpOptions {

static final int GCS_UPLOAD_BUFFER_SIZE_BYTES_DEFAULT = 8388608;

public interface ExportOptions extends GcpOptions, GcsOptions {
@Description("This Bigtable App Profile id.")
ValueProvider<String> getBigtableAppProfileId();

Expand Down Expand Up @@ -182,6 +186,9 @@ public static void main(String[] args) {

ExportOptions opts =
PipelineOptionsFactory.fromArgs(args).withValidation().as(ExportOptions.class);
if (opts.getGcsUploadBufferSizeBytes() == null) {
opts.setGcsUploadBufferSizeBytes(GCS_UPLOAD_BUFFER_SIZE_BYTES_DEFAULT);
}

Pipeline pipeline = buildPipeline(opts);

Expand Down