Class SynchronizedBufferedStore
java.lang.Object
com.semedy.reasoner.reasoning.processes.ProcessImp
com.semedy.reasoner.reasoning.processes.UnbufferedStore
com.semedy.reasoner.reasoning.processes.BufferedStore
com.semedy.reasoner.reasoning.processes.SynchronizedBufferedStore
Stores intermediate results: results between two rule bodies or results of
rule evaluations
For recursive rules or recursion cycles results must be buffered.
Performs duplicate elimination if necessary
Synchronized version used for sensor builtins
For recursive rules or recursion cycles results must be buffered.
Performs duplicate elimination if necessary
Synchronized version used for sensor builtins
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedBufferedStore(InterruptFlag interruptFlag, ReasoningMonitor monitor, int arity, String predicate, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, ProcessExecutor executor, boolean sorted) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a whole relation at the beginningvoidevaluate()evaluate a process during reasoning.voidreadAccessBegin(Set<Integer> tickets, boolean lockit) Reading of the store by an operator starts.booleanreadAccessEnd(ProcessImp source, Set<Integer> tickets, boolean unlockit, boolean pushed) Reading of a store ends.booleanreceive a whole relationstartTuples(Receiver source, boolean check4Duplicates) start delivering single tuplesvoidtriggerNeighbours(int ticket) trigger neighbours for evaluationvoidtuplesFinished(boolean isBottomUp) finish delivering single tuplesvoidtuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) Finish delivering single tuples.Methods inherited from class com.semedy.reasoner.reasoning.processes.BufferedStore
addNegatedNeighbour, addNeighbour, bufferedSize, clear, evaluationFinished, getAllTuples, getAllTuplesInOne, getLastResults, getNeighbours, getTupleStore, isSubsumed, receiveTuple, receiveTuple, receiveTuple, reset1, sizeMethods inherited from class com.semedy.reasoner.reasoning.processes.UnbufferedStore
getArity, incrementalRelations, incrementalSize, relations, toStringMethods inherited from class com.semedy.reasoner.reasoning.processes.ProcessImp
addNextReceiver, dispose, evaluationFinished, getPriority, getStratum, isNotQueuedSetQueued, isQueued, nextReceiver, operationFinished, setDataFlowGraph, setQueued, setStratumMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.semedy.reasoner.reasoning.processes.Process
addNextReceiver, dispose, getPriority, getStratum, isNotQueuedSetQueued, isQueued, nextReceiver, operationFinished, setDataFlowGraph, setQueued, setStratumMethods inherited from interface com.semedy.reasoner.reasoning.processes.Store
getArity, incrementalRelations, relations, toString
-
Constructor Details
-
SynchronizedBufferedStore
public SynchronizedBufferedStore(InterruptFlag interruptFlag, ReasoningMonitor monitor, int arity, String predicate, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, ProcessExecutor executor, boolean sorted)
-
-
Method Details
-
readAccessBegin
Description copied from interface:StoreReading of the store by an operator starts.
Every reading is uniquely identified by a ticket.
Lock indicates that ressources must be locked- Specified by:
readAccessBeginin interfaceStore- Overrides:
readAccessBeginin classBufferedStore
-
readAccessEnd
public boolean readAccessEnd(ProcessImp source, Set<Integer> tickets, boolean unlockit, boolean pushed) throws SemReasonerException, IOException Description copied from interface:StoreReading of a store ends.- Specified by:
readAccessEndin interfaceStore- Overrides:
readAccessEndin classBufferedStore- Parameters:
source- , the readertickets- , the ticket of the reading processunlockit- , was a lock required at begin of the reading processpushed- , have relations be pushed instead of joined- Returns:
- Throws:
SemReasonerExceptionIOException
-
receiveRelation
public boolean receiveRelation(ReasoningRelation R) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverreceive a whole relation- Specified by:
receiveRelationin interfaceReceiver- Specified by:
receiveRelationin interfaceStore- Overrides:
receiveRelationin classBufferedStore- Parameters:
R- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
addRelation
Description copied from interface:Receiveradd a whole relation at the beginning- Specified by:
addRelationin interfaceProcess- Specified by:
addRelationin interfaceReceiver- Specified by:
addRelationin interfaceStore- Overrides:
addRelationin classBufferedStore- Parameters:
R- the relation to be added- Throws:
IOExceptionEDBException
-
triggerNeighbours
public void triggerNeighbours(int ticket) Description copied from interface:Storetrigger neighbours for evaluation- Specified by:
triggerNeighboursin interfaceStore- Overrides:
triggerNeighboursin classBufferedStore
-
startTuples
Description copied from interface:Receiverstart delivering single tuples- Specified by:
startTuplesin interfaceReceiver- Specified by:
startTuplesin interfaceStore- Overrides:
startTuplesin classUnbufferedStore- Parameters:
source- , the delivering processcheck4Duplicates- , check for duplicates in the target store- Returns:
- an object receiving the results
-
evaluate
Description copied from interface:Processevaluate a process during reasoning.
Returns how the number of tuples sent away- Specified by:
evaluatein interfaceProcess- Specified by:
evaluatein interfaceStore- Overrides:
evaluatein classBufferedStore- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) throws SemReasonerException, InterruptedException, IOException Description copied from interface:ReceiverFinish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinishedin interfaceReceiver- Specified by:
tuplesFinishedin interfaceStore- Overrides:
tuplesFinishedin classBufferedStore- Parameters:
annotation- , an annotation used for cachingR1- , the relations which have been combinedR2- , the relations which have been combined- Throws:
ReasoningExceptionSemReasonerExceptionInterruptedExceptionIOException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Specified by:
tuplesFinishedin interfaceStore- Overrides:
tuplesFinishedin classBufferedStore- Parameters:
isBottomUp- TODO- Throws:
ReasoningExceptionSemReasonerExceptionInterruptedExceptionIOException
-