|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.cas.extension.PipelineComponentRuntime com.endeca.cas.extension.ManipulatorRuntime
public abstract class ManipulatorRuntime
The runtime representation of a manipulator instance.
A new instance of a ManipulatorRuntime
is created
for each manipulator instance in every acquisition.
The general life cycle of a ManipulatorRuntime is:
Manipulator.createManipulatorRuntime(PipelineComponentConfiguration, PipelineComponentRuntimeContext)
.checkFullAcquisitionRequired()
is called to ensure that the runtime has the necessary state to support an incremental acquisition.prepareForAcquisition(AcquisitionMode)
to perform any runtime initialization
that requires the AcquisitionMode.processRecord(Record)
is called for every input record.onInputClose()
is called after the runtime has processed all input records.PipelineComponentRuntime.endAcquisition(AcquisitionEndState)
is called to clean up any resources used by
the runtime.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. See the CAS Extension API Guide for more information about threading.
Constructor Summary | |
---|---|
ManipulatorRuntime(PipelineComponentRuntimeContext context)
|
Method Summary | |
---|---|
boolean |
checkFullAcquisitionRequired()
Indicates whether a full acquisition is required based on the state maintained by the ManipulatorRuntime . |
void |
onInputClose()
Performs any post-processing necessary once processRecord()
has been called and has returned for the last time. |
void |
prepareForAcquisition(AcquisitionMode mode)
Performs any preparation necessary before acquisition starts. |
abstract void |
processRecord(Record record)
Applies the manipulation to the given record. |
Methods inherited from class com.endeca.cas.extension.PipelineComponentRuntime |
---|
endAcquisition, getContext, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ManipulatorRuntime(PipelineComponentRuntimeContext context)
Method Detail |
---|
public boolean checkFullAcquisitionRequired()
ManipulatorRuntime
.
If CAS has already determined that a full acquisition is required, this method will not be called. For example, CAS will not call this method if the pipeline has never been run or if a configuration change requires full acquisition.
The default implementation of this method returns false indicating a full acquisition is not required.
PipelineComponentConfiguration.isFullAcquisitionRequired(PipelineComponentConfiguration)
public void prepareForAcquisition(AcquisitionMode mode) throws FatalExecutionException
mode
- indicates whether the acquisition is full or incremental
FatalExecutionException
- if preparation failed,
and no processing of any records should take place.public abstract void processRecord(Record record) throws ExecutionException
OutputChannel
obtained from the
PipelineComponentRuntimeContext
. The CAS Server performs no
further processing on Records that are not output.
The CAS Server invokes this method concurrently for multiple records, so implementations must be thread-safe.
If a java RuntimeException or an ExecutionException
that is not a FatalExecutionException
is thrown, CAS discards the record using the ErrorChannel
.
record
- the record to be processed
ExecutionException
- if processing of this record failed,
but that further processing of other records may continue normally.
FatalExecutionException
- if processing of the current record
failed, and no further processing of any records should continue.PipelineComponentRuntime.stop()
public void onInputClose() throws FatalExecutionException
processRecord()
has been called and has returned for the last time. The
ManipulatorRuntime
can still
output records in this method.
Any Exceptions thrown from this method, including RuntimeExceptions, cause the acquisition to fail.
FatalExecutionException
- if post-processing failed,
and no further processing of any records should continue.PipelineComponentRuntime.stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |