Package com.semedy.reasoner.core
Class IntermediateResultProducer
java.lang.Object
com.semedy.reasoner.core.IntermediateResultProducer
- All Implemented Interfaces:
Receiver
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionIntermediateResultProducer(InterruptFlag interruptflag, int arity, String tempDir, BlockingQueue<Long> queue, SymbolTable symbols, int maxNumberOfResults) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRelation(ReasoningRelation relation) add a whole relation at the beginningintgetArity()arity of the tuplesget the basic tuple storebooleanreceiveRelation(ReasoningRelation relation) receive a whole relationbooleanreceiveTuple(int tuple) receive a single tuplebooleanreceiveTuple(long[] tuple) receive a single tuplebooleanreceiveTuple(TupleBuffer tuple) receive a single tuplebooleanreceiveTupleWOCheck(TupleBuffer tuple) startTuples(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
-
IntermediateResultProducer
public IntermediateResultProducer(InterruptFlag interruptflag, int arity, String tempDir, BlockingQueue<Long> queue, SymbolTable symbols, int maxNumberOfResults)
-
-
Method Details
-
startTuples
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:
IOException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws ReasoningException, InterruptedException, IOException Description copied from interface:Receiverfinish delivering single tuples- Specified by:
tuplesFinishedin interfaceReceiver- Parameters:
isBottomUp- TODO- Throws:
ReasoningExceptionInterruptedExceptionIOException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation T1, ReasoningRelation T2) throws ReasoningException, InterruptedException, IOException 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:
ReasoningExceptionInterruptedExceptionIOException
-
addRelation
Description copied from interface:Receiveradd a whole relation at the beginning- Specified by:
addRelationin interfaceReceiver- Parameters:
relation- the relation to be added- Throws:
IOExceptionEDBException
-
getArity
public int getArity()Description copied from interface:Receiverarity of the tuples -
getTupleStore
Description copied from interface:Receiverget the basic tuple store- Specified by:
getTupleStorein interfaceReceiver- Returns:
- the tuple store
-
receiveRelation
public boolean receiveRelation(ReasoningRelation relation) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiverreceive a whole relation- Specified by:
receiveRelationin interfaceReceiver- Parameters:
relation- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningExceptionInterruptedExceptionIOExceptionSemReasonerException
-
receiveTuple
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:
InterruptedExceptionIOExceptionEDBException
-
receiveTuple
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:
InterruptedExceptionIOExceptionEDBException
-
receiveTuple
public boolean receiveTuple(TupleBuffer tuple) throws InterruptedException, IOException, EDBException 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:
InterruptedExceptionIOExceptionEDBException
-
receiveTupleWOCheck
-