Package com.lucidworks.apollo.pipeline
Class Pipeline<M>
java.lang.Object
com.lucidworks.apollo.pipeline.Pipeline<M>
Main runtime support for a pipeline (the actual thing that runs)
Controls wiring the stages together, starting, and stopping them.
TODO
suspending/resuming
plugins for stages
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.prometheus.client.Histogramprotected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPipeline(String instanceId, String pipelineId, List<com.lucidworks.apollo.pipeline.StageConfig> stageConfigs, StageFactory<M> stageFactory, com.codahale.metrics.MetricRegistry globalMetricRegistry, com.codahale.metrics.MetricRegistry metricRegistry, ConfigurationComponent configurationComponent, Map<String, String> initialProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStateListener(Runnable runnable, Pipeline.State... states) Collect errors from the stagescom.codahale.metrics.MetricRegistrylonggetState()booleanisInState(Pipeline.State... states) booleanbooleanprotected com.lucidworks.apollo.pipeline.StageCallback<M>Method for generating a new default StageCallback for this pipeline.longvoidvoidsendEndOfBatch(com.lucidworks.apollo.pipeline.Context requestContext) for use when messages are being sent through the non iterators method when a downstream consumer needs to know that the last pipeline message has been sentvoidstop()protected voidzerothStage(M message, com.lucidworks.apollo.pipeline.Context requestContext)
-
Field Details
-
PIPELINE_EXECUTION_DURATION_SECS
public static final io.prometheus.client.Histogram PIPELINE_EXECUTION_DURATION_SECS -
pipelineId
-
-
Constructor Details
-
Pipeline
protected Pipeline(String instanceId, String pipelineId, List<com.lucidworks.apollo.pipeline.StageConfig> stageConfigs, StageFactory<M> stageFactory, com.codahale.metrics.MetricRegistry globalMetricRegistry, com.codahale.metrics.MetricRegistry metricRegistry, ConfigurationComponent configurationComponent, Map<String, String> initialProperties)
-
-
Method Details
-
getInstanceId
-
getPipelineId
-
getState
-
getMetrics
public com.codahale.metrics.MetricRegistry getMetrics() -
getStartTime
-
getStages
-
getRunningTimeMs
public long getRunningTimeMs() -
getErrors
Collect errors from the stages- Returns:
-
stop
public void stop() -
maybeStop
public boolean maybeStop() -
send
-
send
- Parameters:
messages- - Iterator of pipeline messagesrequestContext-- Returns:
- total number of messages from Iterator sent to a pipeline
-
sendEndOfBatch
public void sendEndOfBatch(com.lucidworks.apollo.pipeline.Context requestContext) for use when messages are being sent through the non iterators method when a downstream consumer needs to know that the last pipeline message has been sent- Parameters:
requestContext-
-
zerothStage
-
newStageCallback
Method for generating a new default StageCallback for this pipeline. Overridable by classes extending this class (IndexPipeline extends this at time of writing) -
addStateListener
-
isInState
-
isTerminalState
public boolean isTerminalState()
-