Package com.pervasive.datarush.ports

Provides classes and interfaces related to receiving and sending data in a dataflow graph.

Ports represent an access point into which or from which data flows. Along with tokens and operators, ports are one of the core abstractions within the DataRush framework. Ports are strongly typed, based upon the underlying tokens of the associated flow. Many common token types are supported, including Java primitive types and composite types. Ports can be divided into two groups based on function:

  • Output ports which represent the origin of a data flow and provide the ability to append tokens to the flow.

    By their nature, output ports represents a single flow of data, although there may be many consumers of the flow.

  • Input ports which represent a position within data flow and provide the ability to read tokens from a flow.

    A flow of data may have many input ports attached to it, each possibly being at a different position. Input ports provide sequential access to the flow data, operating as an forward-only iterator.

Typically, ports are used only within the implementation of operators, but dataflow graphs may choose to externalize the flow of data, permitting user code outside of the graph to read data from and write data to it via ports. Ports exposed in this way are referred to as external ports.

Ports are divided into two types: logical and physical. Logical ports are used to connects operators to one another. They represent the interfaces of an operator. Physical port are runtime artifacts used to access the data flowing between operators.

While ports provide a safe communication channel between operators, they are not thread-safe; ports cannot be shared between multiple threads. Failure to observe this restriction may result in data corruption or deadlocks in the dataflow.