IBM InfoSphere Streams Version 4.1.0

Limiting the scope of consistent regions

By using the @autonomous annotation, you can limit the scope of a consistent region. When you add the @autonomous annotation to an operator that is in a consistent region, it is excluded from the consistent region and the operator resorts back to its behavior before it was part of a consistent region. The failure of an operator in an autonomous region does not trigger the reset of consistent regions, with one exception. The exception is when the failed operator is fused in a PE with other operators that are in a consistent region.

The @autonomous annotation specifies that an operator that starts an autonomous region and its reachability graph does not participate in the drain and reset of a region. It is not part of a consistent region. Regarding the reachability graph, the @autonomous annotation works the same way as the @consistent annotation. The @autonomous annotation is in effect for all the operators in the reachability graph of the annotated operator.

Important: Because of potential replays in a consistent region to achieve at-least-once processing, an operator in an autonomous region might receive duplicate tuples.

The following figures show how the @autonomous annotation interacts with the @consistent annotation.

One composite operator with one autonomous region

The following figure shows an example of the @autonomous annotation that is applied to a composite operator. In the same way as the @consistent annotation, the compiler automatically identifies op11 and op12 as the start operators of the annotated composite operator, which effectively stops the draining and resetting that would otherwise flow through that composite. Because the two consistent regions do not connect, the example subgraph yields two independent consistent regions.

Figure 1. An application with two consistent regions and one autonomous region
Graphic showing two consistent regions and one autonomous region.

One primitive operator with one autonomous region

The following figure shows an example where the @autonomous annotation is applied to a primitive operator to end the consistent region that is defined by the upstream composite operator. The reachability graph of the operator that starts the autonomous region (op11) stops when the reachability graph of the autonomous operator reaches an operator that is in the reachability graph of a consistent region (op15).

Figure 2. An autonomous region ends when it reaches an operator that is in a consistent region via a different input port
Graphic showing three composite operators.

One primitive operator with one autonomous region that precedes a consistent region

The following figure shows an example where the reachability graph of a primitive operator that is annotated with @autonomous stops when it reaches an operator that is annotated with @consistent. This example yields two different consistent regions.

Figure 3. One primitive operator with one autonomous region that precedes a consistent region
Graphic showing three composite operators.

One composite operator with one autonomous region and an inner consistent region

The following figure shows an example where the @autonomous annotation is applied to a composite operator. The reachability graph starts at op11 and stops at op13 because op13 is annotated with @consistent and is a primitive operator within the composite operator.

Figure 4. One composite operator with one autonomous region and an inner consistent region
Graphic showing three composite operators.