Interface RecordOutput

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 output ScalarOutputField fields, one for each field of the record, indexed both by name and position, as determined by the schema of the output's RecordTokenType.

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 the RecordOutput. 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 the push().

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Immediately terminates the data flow generated by the output port.
    void
    Forces all previously pushed tokens to be made available to consumers of the output's flow.
    getField(int index)
    Gets the output field at the given position.
    getField(String fieldName)
    Gets the output field with the given name.
    Gets all output fields of the record port.
    Retrieves the run-time statistics gathered for this input.
    Gets the type of tokens in the underlying flow.
    void
    Appends a record onto the output's flow, using the current values of all fields to construct the record token.
    void
    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
    Signals completion of the data flow generated by the output port.
    void
    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
    Gets the number of of record fields contained within the port.

    Methods inherited from interface com.pervasive.datarush.namespace.Named

    getName

    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 Details

    • getType

      RecordTokenType getType()
      Description copied from interface: PhysicalPort
      Gets the type of tokens in the underlying flow.
      Specified by:
      getType in interface PhysicalPort
      Specified by:
      getType in interface RecordSettable
      Specified by:
      getType in interface RecordTyped
      Specified by:
      getType in interface TokenTyped
      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 interface RecordSettable
      Returns:
      the number of fields
    • getFields

      ScalarOutputField[] getFields()
      Gets all output fields of the record port.
      Specified by:
      getFields in interface RecordSettable
      Returns:
      the output fields of the port
    • getField

      ScalarOutputField getField(String fieldName)
      Gets the output field with the given name.
      Specified by:
      getField in interface RecordSettable
      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 interface RecordSettable
      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 last push(), the field will be null valued.
      Specified by:
      push in interface GenericPushable
    • 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. Unlike pushEndOfData(), there are no guarantees on delivery of previously published tokens.
      Specified by:
      detach in interface PhysicalPort
    • 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 push
      n - 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 a null 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:
    • 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 interface PhysicalPort
      Returns:
      PortStats gathered during execution or null if the configuration did not specify collecting statistics