-
- All Superinterfaces:
GenericPushable
,Named
,PhysicalOutputPort
,PhysicalPort
,RecordSettable
,RecordTyped
,TokenAppendable
,TokenSettable
,TokenTyped
public interface RecordOutput extends PhysicalOutputPort, RecordSettable, GenericPushable, TokenAppendable
An output port generating a flow of record tokens. A record output is a collection of outputScalarOutputField
fields, one for each field of the record, indexed both by name and position, as determined by the schema of the output'sRecordTokenType
.Publishing records to the flow is a two-step process. First, the values of all fields must be set. Fields provide methods appropriate to their token type for setting the value. Finally, the record is published by calling
push()
on theRecordOutput
. The values of the fields will be gathered to construct the record value to push. Any fields which were not set will assume a null value. All fields will become null valued again after thepush()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
detach()
Immediately terminates the data flow generated by the output port.void
flush()
Forces all previously pushed tokens to be made available to consumers of the output's flow.ScalarOutputField
getField(int index)
Gets the output field at the given position.ScalarOutputField
getField(String fieldName)
Gets the output field with the given name.ScalarOutputField[]
getFields()
Gets all output fields of the record port.OutputStatistics
getStats()
Retrieves the run-time statistics gathered for this input.RecordTokenType
getType()
Gets the type of tokens in the underlying flow.void
push()
Appends a record onto the output's flow, using the current values of all fields to construct the record token.void
push(TokenValued value)
Appends the given token value onto the output's flow.void
push(TokenValued value, long n)
Appends the given token value onto the output's flow multiple times.void
pushEndOfData()
Signals completion of the data flow generated by the output port.void
pushNull()
Appends a null valued token onto the output's flow.void
pushNull(long n)
Appends multiple null valued tokens onto the output's flow.int
size()
Gets the number of of record fields contained within the port.-
Methods inherited from interface com.pervasive.datarush.ports.PhysicalOutputPort
addListener
-
Methods inherited from interface com.pervasive.datarush.ports.PhysicalPort
isAttached
-
Methods inherited from interface com.pervasive.datarush.sequences.TokenAppendable
append, append, append, append
-
Methods inherited from interface com.pervasive.datarush.tokens.TokenSettable
set, setNull, setZero
-
-
-
-
Method Detail
-
getType
RecordTokenType getType()
Description copied from interface:PhysicalPort
Gets the type of tokens in the underlying flow.- Specified by:
getType
in interfacePhysicalPort
- Specified by:
getType
in interfaceRecordSettable
- Specified by:
getType
in interfaceRecordTyped
- Specified by:
getType
in interfaceTokenTyped
- Returns:
- the token type for this port.
-
size
int size()
Gets the number of of record fields contained within the port.- Specified by:
size
in interfaceRecordSettable
- Returns:
- the number of fields
-
getFields
ScalarOutputField[] getFields()
Gets all output fields of the record port.- Specified by:
getFields
in interfaceRecordSettable
- Returns:
- the output fields of the port
-
getField
ScalarOutputField getField(String fieldName)
Gets the output field with the given name.- Specified by:
getField
in interfaceRecordSettable
- Parameters:
fieldName
- name of the field- Returns:
- the field with the given name
-
getField
ScalarOutputField getField(int index)
Gets the output field at the given position.- Specified by:
getField
in interfaceRecordSettable
- Parameters:
index
- zero-based index into the field list- Returns:
- the field at the given position
-
push
void push()
Appends a record onto the output's flow, using the current values of all fields to construct the record token. For any field not set since the lastpush()
, the field will be null valued.- Specified by:
push
in interfaceGenericPushable
-
detach
void detach()
Immediately terminates the data flow generated by the output port. The port is detached from its underlying data flow and attempts to publish additional data will generate an error. UnlikepushEndOfData()
, there are no guarantees on delivery of previously published tokens.- Specified by:
detach
in interfacePhysicalPort
-
pushEndOfData
void pushEndOfData()
Signals completion of the data flow generated by the output port. The port is detached from its underlying data flow and attempts to publish additional data will generate an error. Previously published tokens will still be delivered to consumers.
-
push
void push(TokenValued value)
Appends the given token value onto the output's flow. The value must be of a token type compatible with the concrete output port's token type.- Parameters:
value
- the token value to push
-
push
void push(TokenValued value, long n)
Appends the given token value onto the output's flow multiple times. The value must be of a token type compatible with the concrete output port's token type.- Parameters:
value
- the token value to pushn
- the number of copies to push
-
pushNull
void pushNull()
Appends a null valued token onto the output's flow. The null value is similar to a SQL null value and not anull
Java reference.
-
pushNull
void pushNull(long n)
Appends multiple null valued tokens onto the output's flow.- Parameters:
n
- the number of null values to push- See Also:
pushNull()
-
flush
void flush()
Forces all previously pushed tokens to be made available to consumers of the output's flow. Generally, an operator will not need to call this method directly.
-
getStats
OutputStatistics getStats()
Retrieves the run-time statistics gathered for this input.- Specified by:
getStats
in interfacePhysicalPort
- Returns:
PortStats
gathered during execution ornull
if the configuration did not specify collecting statistics
-
-