Skip to content

Commit

Permalink
perf: Set gcsUploadBufferSizeBytes to 8MB for Export Jobs to reduce R…
Browse files Browse the repository at this point in the history
…AM usage
  • Loading branch information
justinuang committed Jun 6, 2024
1 parent f244ff9 commit bfee5fd
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit bfee5fd

Please sign in to comment.