public static class Operator.OperatorStates extends java.lang.Object
The state of a given Operator may also be changed independently of its
Informally, an Operator transitions through states as follows. The
initial state of an Operator is
NOT_YET_STARTED. In this
state an Operator has been instantiated and its
method has been called.
NOT_YET_STARTED an Operator transitions to the
STARTED state. An Operator starts either because its
containing application has started or because it has been started through
sbadmin. An Operator receives two callbacks from the
StreamBase runtime when it starts,
resumed(). First, the runtime calls the
resume() method. Once
resume() has returned,
any threads that the Operator has registered are started, if need be.
Next, the Operator transitions to the
STARTED state. The
Operator then receives a second callback,
STARTED state, the Operator may transition to the
SUSPENDED state. An Operator may transition to
SUSPENDED because its application has suspended or because
it has been explicitly suspended with
StreamBase runtime also makes call backs on suspend; first the
suspend() callback is made, then the Operator transitions to
SUSPENDED state, then the
callback is made.
SUSPENDED, an Operator can transition back to
STARTED. This is referred to as 'resuming'. An Operator can
resume when its application resumes or when it is explicitly resumed
An Operator get the same callbacks from the runtime when it starts and
when it resumes,
Essentially then, these two transitions, starting and resuming, are
equivalent. This implies then that any code that should be run just once
for an instance of an Operator belongs in its
rather than in the
An Operator can transition between
SUSPENDED any number of times.
SHUTDOWN is an Operator's terminal state. An Operator can
SHUTDOWN state from any of its other states. The
StreamBase runtime calls back to the method
An instance of an Operator can not be recovered from a state of
SHUTDOWN. Once shut down, an Operator can be 'restarted'
sbadmin restart command. However, this causes a
new Operator instance to be constructed and its
method to be called. Any state held by the prior instance of the Operator
|Modifier and Type||Field and Description|
The initial state of an Operator.
The terminal state of the Operator.
The Operator has been started; resume() has been called.
The Operator has been suspended; suspend() has been called.
public static final int NONE
public static final int NOT_YET_STARTED
public static final int STARTED
public static final int SUSPENDED
public static final int SHUTDOWN