Class StreamIntrospectionComputation
java.lang.Object
org.nuxeo.lib.stream.computation.AbstractComputation
org.nuxeo.ecm.core.bulk.introspection.StreamIntrospectionComputation
- All Implemented Interfaces:
Computation
A computation that reads processor and metrics streams to build a representation of stream activities in the cluster.
The representation is pushed to the KV Store.
- Since:
- 11.5
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final long
protected int
static final String
static final String
protected long
protected String
static final String
protected static final com.fasterxml.jackson.databind.ObjectMapper
protected final io.dropwizard.metrics5.MetricRegistry
protected int
protected static final long
Fields inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
INPUT_1, INPUT_2, INPUT_3, INPUT_NULL, metadata, OUTPUT_1, OUTPUT_2, OUTPUT_3, OUTPUT_4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected int
protected com.fasterxml.jackson.databind.JsonNode
protected KeyValueStore
protected String
getProcessorKey
(com.fasterxml.jackson.databind.JsonNode json) protected int
void
init
(ComputationContext context) Called when the framework has registered the computation successfully.protected void
void
processRecord
(ComputationContext context, String inputStreamName, Record record) Process an incoming record on one of the computation's input streams.void
processTimer
(ComputationContext context, String key, long timestamp) Process a timer callback previously set viaComputationContext.setTimer(String, long)
.protected void
protected void
protected void
updateStreamsAndProcessors
(com.fasterxml.jackson.databind.JsonNode node) Methods inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
metadata, processFailure, processRetry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.lib.stream.computation.Computation
destroy, signalStop
-
Field Details
-
NAME
- See Also:
-
INTROSPECTION_KV_STORE
- See Also:
-
INTROSPECTION_KEY
- See Also:
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER -
streams
-
processors
-
metrics
-
TTL_SECONDS
protected static final long TTL_SECONDS- See Also:
-
CHECK_INTERVAL_MS
protected static final long CHECK_INTERVAL_MS- See Also:
-
model
-
registry
protected final io.dropwizard.metrics5.MetricRegistry registry -
scaleMetric
protected int scaleMetric -
currentWorkerNodes
protected int currentWorkerNodes -
lastMetricsReceived
protected long lastMetricsReceived
-
-
Constructor Details
-
StreamIntrospectionComputation
public StreamIntrospectionComputation()
-
-
Method Details
-
init
Description copied from interface:Computation
Called when the framework has registered the computation successfully. Gives users a first opportunity to schedule timer callbacks and produce records. This method can be called multiple times.- Specified by:
init
in interfaceComputation
- Overrides:
init
in classAbstractComputation
- Parameters:
context
- The computation context object provided by the system.
-
getCurrentWorkerNodes
protected int getCurrentWorkerNodes() -
getScaleMetric
protected int getScaleMetric() -
loadModel
-
processTimer
Description copied from interface:Computation
Process a timer callback previously set viaComputationContext.setTimer(String, long)
.- Specified by:
processTimer
in interfaceComputation
- Overrides:
processTimer
in classAbstractComputation
- Parameters:
context
- 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.
-
processRecord
Description copied from interface:Computation
Process an incoming record on one of the computation's input streams.- Parameters:
context
- The computation context object provided by the system.inputStreamName
- Name of the input stream that provides the record.record
- The record.
-
updateStreamsAndProcessors
protected void updateStreamsAndProcessors(com.fasterxml.jackson.databind.JsonNode node) -
getProcessorKey
-
updateModel
protected void updateModel() -
getKvStore
-
buildModel
protected void buildModel() -
removeOldNodes
protected void removeOldNodes() -
getJson
-