Package google.registry.beam.common
Class RegistryJpaIO.Write<T>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PCollection<Void>>
google.registry.beam.common.RegistryJpaIO.Write<T>
- Type Parameters:
T
- type of the entities to be written
- All Implemented Interfaces:
Serializable
,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
RegistryJpaIO
public abstract static class RegistryJpaIO.Write<T>
extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PCollection<Void>>
A
transform
that writes a PCollection of entities to the SQL database using
the JpaTransactionManager
.
Unlike typical BEAM RegistryJpaIO.Write
transforms, the output type of this transform is
PCollection<Void>
instead of PDone
. This deviation allows
the sequencing of multiple PCollections
: we have use cases where one collection of data
must be completely written before another can start (due to foreign key constraints in the
latter).
- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
Number of elements to be written in one call.org.apache.beam.sdk.values.PCollection
<Void> abstract String
name()
withBatchSize
(int batchSize) withJpaConverter
(org.apache.beam.sdk.transforms.SerializableFunction<T, Object> jpaConverter) An optional function that converts the input entities to a form that can be written into the database.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Field Details
-
DEFAULT_NAME
- See Also:
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE- See Also:
-
-
Constructor Details
-
Write
public Write()
-
-
Method Details
-
name
-
batchSize
public abstract int batchSize()Number of elements to be written in one call. -
jpaConverter
-
withName
-
withBatchSize
-
withJpaConverter
public RegistryJpaIO.Write<T> withJpaConverter(org.apache.beam.sdk.transforms.SerializableFunction<T, Object> jpaConverter) An optional function that converts the input entities to a form that can be written into the database. -
expand
-