Class BigtableIO.Write
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>
-
- org.apache.beam.sdk.io.gcp.bigtable.BigtableIO.Write
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- BigtableIO
public abstract static class BigtableIO.Write extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>APTransformthat writes to Google Cloud Bigtable. See the class-level Javadoc onBigtableIOfor more information.- See Also:
BigtableIO, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Write()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.beam.sdk.values.PDoneexpand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>> input)@Nullable com.google.cloud.bigtable.config.BigtableOptionsgetBigtableOptions()Deprecated.write options are configured directly on BigtableIO.write().voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)java.lang.StringtoString()voidvalidate(org.apache.beam.sdk.options.PipelineOptions options)BigtableIO.WritewithAppProfileId(java.lang.String appProfileId)Returns a newBigtableIO.Writethat will write using the specified app profile id.BigtableIO.WritewithAppProfileId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> appProfileId)Returns a newBigtableIO.Writethat will write using the specified app profile id.BigtableIO.WritewithAttemptTimeout(org.joda.time.Duration timeout)Returns a newBigtableIO.Writewith the attempt timeout.BigtableIO.WritewithBigtableOptions(com.google.cloud.bigtable.config.BigtableOptions options)Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.BigtableIO.WritewithBigtableOptions(com.google.cloud.bigtable.config.BigtableOptions.Builder optionsBuilder)Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.BigtableIO.WritewithBigtableOptionsConfigurator(org.apache.beam.sdk.transforms.SerializableFunction<com.google.cloud.bigtable.config.BigtableOptions.Builder,com.google.cloud.bigtable.config.BigtableOptions.Builder> configurator)Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.BigtableIO.WritewithEmulator(java.lang.String emulatorHost)Returns a newBigtableIO.Writethat will use an official Bigtable emulator.BigtableIO.WritewithErrorHandler(org.apache.beam.sdk.transforms.errorhandling.ErrorHandler<org.apache.beam.sdk.transforms.errorhandling.BadRecord,?> badRecordErrorHandler)BigtableIO.WritewithFlowControl(boolean enableFlowControl)Returns a newBigtableIO.Writewith flow control enabled if enableFlowControl is true.BigtableIO.WritewithInstanceId(java.lang.String instanceId)Returns a newBigtableIO.Writethat will write into the Cloud Bigtable instance indicated by given parameter, requireswithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the project.BigtableIO.WritewithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> instanceId)Returns a newBigtableIO.Writethat will write into the Cloud Bigtable instance indicated by given parameter, requireswithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the project.BigtableIO.WritewithMaxBytesPerBatch(long size)Returns a newBigtableIO.Writewith the max bytes a batch can have.BigtableIO.WritewithMaxElementsPerBatch(long size)Returns a newBigtableIO.Writewith the max elements a batch can have.BigtableIO.WritewithMaxOutstandingBytes(long bytes)Returns a newBigtableIO.Writewith the max number of outstanding bytes allowed before enforcing flow control.BigtableIO.WritewithMaxOutstandingElements(long count)Returns a newBigtableIO.Writewith the max number of outstanding elements allowed before enforcing flow control.BigtableIO.WritewithOperationTimeout(org.joda.time.Duration timeout)Returns a newBigtableIO.Writewith the operation timeout.BigtableIO.WritewithoutValidation()Disables validation that the table being written to exists.BigtableIO.WritewithProjectId(java.lang.String projectId)Returns a newBigtableIO.Writethat will write into the Cloud Bigtable project indicated by given parameter, requireswithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the instance.BigtableIO.WritewithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> projectId)Returns a newBigtableIO.Writethat will write into the Cloud Bigtable project indicated by given parameter, requireswithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the instance.BigtableIO.WritewithTableId(java.lang.String tableId)Returns a newBigtableIO.Writethat will write to the specified table.BigtableIO.WritewithTableId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> tableId)Returns a newBigtableIO.Writethat will write to the specified table.BigtableIO.WritewithThrottlingReportTargetMs(int throttlingReportTargetMs)Deprecated.This method has been deprecated in Beam 2.60.0.BigtableIO.WritewithThrottlingTargetMs(int throttlingTargetMs)Deprecated.This method has been deprecated in Beam 2.60.0.BigtableIO.WriteWithResultswithWriteResults()Returns aBigtableIO.WriteWithResultsthat will emit aBigtableWriteResultfor each batch of rows written.
-
-
-
Method Detail
-
getBigtableOptions
@Deprecated public @Nullable com.google.cloud.bigtable.config.BigtableOptions getBigtableOptions()
Deprecated.write options are configured directly on BigtableIO.write(). UsepopulateDisplayData(DisplayData.Builder)to view the current configurations.Returns the Google Cloud Bigtable instance being written to, and other parameters.
-
withProjectId
public BigtableIO.Write withProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> projectId)
Returns a newBigtableIO.Writethat will write into the Cloud Bigtable project indicated by given parameter, requireswithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the instance.Does not modify this object.
-
withProjectId
public BigtableIO.Write withProjectId(java.lang.String projectId)
Returns a newBigtableIO.Writethat will write into the Cloud Bigtable project indicated by given parameter, requireswithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the instance.Does not modify this object.
-
withInstanceId
public BigtableIO.Write withInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> instanceId)
Returns a newBigtableIO.Writethat will write into the Cloud Bigtable instance indicated by given parameter, requireswithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the project.Does not modify this object.
-
withInstanceId
public BigtableIO.Write withInstanceId(java.lang.String instanceId)
Returns a newBigtableIO.Writethat will write into the Cloud Bigtable instance indicated by given parameter, requireswithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)to be called to determine the project.Does not modify this object.
-
withTableId
public BigtableIO.Write withTableId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> tableId)
Returns a newBigtableIO.Writethat will write to the specified table.Does not modify this object.
-
withTableId
public BigtableIO.Write withTableId(java.lang.String tableId)
Returns a newBigtableIO.Writethat will write to the specified table.Does not modify this object.
-
withAppProfileId
public BigtableIO.Write withAppProfileId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> appProfileId)
Returns a newBigtableIO.Writethat will write using the specified app profile id.Remember that in order to use single-row transactions, this must use a single-cluster routing policy.
Does not modify this object.
-
withAppProfileId
public BigtableIO.Write withAppProfileId(java.lang.String appProfileId)
Returns a newBigtableIO.Writethat will write using the specified app profile id.Remember that in order to use single-row transactions, this must use a single-cluster routing policy.
Does not modify this object.
-
withBigtableOptions
@Deprecated public BigtableIO.Write withBigtableOptions(com.google.cloud.bigtable.config.BigtableOptions options)
Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.WARNING: Should be used only to specify additional parameters for connection to the Cloud Bigtable, instanceId and projectId should be provided overwithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)andwithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)respectively.Returns a new
BigtableIO.Writethat will write to the Cloud Bigtable instance indicated by the given options, and using any other specified customizations.Does not modify this object.
-
withBigtableOptions
@Deprecated public BigtableIO.Write withBigtableOptions(com.google.cloud.bigtable.config.BigtableOptions.Builder optionsBuilder)
Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.WARNING: Should be used only to specify additional parameters for connection to the Cloud Bigtable, instanceId and projectId should be provided overwithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)andwithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)respectively.Returns a new
BigtableIO.Writethat will write to the Cloud Bigtable instance indicated by the given options, and using any other specified customizations.Clones the given
BigtableOptionsbuilder so that any further changes will have no effect on the returnedBigtableIO.Write.Does not modify this object.
-
withBigtableOptionsConfigurator
@Deprecated public BigtableIO.Write withBigtableOptionsConfigurator(org.apache.beam.sdk.transforms.SerializableFunction<com.google.cloud.bigtable.config.BigtableOptions.Builder,com.google.cloud.bigtable.config.BigtableOptions.Builder> configurator)
Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.Returns a newBigtableIO.Writethat will read from the Cloud Bigtable instance with customized options provided by given configurator.WARNING: instanceId and projectId should not be provided here and should be provided over
withProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>)andwithInstanceId(org.apache.beam.sdk.options.ValueProvider<java.lang.String>).Does not modify this object.
-
withoutValidation
public BigtableIO.Write withoutValidation()
Disables validation that the table being written to exists.
-
withEmulator
public BigtableIO.Write withEmulator(java.lang.String emulatorHost)
Returns a newBigtableIO.Writethat will use an official Bigtable emulator.This is used for testing.
-
withAttemptTimeout
public BigtableIO.Write withAttemptTimeout(org.joda.time.Duration timeout)
Returns a newBigtableIO.Writewith the attempt timeout. Attempt timeout controls the timeout for each remote call.Does not modify this object.
-
withOperationTimeout
public BigtableIO.Write withOperationTimeout(org.joda.time.Duration timeout)
Returns a newBigtableIO.Writewith the operation timeout. Operation timeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely.Does not modify this object.
-
withMaxElementsPerBatch
public BigtableIO.Write withMaxElementsPerBatch(long size)
Returns a newBigtableIO.Writewith the max elements a batch can have. After this many elements are accumulated, they will be wrapped up in a batch and sent to Bigtable.Does not modify this object.
-
withMaxBytesPerBatch
public BigtableIO.Write withMaxBytesPerBatch(long size)
Returns a newBigtableIO.Writewith the max bytes a batch can have. After this many bytes are accumulated, the elements will be wrapped up in a batch and sent to Bigtable.Does not modify this object.
-
withMaxOutstandingElements
public BigtableIO.Write withMaxOutstandingElements(long count)
Returns a newBigtableIO.Writewith the max number of outstanding elements allowed before enforcing flow control.Does not modify this object.
-
withMaxOutstandingBytes
public BigtableIO.Write withMaxOutstandingBytes(long bytes)
Returns a newBigtableIO.Writewith the max number of outstanding bytes allowed before enforcing flow control.Does not modify this object.
-
withFlowControl
public BigtableIO.Write withFlowControl(boolean enableFlowControl)
Returns a newBigtableIO.Writewith flow control enabled if enableFlowControl is true.When enabled, traffic to Bigtable is automatically rate-limited to prevent overloading Bigtable clusters while keeping enough load to trigger Bigtable Autoscaling (if enabled) to provision more nodes as needed. It is different from the flow control set by
withMaxOutstandingElements(long)andwithMaxOutstandingBytes(long), which is always enabled on batch writes and limits the number of outstanding requests to the Bigtable server.Does not modify this object.
-
withThrottlingTargetMs
@Deprecated public BigtableIO.Write withThrottlingTargetMs(int throttlingTargetMs)
Deprecated.This method has been deprecated in Beam 2.60.0. It does not have an effect.
-
withThrottlingReportTargetMs
@Deprecated public BigtableIO.Write withThrottlingReportTargetMs(int throttlingReportTargetMs)
Deprecated.This method has been deprecated in Beam 2.60.0. It does not have an effect.
-
withErrorHandler
public BigtableIO.Write withErrorHandler(org.apache.beam.sdk.transforms.errorhandling.ErrorHandler<org.apache.beam.sdk.transforms.errorhandling.BadRecord,?> badRecordErrorHandler)
-
withWriteResults
public BigtableIO.WriteWithResults withWriteResults()
Returns aBigtableIO.WriteWithResultsthat will emit aBigtableWriteResultfor each batch of rows written.
-
expand
public org.apache.beam.sdk.values.PDone expand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>
-
validate
public void validate(org.apache.beam.sdk.options.PipelineOptions options)
- Overrides:
validatein classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<com.google.protobuf.ByteString,java.lang.Iterable<com.google.bigtable.v2.Mutation>>>,org.apache.beam.sdk.values.PDone>
-
-