Google Cloud Dataflow SDK for Java, version 1.9.1
Class XmlSink.Bound<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.io.Sink<T>
-
- com.google.cloud.dataflow.sdk.io.FileBasedSink<T>
-
- com.google.cloud.dataflow.sdk.io.XmlSink.Bound<T>
-
- All Implemented Interfaces:
- HasDisplayData, Serializable
- Enclosing class:
- XmlSink
public static class XmlSink.Bound<T> extends FileBasedSink<T>
AFileBasedSink
that writes objects as XML elements.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink
FileBasedSink.FileBasedWriteOperation<T>, FileBasedSink.FileBasedWriter<T>, FileBasedSink.FileResult
-
Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.io.Sink
Sink.WriteOperation<T,WriteT>, Sink.Writer<T,WriteT>
-
-
Field Summary
-
Fields inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink
baseOutputFilename, extension, fileNamingTemplate
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description XmlSink.XmlWriteOperation<T>
createWriteOperation(PipelineOptions options)
Creates anXmlSink.XmlWriteOperation
.<T> XmlSink.Bound<T>
ofRecordClass(Class<T> classToBind)
Returns an XmlSink that writes objects of the class specified as XML elements.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.XmlSink.Bound<T>
toFilenamePrefix(String baseOutputFilename)
Returns an XmlSink that writes to files with the given prefix.void
validate(PipelineOptions options)
Validates that the root element, class to bind to a JAXB context, and filenamePrefix have been set and that the class can be bound in a JAXB context.XmlSink.Bound<T>
withRootElement(String rootElementName)
Returns an XmlSink that writes XML files with an enclosing root element of the supplied name.-
Methods inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink
getBaseOutputFilename, getBaseOutputFilenameProvider
-
-
-
-
Method Detail
-
ofRecordClass
public <T> XmlSink.Bound<T> ofRecordClass(Class<T> classToBind)
Returns an XmlSink that writes objects of the class specified as XML elements.The specified class must be able to be used to create a JAXB context.
-
toFilenamePrefix
public XmlSink.Bound<T> toFilenamePrefix(String baseOutputFilename)
Returns an XmlSink that writes to files with the given prefix.Output files will have the name {filenamePrefix}-0000i-of-0000n.xml where n is the number of output bundles that the Dataflow service divides the output into.
-
withRootElement
public XmlSink.Bound<T> withRootElement(String rootElementName)
Returns an XmlSink that writes XML files with an enclosing root element of the supplied name.
-
validate
public void validate(PipelineOptions options)
Validates that the root element, class to bind to a JAXB context, and filenamePrefix have been set and that the class can be bound in a JAXB context.- Overrides:
validate
in classFileBasedSink<T>
-
createWriteOperation
public XmlSink.XmlWriteOperation<T> createWriteOperation(PipelineOptions options)
Creates anXmlSink.XmlWriteOperation
.- Specified by:
createWriteOperation
in classFileBasedSink<T>
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Description copied from class:Sink
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 classFileBasedSink<T>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
-