T
- Type of the data item produced by the output portpublic interface Connector<T>
Connector
represents an output port of a Vertex
.
A Connector
supports two methods to add processing for tuples
submitted to the port:
connect(Vertex, int)
: Connect this to an input port of another
Vertex
. Any number of connections can be made. Any tuple submitted by
the output port will appear on all connections made through this method. For
any tuple t
ordering of appearance across the connected input ports
is not guaranteed.peek(Peek)
: Insert a peek after the output port and before any
connections made by connect(Vertex, int)
. Multiple peeks can be
inserted. A tuple t
submitted by the output port will be seen by all
peek oplets. The ordering of the peek is guaranteed such that the peeks
are processed in the order they were added to this Connector
with the
t
being seen first by the first peek added.
P1,P2,P3
added in that order and connections
C1,C2
added, the graph will be logically:
-->C1
port-->P1-->P2-->P3--|
-->C2
A tuple t
submitted by the port will be peeked at by P1
, then
P2
then P3
. After P3
peeked at the tuple, C1
and C2
will process the tuple in an arbitrary order.Modifier and Type | Method and Description |
---|---|
void |
connect(Vertex<?,T,?> target,
int inputPort)
Connect this
Connector to the specified target's input. |
java.util.Set<java.lang.String> |
getTags()
Returns the set of tags associated with this connector.
|
Graph |
graph()
Gets the
Graph for this Connector . |
boolean |
isConnected()
Is my output port connected to any input port.
|
<N extends Peek<T>> |
peek(N oplet)
Inserts a
Peek oplet between an output port and its
connections. |
void |
tag(java.lang.String... values)
Adds the specified tags to the connector.
|
Graph graph()
Graph
for this Connector
.Graph
for this Connector
.void connect(Vertex<?,T,?> target, int inputPort)
Connector
to the specified target's input. This
method may be called multiple times to fan out to multiple input ports.
Each tuple submitted to this output port will be processed by all
connections.target
- the Vertex
to connect toinputPort
- the index of the target's input port to connect to.boolean isConnected()
<N extends Peek<T>> Connector<T> peek(N oplet)
Peek
oplet between an output port and its
connections. This method may be called multiple times to insert multiple
peeks. Each tuple submitted to this output port will be seen by all peeks
in order of their insertion, starting with the first peek inserted.oplet
- Oplet to insert.output
void tag(java.lang.String... values)
values
- Tag values.java.util.Set<java.lang.String> getTags()
Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902