Operator LeadershipElection

com.ibm.streamsx.plumbing > com.ibm.streamsx.plumbing 1.0.0 > com.ibm.streamsx.plumbing.leader > LeadershipElection

Performs a leadership election between other operator invocations with the same group. At any time only one invocation is the leader, should a leader have a failure a new leader will be elected. Leadership election uses Apache Curator's leadership latch recipe against the Streams instance Zookeeper service. When the path parameter is not set the leadership election is between operator invocations with the same group in a single job. In this case:
  • the application requires an invocation of the JobControlPlane operator.
  • Invocations of LeadershipElection within the same group must be exlocated into different PEs.
The Zookeeper root znode for the recipe is a sub-node group within job's storage node (com.ibm.streams.management.job.JobMXBean.retrieveZooKeeperStorageNode()).
When the path parameter is set the leadership election is between operator invocations with the same path and group in a single domain, typically between operator invocations in different jobs in an instance. In this case:
  • Any invocations of LeadershipElection within the same path and group and job must be exlocated into different PEs.
The Zookeeper root znode for the recipe is a path/group.

When the leadership state of the operator changes a tuple is submitted to the output port.

Summary

Ports
This operator has 0 input ports and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 2 parameters.

Required: group

Optional: path

Metrics
This operator reports 1 metric.

Properties

Implementation
Java

Output Ports

Assignments
Java operators do not support output assignments.
Ports (0)

Contains tuples representing leadership status changes. The stream schema can be LeaderStatus or any arbitrary schema. Any attribute matching an attribute in LeaderStatus willbe set to a valid value otherwise it will be set to its default value.

Properties

Parameters

This operator supports 2 parameters.

Required: group

Optional: path

group

Leadership group name. All instances of this operator within the same group are participants in a single leadership election. Group name must not start with a slash (/).

Properties
path

Znode path for leadership election across multiple jobs, must start with a / to be used across jobs (or an empty string to default to within a job). Optional, when not set (or set to the empty string) the path used is specific to the job and leadership election is across operator invocations within a single jobs.

Properties

Metrics

isLeader - Gauge

Is this invocation the leader. 1 this operator invocation is the leader for the group, 0 is it not the leader.

Libraries

Operator class library
Library Path: ../../impl/lib/com.ibm.streamsx.plumbing.jar, ../../opt/apache-curator/*, ../../opt/slf4j-1.7.5/*, ../../opt/zookeeper-3.4.8.jar, ../../opt/guava-14.0.1.jar