Class ProcessImp
java.lang.Object
com.semedy.reasoner.reasoning.processes.ProcessImp
- Direct Known Subclasses:
And,End,EventResultReceiver,ExecuteDirectFilterBuiltin,ExecuteFilterBuiltin,ExecuteFunctionalBuiltin,ExecuteRelationalBuiltin,Match,RuleEvaluator,Scatter,SetConstants,SubstituteFunction,TestEqual,TopDown,TopDownTrigger,UnbufferedStore,VariableToVariable
Represents a process in the operator net.
The process executor executes the processes.
Every process has a priority it is executed with.
Processes wait in an evaluation queue for being executed.
The process executor executes the processes.
Every process has a priority it is executed with.
Processes wait in an evaluation queue for being executed.
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionProcessImp(InterruptFlag interruptFlag, int arity, ReasoningMonitor monitor) ProcessImp(InterruptFlag interruptFlag, ReasoningMonitor monitor) -
Method Summary
Modifier and TypeMethodDescriptionvoidattach a next receiver which receives input from thisvoidaddRelation(ReasoningRelation tuples) add a whole relation at the beginningvoidclear()free up ressourcesvoiddispose()free ressources allocated by this processvoidevaluate()evaluate a process during reasoning.voidvoidevaluationFinished(long querykey) the whole evaluation is finishedintgetArity()arity of the tuplesintget the priority of a processintget the stratumget the basic tuple storebooleanIf process is not queued for reasoning set it as queued for reasoningfinal booleanisQueued()is process queued for reasoningget next processvoidthis process is finishedbooleanreceiveRelation(ReasoningRelation tuples) receive a whole relationbooleanreceiveTuple(int tuple) receive a single tuplebooleanreceiveTuple(long[] tuple) receive a single tuplebooleanreceiveTuple(TupleBuffer tuple) receive a single tuplevoidsetDataFlowGraph(ProcessExecutor processExecutor) set the executor for this processfinal voidsetQueued(boolean stacked) mark process as queued for reasoningvoidsetStratum(int s) set the stratum of this processstartTuples(Receiver source, boolean check4Duplicates) start delivering single tuplesvoidtuplesFinished(boolean isBottomUp) finish delivering single tuplesvoidtuplesFinished(String annotation, ReasoningRelation T1, ReasoningRelation T2) Finish delivering single tuples.
-
Constructor Details
-
ProcessImp
-
ProcessImp
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:Processget the priority of a process- Specified by:
getPriorityin interfaceProcess- Returns:
-
evaluate
Description copied from interface:Processevaluate a process during reasoning.
Returns how the number of tuples sent away- Specified by:
evaluatein interfaceProcess- Throws:
InterruptedExceptionReasoningExceptionIOExceptionSemReasonerException
-
clear
free up ressources- Specified by:
clearin interfaceProcess- Throws:
IOException
-
setQueued
public final void setQueued(boolean stacked) Description copied from interface:Processmark process as queued for reasoning -
isQueued
public final boolean isQueued()Description copied from interface:Processis process queued for reasoning -
isNotQueuedSetQueued
public boolean isNotQueuedSetQueued()Description copied from interface:ProcessIf process is not queued for reasoning set it as queued for reasoning- Specified by:
isNotQueuedSetQueuedin interfaceProcess- Returns:
-
setDataFlowGraph
Description copied from interface:Processset the executor for this process- Specified by:
setDataFlowGraphin interfaceProcess
-
operationFinished
Description copied from interface:Processthis process is finished- Specified by:
operationFinishedin interfaceProcess- Throws:
SemReasonerException
-
evaluationFinished
Description copied from interface:Processthe whole evaluation is finished- Specified by:
evaluationFinishedin interfaceProcess- Throws:
ReasoningExceptionIOExceptionSemReasonerException
-
evaluationFinished
- Throws:
IOExceptionSemReasonerException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws IOException, EDBException Description copied from interface:Receiverstart delivering single tuples- Specified by:
startTuplesin interfaceReceiver- Parameters:
source- , the delivering processcheck4Duplicates- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
IOExceptionEDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Parameters:
isBottomUp- TODO- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation T1, ReasoningRelation T2) throws InterruptedException, IOException, SemReasonerException Description copied from interface:ReceiverFinish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinishedin interfaceReceiver- Parameters:
annotation- , an annotation used for cachingT1- , the relations which have been combinedT2- , the relations which have been combined- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
addRelation
Description copied from interface:Receiveradd a whole relation at the beginning- Specified by:
addRelationin interfaceProcess- Specified by:
addRelationin interfaceReceiver- Parameters:
tuples- the relation to be added- Throws:
IOExceptionEDBException
-
getArity
public int getArity()Description copied from interface:Receiverarity of the tuples -
addNextReceiver
Description copied from interface:Processattach a next receiver which receives input from this- Specified by:
addNextReceiverin interfaceProcess
-
receiveRelation
public boolean receiveRelation(ReasoningRelation tuples) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiverreceive a whole relation- Specified by:
receiveRelationin interfaceReceiver- Parameters:
tuples- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningExceptionInterruptedExceptionIOExceptionSemReasonerException
-
receiveTuple
public boolean receiveTuple(long[] tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedExceptionIOExceptionSemReasonerException
-
receiveTuple
public boolean receiveTuple(int tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedExceptionIOExceptionSemReasonerException
-
receiveTuple
public boolean receiveTuple(TupleBuffer tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
getTupleStore
Description copied from interface:Receiverget the basic tuple store- Specified by:
getTupleStorein interfaceProcess- Specified by:
getTupleStorein interfaceReceiver- Returns:
- the tuple store
-
dispose
public void dispose()Description copied from interface:Processfree ressources allocated by this process -
setStratum
public void setStratum(int s) Description copied from interface:Processset the stratum of this process- Specified by:
setStratumin interfaceProcess
-
getStratum
public int getStratum()Description copied from interface:Processget the stratum- Specified by:
getStratumin interfaceProcess- Returns:
-
nextReceiver
Description copied from interface:Processget next process- Specified by:
nextReceiverin interfaceProcess- Returns:
-