Class UnbufferedStore
java.lang.Object
com.semedy.reasoner.reasoning.processes.ProcessImp
com.semedy.reasoner.reasoning.processes.UnbufferedStore
- Direct Known Subclasses:
BufferedStore,TopDownUnbufferedStore
A store with an unbuffered input.
Used between the rule body operators
Used between the rule body operators
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionUnbufferedStore(InterruptFlag interruptflag, ReasoningMonitor monitor, int arity, String predicate, boolean not, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, ProcessExecutor executor, boolean sorted) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNegatedNeighbour(And join) add a negated rule body operator as next operatorvoidaddNeighbour(And join) add a rule body operator as next operatorvoidadd a whole relation at the beginningvoidclear()free up ressourcesvoidevaluate()evaluate a process during reasoning.voidevaluationFinished(long querykey) the whole evaluation is finishedget all received tuplesintgetArity()arity of the tuplesget the last stores resultsget all neighboursget the basic tuple storelongbooleanStore is subsumed.voidreadAccessBegin(Set<Integer> tickets, boolean lock) Reading of the store by an operator starts.booleanreadAccessEnd(ProcessImp source, Set<Integer> tickets, boolean lock, boolean pushed) Reading of a store ends.booleanreceive a whole relationbooleanreceiveTuple(int tuple) receive a single tuplebooleanreceiveTuple(long[] tuple) receive a single tuplelongsize()startTuples(Receiver source, boolean check4Duplicates) start delivering single tuplestoString()voidtriggerNeighbours(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.ProcessImp
addNextReceiver, dispose, evaluationFinished, getPriority, getStratum, isNotQueuedSetQueued, isQueued, nextReceiver, operationFinished, receiveTuple, 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.api.reasoning.Receiver
receiveTuple
-
Constructor Details
-
UnbufferedStore
public UnbufferedStore(InterruptFlag interruptflag, ReasoningMonitor monitor, int arity, String predicate, boolean not, boolean cepReasoning, boolean cepReasoningWithRetracts, String tempDir, boolean swapping, ProcessExecutor executor, boolean sorted)
-
-
Method Details
-
evaluationFinished
Description copied from interface:Processthe whole evaluation is finished- Specified by:
evaluationFinishedin interfaceProcess- Specified by:
evaluationFinishedin interfaceStore- Overrides:
evaluationFinishedin classProcessImp- Throws:
ReasoningExceptionSemReasonerException
-
size
- Specified by:
sizein interfaceStore- Returns:
- Throws:
IOExceptionEDBException- How many tuples are stored
-
getAllTuples
- Specified by:
getAllTuplesin interfaceStore- Returns:
- Throws:
EDBException- get a list of all relations stored in storeIOException
-
getAllTuplesInOne
Description copied from interface:Storeget all received tuples- Specified by:
getAllTuplesInOnein interfaceStore- Returns:
- Throws:
IOExceptionEDBException
-
addNegatedNeighbour
Description copied from interface:Storeadd a negated rule body operator as next operator- Specified by:
addNegatedNeighbourin interfaceStore
-
addNeighbour
Description copied from interface:Storeadd a rule body operator as next operator- Specified by:
addNeighbourin interfaceStore
-
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
-
readAccessEnd
public boolean readAccessEnd(ProcessImp source, Set<Integer> tickets, boolean lock, boolean pushed) throws IOException, SemReasonerException Description copied from interface:StoreReading of a store ends.- Specified by:
readAccessEndin interfaceStore- Parameters:
source- , the readertickets- , the ticket of the reading processlock- , was a lock required at begin of the reading processpushed- , have relations be pushed instead of joined- Returns:
- Throws:
IOExceptionSemReasonerException
-
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 classProcessImp- 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 classProcessImp- Parameters:
R- the relation to be added- Throws:
IOExceptionEDBException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws EDBException, IOException Description copied from interface:Receiverstart delivering single tuples- Specified by:
startTuplesin interfaceReceiver- Specified by:
startTuplesin interfaceStore- Overrides:
startTuplesin classProcessImp- Parameters:
source- , the delivering processcheck4Duplicates- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
EDBExceptionIOException
-
incrementalRelations
- Specified by:
incrementalRelationsin interfaceStore- Returns:
- Throws:
IOExceptionEDBException- get a list of incremental relations
-
relations
- Specified by:
relationsin interfaceStore- Returns:
- Throws:
IOExceptionEDBException- get a list of received relations
-
getArity
public int getArity()Description copied from interface:Receiverarity of the tuples -
isSubsumed
public boolean isSubsumed()Description copied from interface:StoreStore is subsumed. This means that no additional tuples are stored.- Specified by:
isSubsumedin interfaceStore- Returns:
-
receiveTuple
Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Specified by:
receiveTuplein interfaceStore- Overrides:
receiveTuplein classProcessImp- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
IOExceptionSemReasonerException
-
receiveTuple
Description copied from interface:Receiverreceive a single tuple- Specified by:
receiveTuplein interfaceReceiver- Specified by:
receiveTuplein interfaceStore- Overrides:
receiveTuplein classProcessImp- Parameters:
tuple- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerExceptionIOException
-
getTupleStore
Description copied from interface:Receiverget the basic tuple store- Specified by:
getTupleStorein interfaceProcess- Specified by:
getTupleStorein interfaceReceiver- Specified by:
getTupleStorein interfaceStore- Overrides:
getTupleStorein classProcessImp- Returns:
- the tuple store
-
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 classProcessImp- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
toString
-
triggerNeighbours
Description copied from interface:Storetrigger neighbours for evaluation- Specified by:
triggerNeighboursin interfaceStore- Throws:
IOExceptionReasoningExceptionSemReasonerException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) throws InterruptedException, IOException, SemReasonerException Description copied from interface:ReceiverFinish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinishedin interfaceReceiver- Specified by:
tuplesFinishedin interfaceStore- Overrides:
tuplesFinishedin classProcessImp- Parameters:
annotation- , an annotation used for cachingR1- , the relations which have been combinedR2- , the relations which have been combined- Throws:
InterruptedExceptionIOExceptionReasoningExceptionSemReasonerException
-
incrementalSize
- Throws:
IOExceptionEDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws SemReasonerException, InterruptedException, IOException, SemReasonerException Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Specified by:
tuplesFinishedin interfaceStore- Overrides:
tuplesFinishedin classProcessImp- Parameters:
isBottomUp- TODO- Throws:
ReasoningExceptionSemReasonerExceptionInterruptedExceptionIOException
-
clear
Description copied from class:ProcessImpfree up ressources- Specified by:
clearin interfaceProcess- Overrides:
clearin classProcessImp- Throws:
IOException
-
getNeighbours
Description copied from interface:Storeget all neighbours- Specified by:
getNeighboursin interfaceStore- Returns:
-
getLastResults
Description copied from interface:Storeget the last stores results- Specified by:
getLastResultsin interfaceStore- Returns:
-