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 TypeMethodDescriptionvoid
addNegatedNeighbour
(And join) add a negated rule body operator as next operatorvoid
addNeighbour
(And join) add a rule body operator as next operatorvoid
add a whole relation at the beginningvoid
clear()
free up ressourcesvoid
evaluate()
evaluate a process during reasoning.void
evaluationFinished
(long querykey) the whole evaluation is finishedget all received tuplesint
getArity()
arity of the tuplesget the last stores resultsget all neighboursget the basic tuple storelong
boolean
Store is subsumed.void
readAccessBegin
(Set<Integer> tickets, boolean lock) Reading of the store by an operator starts.boolean
readAccessEnd
(ProcessImp source, Set<Integer> tickets, boolean lock, boolean pushed) Reading of a store ends.boolean
receive a whole relationboolean
receiveTuple
(int tuple) receive a single tupleboolean
receiveTuple
(long[] tuple) receive a single tuplelong
size()
startTuples
(Receiver source, boolean check4Duplicates) start delivering single tuplestoString()
void
triggerNeighbours
(int ticket) trigger neighbours for evaluationvoid
tuplesFinished
(boolean isBottomUp) finish delivering single tuplesvoid
tuplesFinished
(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, setStratum
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.semedy.reasoner.reasoning.processes.Process
addNextReceiver, dispose, getPriority, getStratum, isNotQueuedSetQueued, isQueued, nextReceiver, operationFinished, setDataFlowGraph, setQueued, setStratum
Methods 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:Process
the whole evaluation is finished- Specified by:
evaluationFinished
in interfaceProcess
- Specified by:
evaluationFinished
in interfaceStore
- Overrides:
evaluationFinished
in classProcessImp
- Throws:
ReasoningException
SemReasonerException
-
size
- Specified by:
size
in interfaceStore
- Returns:
- Throws:
IOException
EDBException
- How many tuples are stored
-
getAllTuples
- Specified by:
getAllTuples
in interfaceStore
- Returns:
- Throws:
EDBException
- get a list of all relations stored in storeIOException
-
getAllTuplesInOne
Description copied from interface:Store
get all received tuples- Specified by:
getAllTuplesInOne
in interfaceStore
- Returns:
- Throws:
IOException
EDBException
-
addNegatedNeighbour
Description copied from interface:Store
add a negated rule body operator as next operator- Specified by:
addNegatedNeighbour
in interfaceStore
-
addNeighbour
Description copied from interface:Store
add a rule body operator as next operator- Specified by:
addNeighbour
in interfaceStore
-
readAccessBegin
Description copied from interface:Store
Reading of the store by an operator starts.
Every reading is uniquely identified by a ticket.
Lock indicates that ressources must be locked- Specified by:
readAccessBegin
in interfaceStore
-
readAccessEnd
public boolean readAccessEnd(ProcessImp source, Set<Integer> tickets, boolean lock, boolean pushed) throws IOException, SemReasonerException Description copied from interface:Store
Reading of a store ends.- Specified by:
readAccessEnd
in 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:
IOException
SemReasonerException
-
receiveRelation
public boolean receiveRelation(ReasoningRelation R) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
receive a whole relation- Specified by:
receiveRelation
in interfaceReceiver
- Specified by:
receiveRelation
in interfaceStore
- Overrides:
receiveRelation
in classProcessImp
- Parameters:
R
- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- 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
- Specified by:
addRelation
in interfaceStore
- Overrides:
addRelation
in classProcessImp
- Parameters:
R
- the relation to be added- Throws:
IOException
EDBException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws EDBException, IOException Description copied from interface:Receiver
start delivering single tuples- Specified by:
startTuples
in interfaceReceiver
- Specified by:
startTuples
in interfaceStore
- Overrides:
startTuples
in classProcessImp
- Parameters:
source
- , the delivering processcheck4Duplicates
- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
EDBException
IOException
-
incrementalRelations
- Specified by:
incrementalRelations
in interfaceStore
- Returns:
- Throws:
IOException
EDBException
- get a list of incremental relations
-
relations
- Specified by:
relations
in interfaceStore
- Returns:
- Throws:
IOException
EDBException
- get a list of received relations
-
getArity
public int getArity()Description copied from interface:Receiver
arity of the tuples -
isSubsumed
public boolean isSubsumed()Description copied from interface:Store
Store is subsumed. This means that no additional tuples are stored.- Specified by:
isSubsumed
in interfaceStore
- Returns:
-
receiveTuple
Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Specified by:
receiveTuple
in interfaceStore
- Overrides:
receiveTuple
in classProcessImp
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
IOException
SemReasonerException
-
receiveTuple
Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Specified by:
receiveTuple
in interfaceStore
- Overrides:
receiveTuple
in classProcessImp
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerException
IOException
-
getTupleStore
Description copied from interface:Receiver
get the basic tuple store- Specified by:
getTupleStore
in interfaceProcess
- Specified by:
getTupleStore
in interfaceReceiver
- Specified by:
getTupleStore
in interfaceStore
- Overrides:
getTupleStore
in classProcessImp
- Returns:
- the tuple store
-
evaluate
Description copied from interface:Process
evaluate a process during reasoning.
Returns how the number of tuples sent away- Specified by:
evaluate
in interfaceProcess
- Specified by:
evaluate
in interfaceStore
- Overrides:
evaluate
in classProcessImp
- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
toString
-
triggerNeighbours
Description copied from interface:Store
trigger neighbours for evaluation- Specified by:
triggerNeighbours
in interfaceStore
- Throws:
IOException
ReasoningException
SemReasonerException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation R1, ReasoningRelation R2) throws InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
Finish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinished
in interfaceReceiver
- Specified by:
tuplesFinished
in interfaceStore
- Overrides:
tuplesFinished
in classProcessImp
- Parameters:
annotation
- , an annotation used for cachingR1
- , the relations which have been combinedR2
- , the relations which have been combined- Throws:
InterruptedException
IOException
ReasoningException
SemReasonerException
-
incrementalSize
- Throws:
IOException
EDBException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws SemReasonerException, InterruptedException, IOException, SemReasonerException Description copied from interface:Receiver
finish delivering single tuples- Specified by:
tuplesFinished
in interfaceReceiver
- Specified by:
tuplesFinished
in interfaceStore
- Overrides:
tuplesFinished
in classProcessImp
- Parameters:
isBottomUp
- TODO- Throws:
ReasoningException
SemReasonerException
InterruptedException
IOException
-
clear
Description copied from class:ProcessImp
free up ressources- Specified by:
clear
in interfaceProcess
- Overrides:
clear
in classProcessImp
- Throws:
IOException
-
getNeighbours
Description copied from interface:Store
get all neighbours- Specified by:
getNeighbours
in interfaceStore
- Returns:
-
getLastResults
Description copied from interface:Store
get the last stores results- Specified by:
getLastResults
in interfaceStore
- Returns:
-