Package com.lucidworks.apollo.pipeline
Class RuntimeStage<M>
java.lang.Object
com.lucidworks.apollo.pipeline.RuntimeStage<M>
- Type Parameters:
M-
- All Implemented Interfaces:
Configurable<com.lucidworks.apollo.pipeline.StageConfig>,Lifecycle,Processor<M>,Stage<M,,com.lucidworks.apollo.pipeline.StageConfig> StageOutput<M>
public class RuntimeStage<M>
extends Object
implements Stage<M,com.lucidworks.apollo.pipeline.StageConfig>, Lifecycle, StageOutput<M>
Decorates a Stage instance with some telemetry and bounds checking
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.prometheus.client.Counterstatic final io.prometheus.client.Counterstatic final io.prometheus.client.Counterstatic final io.prometheus.client.Counterstatic final Stringstatic final io.prometheus.client.Counter -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeStage(String pipelineId, Stage<M, C> delegate, C delegateConfig, Optional<RuntimeStage<M>> next, com.codahale.metrics.MetricRegistry metricRegistry) -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluateConditionalScript(M message, com.lucidworks.apollo.pipeline.Context context) com.lucidworks.apollo.pipeline.StageConfigcom.lucidworks.apollo.pipeline.ContextFactorycom.lucidworks.apollo.pipeline.StageConfiggetId()intcom.codahale.metrics.MetricRegistrygetNext()getProperty(String key, String defaultValue) voidhandleSignal(String signal, String value, com.lucidworks.apollo.pipeline.Context context) Handle a signalvoidinit()booleanbooleanvoidprocess(M message, com.lucidworks.apollo.pipeline.Context context, StageOutput<M> unused) Determine if the current stage should run, and if so run itvoidSend a message to the next stage in the pipeline, if setvoidstart()voidstop()
-
Field Details
-
STAGE_SKIPPED_COUNTER
public static final io.prometheus.client.Counter STAGE_SKIPPED_COUNTER -
SIGNAL_COUNTER
public static final io.prometheus.client.Counter SIGNAL_COUNTER -
STAGE_ERRORS
public static final io.prometheus.client.Counter STAGE_ERRORS -
STAGE_DONE
public static final io.prometheus.client.Counter STAGE_DONE -
CONDITION_OUTCOME
public static final io.prometheus.client.Counter CONDITION_OUTCOME -
STAGE_EXECUTION_INFO
- See Also:
-
-
Constructor Details
-
RuntimeStage
-
-
Method Details
-
getDelegate
-
getDelegateConfig
public com.lucidworks.apollo.pipeline.StageConfig getDelegateConfig() -
getNext
-
getStageType
- Specified by:
getStageTypein interfaceStage<M,com.lucidworks.apollo.pipeline.StageConfig>
-
process
public void process(M message, com.lucidworks.apollo.pipeline.Context context, StageOutput<M> unused) Determine if the current stage should run, and if so run itAlso collect some metrics and handle errors
-
send
Send a message to the next stage in the pipeline, if set- Specified by:
sendin interfaceStageOutput<M>- Parameters:
message-context-
-
handleSignal
public void handleSignal(String signal, String value, com.lucidworks.apollo.pipeline.Context context) Description copied from interface:ProcessorHandle a signal- Specified by:
handleSignalin interfaceProcessor<M>
-
getContextFactory
public com.lucidworks.apollo.pipeline.ContextFactory getContextFactory()- Specified by:
getContextFactoryin interfaceStage<M,com.lucidworks.apollo.pipeline.StageConfig>
-
getId
-
getMessageClass
- Specified by:
getMessageClassin interfaceStage<M,com.lucidworks.apollo.pipeline.StageConfig>
-
getMetricRegistry
public com.codahale.metrics.MetricRegistry getMetricRegistry()- Specified by:
getMetricRegistryin interfaceStage<M,com.lucidworks.apollo.pipeline.StageConfig>
-
managedModeEnabled
public boolean managedModeEnabled()- Specified by:
managedModeEnabledin interfaceStage<M,com.lucidworks.apollo.pipeline.StageConfig>
-
getConfiguration
public com.lucidworks.apollo.pipeline.StageConfig getConfiguration()- Specified by:
getConfigurationin interfaceConfigurable<M>
-
initManagedModeEnabled
public boolean initManagedModeEnabled() -
init
public void init()- Specified by:
initin interfaceConfigurable<M>
-
getProperty
- Specified by:
getPropertyin interfaceConfigurable<M>
-
start
public void start() -
stop
public void stop() -
getInflightMessageCount
public int getInflightMessageCount() -
getRecentErrors
-
evaluateConditionalScript
-