public abstract class AbstractComputation extends Object implements Computation
Computation that manages the metadata init.| Modifier and Type | Field and Description |
|---|---|
static String |
INPUT_1 |
static String |
INPUT_2 |
static String |
INPUT_3 |
protected ComputationMetadata |
metadata |
static String |
OUTPUT_1 |
static String |
OUTPUT_2 |
static String |
OUTPUT_3 |
static String |
OUTPUT_4 |
| Constructor and Description |
|---|
AbstractComputation(String name,
int nbInputStreams,
int nbOutputStreams)
Creates a computation with the requested number of input and output streams.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(ComputationContext context)
Called when the framework has registered the computation successfully.
|
ComputationMetadata |
metadata()
Identify the computation.
|
void |
processFailure(ComputationContext context,
Throwable failure)
|
void |
processRetry(ComputationContext context,
Throwable failure)
|
void |
processTimer(ComputationContext context,
String key,
long timestamp)
Process a timer callback previously set via
ComputationContext.setTimer(String, long). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, processRecord, signalStopprotected final ComputationMetadata metadata
public static final String INPUT_1
public static final String INPUT_2
public static final String INPUT_3
public static final String OUTPUT_1
public static final String OUTPUT_2
public static final String OUTPUT_3
public static final String OUTPUT_4
public AbstractComputation(String name, int nbInputStreams, int nbOutputStreams)
public void init(ComputationContext context)
Computationinit in interface Computationcontext - The computation context object provided by the system.public void processTimer(ComputationContext context, String key, long timestamp)
ComputationComputationContext.setTimer(String, long).processTimer in interface Computationcontext - The computation context object provided by the system.key - The name of the timer.timestamp - The timestamp (in ms) for which the callback was scheduled.public ComputationMetadata metadata()
Computationmetadata in interface Computationpublic void processRetry(ComputationContext context, Throwable failure)
ComputationComputation.processRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record) or Computation.processTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long) before retrying.processRetry in interface Computationpublic void processFailure(ComputationContext context, Throwable failure)
ComputationComputation.processRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record) or Computation.processTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long) fails and cannot be retried.processFailure in interface ComputationCopyright © 2019 Nuxeo. All rights reserved.