public abstract class Operation extends Object
Call start() to start the operation.
A read operation's start() method actually reads the data, and in effect runs the pipeline.
Call finish() to finish the operation.
Since both start() and finish() may call process() on this operation's consumers, start an operation after starting its consumers, and finish an operation before finishing its consumers.
| Modifier and Type | Class and Description |
|---|---|
static class |
Operation.InitializationState
The possible initialization states of an Operation.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
finishState |
Operation.InitializationState |
initializationState
The initialization state of this Operation.
|
protected Object |
initializationStateLock
The lock protecting the initialization state.
|
String |
operationName
The name of this operation.
|
protected int |
processState |
OutputReceiver[] |
receivers
The array of consuming receivers, one per operation output
"port" (e.g., DoFn main or side output).
|
protected int |
startState |
protected StateSampler |
stateSampler |
| Constructor and Description |
|---|
Operation(String operationName,
OutputReceiver[] receivers,
String counterPrefix,
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler) |
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Finishes this Operation's execution.
|
void |
start()
Starts this Operation's execution.
|
boolean |
supportsRestart()
Returns true if this Operation can be started again after it is finished.
|
public final String operationName
public final OutputReceiver[] receivers
public Operation.InitializationState initializationState
protected final Object initializationStateLock
protected final StateSampler stateSampler
protected final int startState
protected final int processState
protected final int finishState
public Operation(String operationName, OutputReceiver[] receivers, String counterPrefix, CounterSet.AddCounterMutator addCounterMutator, StateSampler stateSampler)
public void start()
throws Exception
Exceptionpublic void finish()
throws Exception
Exceptionpublic boolean supportsRestart()