Package org.jesterj.ingest.model
Interface Step
-
- All Superinterfaces:
Active,java.util.concurrent.BlockingQueue<Document>,java.util.Collection<Document>,Configurable,DeferredBuilding,java.lang.Iterable<Document>,java.util.Queue<Document>,java.lang.Runnable
- All Known Subinterfaces:
Scanner
- All Known Implementing Classes:
JdbcScanner,ScannerImpl,SimpleFileScanner,StepImpl
public interface Step extends Active, java.util.concurrent.BlockingQueue<Document>, java.lang.Runnable, DeferredBuilding, Configurable
AStepis aBlockingQueuewith a capacity equal to its concurrency level. When the step is full, attempts to add anDocumentwill throw IllegalStateException, and the calling code MUST check for and handle this condition gracefully.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJJ_PLAN_NAMEstatic java.lang.StringJJ_PLAN_VERSION-
Fields inherited from interface org.jesterj.ingest.model.Configurable
VALID_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddPredecessor(StepImpl obj)Register a step as a predecessor of this step (one that might send documents to this step).intgetBatchSize()Set the number of items to process concurrently.java.util.Set<Step>getDownstreamOutputSteps()Identify the downstream steps that must only be executed once per document.java.util.LinkedHashMap<java.lang.String,Step>getEligibleNextSteps(Document d)The steps that are reachable from this step and lead to at least one destination valid for the document.java.util.LinkedHashMap<java.lang.String,Step>getNextSteps()The steps that are reachable from this step.NextStepsgetNextSteps(Document d)Get the next step in the plan for the given documentjava.util.Set<java.lang.String>getOutputDestinationNames()PlangetPlan()Get the plan instance to which this step belongs.java.util.List<Step>getPriorSteps()RoutergetRouter()booleanisActivePriorSteps()Determine if any upstream steps are still active.default booleanisOutputDestinationThisStep(java.lang.String destinationPath)booleanisOutputStep()voidsendToNext(Document doc)After processing is complete, send it on to any subsequent steps if appropriate.-
Methods inherited from interface org.jesterj.ingest.model.Active
activate, deactivate, isActive
-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.jesterj.ingest.model.Configurable
getName, isValidName
-
Methods inherited from interface org.jesterj.ingest.model.DeferredBuilding
addDeferred, executeDeferred
-
-
-
-
Field Detail
-
JJ_PLAN_VERSION
static final java.lang.String JJ_PLAN_VERSION
- See Also:
- Constant Field Values
-
JJ_PLAN_NAME
static final java.lang.String JJ_PLAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBatchSize
int getBatchSize()
Set the number of items to process concurrently.- Returns:
- the batch size.
-
getNextSteps
NextSteps getNextSteps(Document d)
Get the next step in the plan for the given document- Parameters:
d- the document for which a next step should be determined.- Returns:
- the getNext step
-
getPlan
Plan getPlan()
Get the plan instance to which this step belongs.- Returns:
- the plan (not a man, not a canal, not panama)
-
sendToNext
void sendToNext(Document doc)
After processing is complete, send it on to any subsequent steps if appropriate. This method may inspect the document status and if the document is not dropped, errored, etc. and there are multiple possible destination steps it should invoke the router to determine the appropriate destinations and conduct the submission of the results to the indicated steps.- Parameters:
doc- The document for which processing is complete.
-
getOutputDestinationNames
java.util.Set<java.lang.String> getOutputDestinationNames()
-
getDownstreamOutputSteps
java.util.Set<Step> getDownstreamOutputSteps()
Identify the downstream steps that must only be executed once per document.- Returns:
- The steps downstream from this one that are neither safe nor idempotent.
-
isOutputStep
boolean isOutputStep()
-
getNextSteps
java.util.LinkedHashMap<java.lang.String,Step> getNextSteps()
The steps that are reachable from this step.- Returns:
- A map of steps keyed by their names.
-
getEligibleNextSteps
java.util.LinkedHashMap<java.lang.String,Step> getEligibleNextSteps(Document d)
The steps that are reachable from this step and lead to at least one destination valid for the document.- Returns:
- A map of steps keyed by their names.
-
isActivePriorSteps
boolean isActivePriorSteps()
Determine if any upstream steps are still active. A true result implies that documents may yet be received for processing, and it is not safe to shut down the processing thread for this step.- Returns:
- true if any immediately prior steps are still active
-
getPriorSteps
java.util.List<Step> getPriorSteps()
-
addPredecessor
void addPredecessor(StepImpl obj)
Register a step as a predecessor of this step (one that might send documents to this step).- Parameters:
obj- The step to register as a potential upstream source of documents.
-
getRouter
Router getRouter()
-
isOutputDestinationThisStep
default boolean isOutputDestinationThisStep(java.lang.String destinationPath)
-
-