Skip to content

Commit 76fc7b4

Browse files
committed
Add Go support for specifying iops and throughput
1 parent 6fbdc5d commit 76fc7b4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

sdks/go/pkg/beam/runners/dataflow/dataflow.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ var (
6363
maxNumWorkers = flag.Int64("max_num_workers", 0, "Maximum number of workers during scaling (optional).")
6464
diskSizeGb = flag.Int64("disk_size_gb", 0, "Size of root disk for VMs, in GB (optional).")
6565
diskType = flag.String("disk_type", "", "Type of root disk for VMs (optional).")
66+
diskProvisionedIOPS = flag.Int64("disk_provisioned_iops", 0, "Provisioned IOPS for the root disk for VMs (optional).")
67+
diskProvisionedThroughputMibps = flag.Int64("disk_provisioned_throughput_mibps", 0, "Provisioned throughput for the root disk for VMs (optional).")
6668
autoscalingAlgorithm = flag.String("autoscaling_algorithm", "", "Autoscaling mode to use (optional).")
6769
zone = flag.String("zone", "", "GCP zone (optional)")
6870
kmsKey = flag.String("dataflow_kms_key", "", "The Cloud KMS key identifier used to encrypt data at rest (optional).")
@@ -115,6 +117,8 @@ var flagFilter = map[string]bool{
115117
"max_num_workers": true,
116118
"disk_size_gb": true,
117119
"disk_type": true,
120+
"disk_provisioned_iops": true,
121+
"disk_provisioned_throughput_mibps": true,
118122
"autoscaling_algorithm": true,
119123
"zone": true,
120124
"network": true,
@@ -396,6 +400,8 @@ func getJobOptions(ctx context.Context, streaming bool) (*dataflowlib.JobOptions
396400
WorkerHarnessThreads: *workerHarnessThreads,
397401
DiskSizeGb: *diskSizeGb,
398402
DiskType: *diskType,
403+
DiskProvisionedIOPS: *diskProvisionedIOPS,
404+
DiskProvisionedThroughputMibps: *diskProvisionedThroughputMibps,
399405
Algorithm: *autoscalingAlgorithm,
400406
FlexRSGoal: *flexRSGoal,
401407
MachineType: *firstNonEmpty(workerMachineType, machineType),

sdks/go/pkg/beam/runners/dataflow/dataflowlib/job.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ type JobOptions struct {
5858
NumWorkers int64
5959
DiskSizeGb int64
6060
DiskType string
61+
DiskProvisionedIOPS int64
62+
DiskProvisionedThroughputMibps int64
6163
MachineType string
6264
Labels map[string]string
6365
ServiceAccountEmail string
@@ -191,6 +193,8 @@ func Translate(ctx context.Context, p *pipepb.Pipeline, opts *JobOptions, worker
191193
},
192194
DiskSizeGb: opts.DiskSizeGb,
193195
DiskType: opts.DiskType,
196+
DiskProvisionedIops: opts.DiskProvisionedIOPS,
197+
DiskProvisionedThroughputMibps: opts.DiskProvisionedThroughputMibps,
194198
IpConfiguration: ipConfiguration,
195199
Kind: "harness",
196200
Packages: packages,

0 commit comments

Comments
 (0)