|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.cas.extension.PipelineComponentRuntime
public abstract class PipelineComponentRuntime
The runtime representation of a pipeline component. A new PipelineComponentRuntime
is created for every acquisition.
Subclasses must be thread-safe. The CAS Server will invoke methods on this class from multiple-threads and potentially concurrently. Access to any mutable state must be properly synchronized.
DataSourceRuntime
,
ManipulatorRuntime
Constructor Summary | |
---|---|
PipelineComponentRuntime(PipelineComponentRuntimeContext context)
|
Method Summary | |
---|---|
void |
endAcquisition(AcquisitionEndState currentAcquisitionEndState)
Performs any necessary cleanup of the PipelineComponentRuntime. |
protected PipelineComponentRuntimeContext |
getContext()
Returns the PipelineComponentRuntimeContext of this runtime. |
void |
stop()
Called to request the PipelineComponentRuntime stop processing records. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PipelineComponentRuntime(PipelineComponentRuntimeContext context)
Method Detail |
---|
public void stop()
OutputChannel.output(com.endeca.itl.record.Record)
throw a PipelineStoppedException
.PipelineComponentRuntimeContext.isStopped()
returns true.OutputChannel.output(com.endeca.itl.record.Record)
throwing
a PipelineStoppedException
to terminate runtime processing.PipelineComponentRuntimeContext.isStopped()
and terminate
processing if a stop has been requested.PipelineComponentRuntimeContext.isStopped()
to check for stop requests, override stop() to terminate processing. For example,
if a runtime is making blocking network requests, stop() might be overridden to
cancel these network requests.endAcquisition(AcquisitionEndState)
after the acquisition has
finished stopping.
Subclasses that override this method must do so in a thread-safe manner. It can be invoked concurrently to any of the following:
DataSourceRuntime.runFullAcquisition()
ManipulatorRuntime.processRecord(com.endeca.itl.record.Record)
ManipulatorRuntime.onInputClose()
BinaryContentFileProvider.getBinaryContentFile(com.endeca.itl.record.Record)
BinaryContentInputStreamProvider.getBinaryContentInputStream(com.endeca.itl.record.Record)
PipelineComponentRuntimeContext.isStopped()
,
PipelineStoppedException
protected final PipelineComponentRuntimeContext getContext()
public void endAcquisition(AcquisitionEndState currentAcquisitionEndState) throws FullAcquisitionRecoveryRequiredException
Performs any necessary cleanup of the PipelineComponentRuntime. This method is guaranteed to be called any time after the runtime is constructed exactly once, normally after all pipeline processing has stopped for any reason.
The argument currentAcquisitionEndState is FAILURE when the crawl was
stopped short of completion (aborted or due to a failure) and may change to
FULL_ACQUISITION_RECOVERY_REQUIRED if an endAcquisition()
call on another pipeline component threw an exception.
When the argument currentAcquisitionEndState
is AcquisitionEndState.FULL_ACQUISITION_RECOVERY_REQUIRED
,
it means the next data acquisition will be in full mode, any previously saved crawl state
will be cleared at the next acquisition if the pipeline data source runtime does not implement the
IncrementalDataSourceRuntime
interface. If the pipeline data source runtime implements
IncrementalDataSourceRuntime
, it is expected to perform the fastest cleanup to
optimize for responsiveness and correctly start from a clean state the next time
runFullAcquisition
is called on the data source.
If CAS catches a Throwable
during this call, current acquisition end state will
transition to AcquisitionEndState.FULL_ACQUISITION_RECOVERY_REQUIRED
.
The output channel will not be available in the scope of this call.
currentAcquisitionEndState
-
FullAcquisitionRecoveryRequiredException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |