public static class XmlSink.Bound<T> extends FileBasedSink<T>
FileBasedSink
that writes objects as XML elements.FileBasedSink.FileBasedWriteOperation<T>, FileBasedSink.FileBasedWriter<T>, FileBasedSink.FileResult
Sink.WriteOperation<T,WriteT>, Sink.Writer<T,WriteT>
baseOutputFilename, extension, fileNamingTemplate
Modifier and Type | Method and Description |
---|---|
XmlSink.XmlWriteOperation<T> |
createWriteOperation(PipelineOptions options)
Creates an
XmlSink.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.
|
getBaseOutputFilename
public <T> XmlSink.Bound<T> ofRecordClass(Class<T> classToBind)
The specified class must be able to be used to create a JAXB context.
public XmlSink.Bound<T> toFilenamePrefix(String baseOutputFilename)
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.
public XmlSink.Bound<T> withRootElement(String rootElementName)
public void validate(PipelineOptions options)
validate
in class FileBasedSink<T>
public XmlSink.XmlWriteOperation<T> createWriteOperation(PipelineOptions options)
XmlSink.XmlWriteOperation
.createWriteOperation
in class FileBasedSink<T>
public void populateDisplayData(DisplayData.Builder builder)
Sink
populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData)
. Implementations may call
super.populateDisplayData(builder)
in order to register display data in the current
namespace, but should otherwise use subcomponent.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.
populateDisplayData
in interface HasDisplayData
populateDisplayData
in class FileBasedSink<T>
builder
- The builder to populate with display data.HasDisplayData