Google Cloud Dataflow SDK for Java, version 1.9.1
Class PubsubIO.Write.Bound.PubsubWriter
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.DoFn<T,Void>
-
- com.google.cloud.dataflow.sdk.io.PubsubIO.Write.Bound.PubsubWriter
-
- All Implemented Interfaces:
- HasDisplayData, Serializable
- Enclosing class:
- PubsubIO.Write.Bound<T>
public class PubsubIO.Write.Bound.PubsubWriter extends DoFn<T,Void>
Writer to Pubsub which batches messages from bounded collections.NOTE: This is not the implementation used when running on the Google Cloud Dataflow service in streaming mode.
Public so can be suppressed by runners.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.transforms.DoFn
DoFn.Context, DoFn.ProcessContext, DoFn.RequiresWindowAccess
-
-
Constructor Summary
Constructors Constructor and Description PubsubWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
finishBundle(DoFn.Context c)
Finishes processing this batch of elements.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.void
processElement(DoFn.ProcessContext c)
Processes one input element.void
startBundle(DoFn.Context c)
Prepares thisDoFn
instance for processing a batch of elements.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.DoFn
createAggregator, createAggregator, getAllowedTimestampSkew, getInputTypeDescriptor, getOutputTypeDescriptor
-
-
-
-
Method Detail
-
startBundle
public void startBundle(DoFn.Context c) throws IOException
Description copied from class:DoFn
Prepares thisDoFn
instance for processing a batch of elements.By default, does nothing.
- Overrides:
startBundle
in classDoFn<T,Void>
- Throws:
IOException
-
processElement
public void processElement(DoFn.ProcessContext c) throws IOException
Description copied from class:DoFn
Processes one input element.The current element of the input
PCollection
is returned byc.element()
. It should be considered immutable. The Dataflow runtime will not mutate the element, so it is safe to cache, etc. The element should not be mutated by any of theDoFn
methods, because it may be cached elsewhere, retained by the Dataflow runtime, or used in other unspecified ways.A value is added to the main output
PCollection
byDoFn.Context.output(OutputT)
. Once passed tooutput
the element should be considered immutable and not be modified in any way. It may be cached elsewhere, retained by the Dataflow runtime, or used in other unspecified ways.- Specified by:
processElement
in classDoFn<T,Void>
- Throws:
IOException
- See Also:
DoFn.ProcessContext
-
finishBundle
public void finishBundle(DoFn.Context c) throws IOException
Description copied from class:DoFn
Finishes processing this batch of elements.By default, does nothing.
- Overrides:
finishBundle
in classDoFn<T,Void>
- Throws:
IOException
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Description copied from class:DoFn
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 classDoFn<T,Void>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
-