public class BinaryWriter extends AbstractWriter
The writer must be provided the name of the file to be written including the original extension if applicable and the field that contains the raw binary data. If writing multiple files a folder must be provided and the multiple property must be enabled. Additionally the filename field must be specified when writing multiple files.
input, options
Constructor and Description |
---|
BinaryWriter()
Writes an empty target with default settings.
|
BinaryWriter(String targetFilePath,
WriteMode mode)
Writes the binary data to the specified path in the given mode
|
Modifier and Type | Method and Description |
---|---|
protected DataFormat |
computeFormat(CompositionContext ctx)
Determines the data format for the target.
|
String |
getBinaryField()
Gets the name of the field containing the raw binary.
|
String |
getFilenameField()
Gets the name of the field containing the output filenames to use when
extracting the data.
|
boolean |
getMultiple()
Get whether the data is written as a single file or multiple files.
|
void |
setBinaryField(String binaryField)
Sets the name of the field containing the raw binary.
|
void |
setFilenameField(String filenameField)
Sets the name of the field containing the output filenames to use when
extracting the data.
|
void |
setMultiple(boolean multiple)
Sets whether the data is written as a single file or multiple files.
|
compose, getFormatOptions, getInput, getMode, getSaveMetadata, getTarget, getWriteBuffer, getWriteOnClient, getWriteSingleSink, isIgnoreSortOrder, setFormatOptions, setIgnoreSortOrder, setMode, setSaveMetadata, setTarget, setTarget, setTarget, setWriteBuffer, setWriteOnClient, setWriteSingleSink
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public BinaryWriter()
AbstractWriter.setTarget(ByteSink)
public BinaryWriter(String targetFilePath, WriteMode mode)
If writing multiple files, this is interpreted as a directory in which each partition will write a fragment of the entire input stream. Otherwise, it is interpreted as the file to write.
targetFilePath
- the target to writemode
- how to handle existing filespublic String getFilenameField()
public void setFilenameField(String filenameField)
filenameField
- public boolean getMultiple()
public void setMultiple(boolean multiple)
multiple
- public String getBinaryField()
public void setBinaryField(String binaryField)
binaryField
- protected DataFormat computeFormat(CompositionContext ctx)
AbstractWriter
WriteSink
operator. If an
implementation supports schema discovery, it must be
performed in this method.computeFormat
in class AbstractWriter
ctx
- the composition context for the current invocation
of AbstractWriter.compose(CompositionContext)
Copyright © 2020 Actian Corporation. All rights reserved.