Skip to content

Commit e59d453

Browse files
authored
perf: Set gcsUploadBufferSizeBytes to 8MB for Export Jobs to reduce RAM usage (#4366)
1 parent ae0a15d commit e59d453

File tree

1 file changed

+8
-1
lines changed
  • bigtable-dataflow-parent/bigtable-beam-import/src/main/java/com/google/cloud/bigtable/beam/sequencefiles

1 file changed

+8
-1
lines changed

bigtable-dataflow-parent/bigtable-beam-import/src/main/java/com/google/cloud/bigtable/beam/sequencefiles/ExportJob.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.beam.sdk.Pipeline;
2424
import org.apache.beam.sdk.PipelineResult;
2525
import org.apache.beam.sdk.extensions.gcp.options.GcpOptions;
26+
import org.apache.beam.sdk.extensions.gcp.options.GcsOptions;
2627
import org.apache.beam.sdk.io.DefaultFilenamePolicy;
2728
import org.apache.beam.sdk.io.FileSystems;
2829
import org.apache.beam.sdk.io.Read;
@@ -95,7 +96,10 @@
9596
*/
9697
@InternalExtensionOnly
9798
public class ExportJob {
98-
public interface ExportOptions extends GcpOptions {
99+
100+
static final int GCS_UPLOAD_BUFFER_SIZE_BYTES_DEFAULT = 8388608;
101+
102+
public interface ExportOptions extends GcpOptions, GcsOptions {
99103
@Description("This Bigtable App Profile id.")
100104
ValueProvider<String> getBigtableAppProfileId();
101105

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

183187
ExportOptions opts =
184188
PipelineOptionsFactory.fromArgs(args).withValidation().as(ExportOptions.class);
189+
if (opts.getGcsUploadBufferSizeBytes() == null) {
190+
opts.setGcsUploadBufferSizeBytes(GCS_UPLOAD_BUFFER_SIZE_BYTES_DEFAULT);
191+
}
185192

186193
Pipeline pipeline = buildPipeline(opts);
187194

0 commit comments

Comments
 (0)