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 TypeMethodDescriptionvoid
attach a next receiver which receives input from thisvoid
addRelation
(ReasoningRelation tuples) add a whole relation at the beginningvoid
clear()
free up ressourcesvoid
dispose()
free ressources allocated by this processvoid
evaluate()
evaluate a process during reasoning.void
void
evaluationFinished
(long querykey) the whole evaluation is finishedint
getArity()
arity of the tuplesint
get the priority of a processint
get the stratumget the basic tuple storeboolean
If process is not queued for reasoning set it as queued for reasoningfinal boolean
isQueued()
is process queued for reasoningget next processvoid
this process is finishedboolean
receiveRelation
(ReasoningRelation tuples) receive a whole relationboolean
receiveTuple
(int tuple) receive a single tupleboolean
receiveTuple
(long[] tuple) receive a single tupleboolean
receiveTuple
(TupleBuffer tuple) receive a single tuplevoid
setDataFlowGraph
(ProcessExecutor processExecutor) set the executor for this processfinal void
setQueued
(boolean stacked) mark process as queued for reasoningvoid
setStratum
(int s) set the stratum of this processstartTuples
(Receiver source, boolean check4Duplicates) start delivering single tuplesvoid
tuplesFinished
(boolean isBottomUp) finish delivering single tuplesvoid
tuplesFinished
(String annotation, ReasoningRelation T1, ReasoningRelation T2) Finish delivering single tuples.
-
Constructor Details
-
ProcessImp
-
ProcessImp
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:Process
get the priority of a process- Specified by:
getPriority
in interfaceProcess
- Returns:
-
evaluate
Description copied from interface:Process
evaluate a process during reasoning.
Returns how the number of tuples sent away- Specified by:
evaluate
in interfaceProcess
- Throws:
InterruptedException
ReasoningException
IOException
SemReasonerException
-
clear
free up ressources- Specified by:
clear
in interfaceProcess
- Throws:
IOException
-
setQueued
public final void setQueued(boolean stacked) Description copied from interface:Process
mark process as queued for reasoning -
isQueued
public final boolean isQueued()Description copied from interface:Process
is process queued for reasoning -
isNotQueuedSetQueued
public boolean isNotQueuedSetQueued()Description copied from interface:Process
If process is not queued for reasoning set it as queued for reasoning- Specified by:
isNotQueuedSetQueued
in interfaceProcess
- Returns:
-
setDataFlowGraph
Description copied from interface:Process
set the executor for this process- Specified by:
setDataFlowGraph
in interfaceProcess
-
operationFinished
Description copied from interface:Process
this process is finished- Specified by:
operationFinished
in interfaceProcess
- Throws:
SemReasonerException
-
evaluationFinished
Description copied from interface:Process
the whole evaluation is finished- Specified by:
evaluationFinished
in interfaceProcess
- Throws:
ReasoningException
IOException
SemReasonerException
-
evaluationFinished
- Throws:
IOException
SemReasonerException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws IOException, EDBException Description copied from interface:Receiver
start delivering single tuples- Specified by:
startTuples
in interfaceReceiver
- Parameters:
source
- , the delivering processcheck4Duplicates
- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
IOException
EDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
finish delivering single tuples- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
isBottomUp
- TODO- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation T1, ReasoningRelation T2) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
Finish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
annotation
- , an annotation used for cachingT1
- , the relations which have been combinedT2
- , the relations which have been combined- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
addRelation
Description copied from interface:Receiver
add a whole relation at the beginning- Specified by:
addRelation
in interfaceProcess
- Specified by:
addRelation
in interfaceReceiver
- Parameters:
tuples
- the relation to be added- Throws:
IOException
EDBException
-
getArity
public int getArity()Description copied from interface:Receiver
arity of the tuples -
addNextReceiver
Description copied from interface:Process
attach a next receiver which receives input from this- Specified by:
addNextReceiver
in interfaceProcess
-
receiveRelation
public boolean receiveRelation(ReasoningRelation tuples) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiver
receive a whole relation- Specified by:
receiveRelation
in interfaceReceiver
- Parameters:
tuples
- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningException
InterruptedException
IOException
SemReasonerException
-
receiveTuple
public boolean receiveTuple(long[] tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedException
IOException
SemReasonerException
-
receiveTuple
public boolean receiveTuple(int tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedException
IOException
SemReasonerException
-
receiveTuple
public boolean receiveTuple(TupleBuffer tuple) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
getTupleStore
Description copied from interface:Receiver
get the basic tuple store- Specified by:
getTupleStore
in interfaceProcess
- Specified by:
getTupleStore
in interfaceReceiver
- Returns:
- the tuple store
-
dispose
public void dispose()Description copied from interface:Process
free ressources allocated by this process -
setStratum
public void setStratum(int s) Description copied from interface:Process
set the stratum of this process- Specified by:
setStratum
in interfaceProcess
-
getStratum
public int getStratum()Description copied from interface:Process
get the stratum- Specified by:
getStratum
in interfaceProcess
- Returns:
-
nextReceiver
Description copied from interface:Process
get next process- Specified by:
nextReceiver
in interfaceProcess
- Returns:
-