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 thisPTransform
should be expanded on the givenInputT
.Deprecated.write options are configured directly on BigtableIO.write().void
populateDisplayData
(DisplayData.Builder builder) Register display data for the given transform or component.final String
toString()
void
validate
(PipelineOptions options) Called before running the Pipeline to verify this transform is fully and correctly specified.withAppProfileId
(String appProfileId) Returns a newBigtableIO.Write
that will write using the specified app profile id.withAppProfileId
(ValueProvider<String> appProfileId) Returns a newBigtableIO.Write
that will write using the specified app profile id.withAttemptTimeout
(Duration timeout) Returns a newBigtableIO.Write
with 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.Write
that will use an official Bigtable emulator.withErrorHandler
(ErrorHandler<BadRecord, ?> badRecordErrorHandler) withFlowControl
(boolean enableFlowControl) Returns a newBigtableIO.Write
with flow control enabled if enableFlowControl is true.withInstanceId
(String instanceId) Returns a newBigtableIO.Write
that 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.Write
that 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.Write
with the max bytes a batch can have.withMaxElementsPerBatch
(long size) Returns a newBigtableIO.Write
with the max elements a batch can have.withMaxOutstandingBytes
(long bytes) Returns a newBigtableIO.Write
with the max number of outstanding bytes allowed before enforcing flow control.withMaxOutstandingElements
(long count) Returns a newBigtableIO.Write
with the max number of outstanding elements allowed before enforcing flow control.withOperationTimeout
(Duration timeout) Returns a newBigtableIO.Write
with the operation timeout.Disables validation that the table being written to exists.withProjectId
(String projectId) Returns a newBigtableIO.Write
that 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.Write
that 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.Write
that will write to the specified table.withTableId
(ValueProvider<String> tableId) Returns a newBigtableIO.Write
that 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.WriteWithResults
that will emit aBigtableWriteResult
for 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.Write
that 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.Write
that 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.Write
that 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.Write
that 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.Write
that will write to the specified table.Does not modify this object.
-
withTableId
Returns a newBigtableIO.Write
that will write to the specified table.Does not modify this object.
-
withAppProfileId
Returns a newBigtableIO.Write
that 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.Write
that 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.Write
that 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.Write
that will write to the Cloud Bigtable instance indicated by the given options, and using any other specified customizations.Clones the given
BigtableOptions
builder 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.Write
that 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.Write
that will use an official Bigtable emulator.This is used for testing.
-
withAttemptTimeout
Returns a newBigtableIO.Write
with the attempt timeout. Attempt timeout controls the timeout for each remote call.Does not modify this object.
-
withOperationTimeout
Returns a newBigtableIO.Write
with 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.Write
with 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.Write
with 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.Write
with the max number of outstanding elements allowed before enforcing flow control.Does not modify this object.
-
withMaxOutstandingBytes
Returns a newBigtableIO.Write
with the max number of outstanding bytes allowed before enforcing flow control.Does not modify this object.
-
withFlowControl
Returns a newBigtableIO.Write
with 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.WriteWithResults
that will emit aBigtableWriteResult
for each batch of rows written. -
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.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:
expand
in classPTransform<PCollection<KV<ByteString,
Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-
validate
Description copied from class:PTransform
Called before running the Pipeline to verify this transform is fully and correctly specified.By default, does nothing.
- Overrides:
validate
in classPTransform<PCollection<KV<ByteString,
Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-
populateDisplayData
Description copied from class:PTransform
Register 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:
populateDisplayData
in interfaceHasDisplayData
- Overrides:
populateDisplayData
in classPTransform<PCollection<KV<ByteString,
Iterable<com.google.bigtable.v2.Mutation>>>, PDone> - Parameters:
builder
- The builder to populate with display data.- See Also:
-
toString
- Overrides:
toString
in classPTransform<PCollection<KV<ByteString,
Iterable<com.google.bigtable.v2.Mutation>>>, PDone>
-