-
- 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 outputScalarOutputFieldfields, 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 voiddetach()Immediately terminates the data flow generated by the output port.voidflush()Forces all previously pushed tokens to be made available to consumers of the output's flow.ScalarOutputFieldgetField(int index)Gets the output field at the given position.ScalarOutputFieldgetField(String fieldName)Gets the output field with the given name.ScalarOutputField[]getFields()Gets all output fields of the record port.OutputStatisticsgetStats()Retrieves the run-time statistics gathered for this input.RecordTokenTypegetType()Gets the type of tokens in the underlying flow.voidpush()Appends a record onto the output's flow, using the current values of all fields to construct the record token.voidpush(TokenValued value)Appends the given token value onto the output's flow.voidpush(TokenValued value, long n)Appends the given token value onto the output's flow multiple times.voidpushEndOfData()Signals completion of the data flow generated by the output port.voidpushNull()Appends a null valued token onto the output's flow.voidpushNull(long n)Appends multiple null valued tokens onto the output's flow.intsize()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:PhysicalPortGets the type of tokens in the underlying flow.- Specified by:
getTypein interfacePhysicalPort- Specified by:
getTypein interfaceRecordSettable- Specified by:
getTypein interfaceRecordTyped- Specified by:
getTypein interfaceTokenTyped- Returns:
- the token type for this port.
-
size
int size()
Gets the number of of record fields contained within the port.- Specified by:
sizein interfaceRecordSettable- Returns:
- the number of fields
-
getFields
ScalarOutputField[] getFields()
Gets all output fields of the record port.- Specified by:
getFieldsin interfaceRecordSettable- Returns:
- the output fields of the port
-
getField
ScalarOutputField getField(String fieldName)
Gets the output field with the given name.- Specified by:
getFieldin 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:
getFieldin 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:
pushin 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:
detachin 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 anullJava 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:
getStatsin interfacePhysicalPort- Returns:
PortStatsgathered during execution ornullif the configuration did not specify collecting statistics
-
-