public static interface DataFormat.DataFormatter
DataFormatter
bridges the gap between
records within and outside of a dataflow graph
An implementation represents such a mapping for
some concrete external format.DataFormat.DataParser
Modifier and Type | Method and Description |
---|---|
void |
bindInput(SteppableRecordValued source)
Called to provide the source port from
which records to format are read.
|
void |
close()
Called to signal that writing is complete.
|
void |
writeData(ByteSink sink,
WriteMode mode)
Called to write records to the provided
sink in the specified mode.
|
void bindInput(SteppableRecordValued source)
This method is called once, before
writeData(ByteSink, WriteMode)
is called. Any one-time
initialization for the formatter should
be performed within the implementation
of this method.
source
- the input port providing recordsvoid writeData(ByteSink sink, WriteMode mode)
This method is called once.
The implementation is expected to read
records from the input passed to #bindInput(RecordInput)
and write them to the given sink as requested.
The call must not return until end of data has been
signaled on the input. Failure to do so will result in
an error in the executing graph. Streams opened on the sink
are not required to be closed on exit, but it is strongly recommended.
sink
- the data sink to which formatted records
are to be writtenmode
- the access mode for the writevoid close()
#bindInput(RecordInput)
has returned
successfully, it is guaranteed that this method
will be called, even if errors occur.
This method is called once,
after the last call to writeData(ByteSink, WriteMode)
Any allocated resources which need to be released should be
handled within the implementation of this method.
Copyright © 2024 Actian Corporation. All rights reserved.