public interface Placeable<T extends Placeable<T>> extends TopologyElement
DISTRIBUTED
,
STREAMING_ANALYTICS_SERVICE
or DISTRIBUTED_TESTER
context.
Modifier and Type | Method and Description |
---|---|
T |
addResourceTags(java.lang.String... tags)
Add required resource tags for this topology element for distributed submission.
|
T |
colocate(Placeable<?>... elements)
Colocate this element with other topology elements so that
at runtime they all execute within the same processing element
(PE or operating system process).
|
default java.lang.String |
getInvocationName()
Return the invocation name of this element.
|
java.util.Set<java.lang.String> |
getResourceTags()
Get the set of resource tags this element requires.
|
T |
invocationName(java.lang.String name)
Set the invocation name of this placeable.
|
boolean |
isPlaceable()
Can this element have placement directives applied to it.
|
com.ibm.streamsx.topology.builder.BOperatorInvocation |
operator() |
builder, topology
boolean isPlaceable()
true
if placement directives can be assigned, false
if it can not.T colocate(Placeable<?>... elements)
elements
may contain any Placeable
within
the same topology, there is no requirement
that the element is connected (by a stream) directly or indirectly
to this element.
When a set of colocated elements are completely within a single parallel
region then the colocation constraint is limited to that channel. So if elements
A
and B
are colocated then it
is guaranteed that A[0],B[0]
from channel 0 are in a single PE
and A[1],B[1]
from channel 1 are in a single PE,
but typically a different PE to A[0],B[0]
.
When a a set of colocated elements are not completely within a single parallel
region then the colocation constraint applies to the whole topology.
So if A,B
are in a parallel region but C
is outside then
all the replicas of A,B
are colocated with C
and each other.
Colocation is also referred to as fusing, when topology elements are connected by streams then the communication between them is in-process using direct method calls (instead of a network transport such as TCP).
elements
- Elements to colocate with this container.IllegalStateExeception
- Any element including this
returns false
for isPlaceable()
.T addResourceTags(java.lang.String... tags)
colocated
with will execute on a resource (host) that has all the tags returned by
getResourceTags()
.tags
- Tags to be required at runtime.java.util.Set<java.lang.String> getResourceTags()
colocated
with other topology elements then the returned set is the union
of all resource tags added
to each colocated element.default java.lang.String getInvocationName()
isPlaceable()
is true
otherwise null
.invocationName(String)
T invocationName(java.lang.String name)
Names must be unique within a topology, if this name
is already in use then the 'name_N'
will be used
where N
is a number that makes the name unique
within the topology.
For example the invocation for sending alerts as SMS (text) messages could be named as SMSAlerts:
TStream<Alert> alerts = ...
alerts.forEach(Alert::sendAsTextMsg).name("SMSAlerts");
Note that name
will eventually resolve into an identifier for
an operator name and/or a stream name. Identifiers are limited
to ASCII characters, thus name
will be modified at code
generation time if it cannot be represented as an identifier.
name
- Name to assigned.java.lang.IllegalStateException
- isPlaceable()
returns false
.getInvocationName()
com.ibm.streamsx.topology.builder.BOperatorInvocation operator()