Class BigtableIO.Write
- All Implemented Interfaces:
Serializable,HasDisplayData
- Enclosing class:
BigtableIO
PTransform that writes to Google Cloud Bigtable. See the class-level Javadoc on
BigtableIO for more information.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpand(PCollection<KV<ByteString, Iterable<com.google.bigtable.v2.Mutation>>> input) Override this method to specify how thisPTransformshould be expanded on the givenInputT.Deprecated.write options are configured directly on BigtableIO.write().voidpopulateDisplayData(DisplayData.Builder builder) Register display data for the given transform or component.final StringtoString()voidvalidate(PipelineOptions options) Called before running the Pipeline to verify this transform is fully and correctly specified.withAppProfileId(String appProfileId) Returns a newBigtableIO.Writethat will write using the specified app profile id.withAppProfileId(ValueProvider<String> appProfileId) Returns a newBigtableIO.Writethat will write using the specified app profile id.withAttemptTimeout(Duration timeout) Returns a newBigtableIO.Writewith the attempt timeout.withBigtableOptions(BigtableOptions options) Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.withBigtableOptions(BigtableOptions.Builder optionsBuilder) Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.withBigtableOptionsConfigurator(SerializableFunction<BigtableOptions.Builder, BigtableOptions.Builder> configurator) Deprecated.please configure the write options directly: BigtableIO.write().withProjectId(projectId).withInstanceId(instanceId).withTableId(tableId) and set credentials inPipelineOptions.withEmulator(String emulatorHost) Returns a newBigtableIO.Writethat will use an official Bigtable emulator.withErrorHandler(ErrorHandler<BadRecord, ?> badRecordErrorHandler) withFlowControl(boolean enableFlowControl) Returns a newBigtableIO.Writewith flow control enabled if enableFlowControl is true.withInstanceId(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.withInstanceId(ValueProvider<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.withMaxBytesPerBatch(long size) Returns a newBigtableIO.Writewith the max bytes a batch can have.withMaxElementsPerBatch(long size) Returns a newBigtableIO.Writewith the max elements a batch can have.withMaxOutstandingBytes(long bytes) Returns a newBigtableIO.Writewith the max number of outstanding bytes allowed before enforcing flow control.withMaxOutstandingElements(long count) Returns a newBigtableIO.Writewith the max number of outstanding elements allowed before enforcing flow control.withOperationTimeout(Duration timeout) Returns a newBigtableIO.Writewith the operation timeout.Disables validation that the table being written to exists.withProjectId(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.withProjectId(ValueProvider<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.withTableId(String tableId) Returns a newBigtableIO.Writethat will write to the specified table.withTableId(ValueProvider<String> tableId) Returns a newBigtableIO.Writethat will write to the specified table.withThrottlingReportTargetMs(int throttlingReportTargetMs) Deprecated.This method has been deprecated in Beam 2.60.0.withThrottlingTargetMs(int throttlingTargetMs) Deprecated.This method has been deprecated in Beam 2.60.0.Returns aBigtableIO.WriteWithResultsthat will emit aBigtableWriteResultfor each batch of rows written.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, validate
-
Constructor Details
-
Write
public Write()
-
-
Method Details
-
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
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
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
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
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
Returns a newBigtableIO.Writethat will write to the specified table.Does not modify this object.
-
withTableId
Returns a newBigtableIO.Writethat will write to the specified table.Does not modify this object.
-
withAppProfileId
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
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.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.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(SerializableFunction<BigtableOptions.Builder, 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
Disables validation that the table being written to exists. -
withEmulator
Returns a newBigtableIO.Writethat will use an official Bigtable emulator.This is used for testing.
-
withAttemptTimeout
Returns a newBigtableIO.Writewith the attempt timeout. Attempt timeout controls the timeout for each remote call.Does not modify this object.
-
withOperationTimeout
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
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
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
Returns a newBigtableIO.Writewith the max number of outstanding elements allowed before enforcing flow control.Does not modify this object.
-
withMaxOutstandingBytes
Returns a newBigtableIO.Writewith the max number of outstanding bytes allowed before enforcing flow control.Does not modify this object.
-
withFlowControl
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.This method has been deprecated in Beam 2.60.0. It does not have an effect. -
withThrottlingReportTargetMs
Deprecated.This method has been deprecated in Beam 2.60.0. It does not have an effect. -
withErrorHandler
-
withWriteResults
Returns aBigtableIO.WriteWithResultsthat will emit aBigtableWriteResultfor each batch of rows written. -
expand
Description copied from class:PTransformOverride this method to specify how thisPTransformshould be expanded on the givenInputT.NOTE: This method should not be called directly. Instead apply the
PTransformshould be applied to theInputTusing theapplymethod.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expandin classPTransform<PCollection<KV<ByteString,Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-
validate
Description copied from class:PTransformCalled before running the Pipeline to verify this transform is fully and correctly specified.By default, does nothing.
- Overrides:
validatein classPTransform<PCollection<KV<ByteString,Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-
populateDisplayData
Description copied from class:PTransformRegister display data for the given transform or component.populateDisplayData(DisplayData.Builder)is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData). Implementations may callsuper.populateDisplayData(builder)in order to register display data in the current namespace, but should otherwise usesubcomponent.populateDisplayData(builder)to use the namespace of the subcomponent.By default, does not register any display data. Implementors may override this method to provide their own display data.
- Specified by:
populateDisplayDatain interfaceHasDisplayData- Overrides:
populateDisplayDatain classPTransform<PCollection<KV<ByteString,Iterable<com.google.bigtable.v2.Mutation>>>, PDone> - Parameters:
builder- The builder to populate with display data.- See Also:
-
toString
- Overrides:
toStringin classPTransform<PCollection<KV<ByteString,Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-