Class SwappableIncrementalRelation
java.lang.Object
com.semedy.reasoner.edb.persistentstore.AbstractCacheUnit
com.semedy.reasoner.reasoning.processes.SwappableRelation
com.semedy.reasoner.reasoning.processes.SwappableIncrementalRelation
- All Implemented Interfaces:
CacheUnit
- Direct Known Subclasses:
SwappableBufferedIncrementalRelation
Store for incremental relation.
Either incremental relation is in main memory or it is persistent.
Main memory incremental relation can be swapped out.
Either incremental relation is in main memory or it is persistent.
Main memory incremental relation can be swapped out.
- Author:
- angele
-
Field Summary
Fields inherited from class com.semedy.reasoner.reasoning.processes.SwappableRelation
_tupleStore -
Constructor Summary
ConstructorsConstructorDescriptionSwappableIncrementalRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts, boolean sorted) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddTuple(int tuple) add a tuplebooleanaddTuple(long[] tuple) add a tuplebooleanaddTuple(TupleBuffer tuple) add a tuplebooleanaddTupleMM(long[] tuple) booleanaddTupleMM(TupleBuffer tuple) booleanaddTupleP(long[] tuple) booleanaddTupleP(TupleBuffer tuple) voidclear()clear relationvoiddestroy()destroy it.get the tuple store behindbooleanis it in main memoryvoidremove()remove all tuplesvoidsetDontCheck4Duplicates(boolean check) longsize()number of tupleslongget the approximate size in bytes used in main memoryvoidvoidswapOut()swap out to temp dirvoidswap out to tuple fileSwap out to a tuple file with a generic name in temp directoryMethods inherited from class com.semedy.reasoner.reasoning.processes.SwappableRelation
finalize, getTuples, isReleasable, release, swapout
-
Constructor Details
-
SwappableIncrementalRelation
public SwappableIncrementalRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts, boolean sorted)
-
-
Method Details
-
clear
Description copied from class:SwappableRelationclear relation- Overrides:
clearin classSwappableRelation- Throws:
IOException
-
isInMemory
public boolean isInMemory()Description copied from class:SwappableRelationis it in main memory- Overrides:
isInMemoryin classSwappableRelation- Returns:
-
size
Description copied from class:SwappableRelationnumber of tuples- Overrides:
sizein classSwappableRelation- Returns:
- Throws:
IOExceptionEDBException
-
addTupleMM
- Throws:
IOExceptionEDBException
-
addTupleMM
- Throws:
IOExceptionEDBException
-
addTuple
Description copied from class:SwappableRelationadd a tuple- Overrides:
addTuplein classSwappableRelation- Returns:
- Throws:
IOExceptionEDBException
-
addTupleP
- Throws:
IOExceptionEDBException
-
addTupleP
- Throws:
IOExceptionEDBException
-
addTuple
Description copied from class:SwappableRelationadd a tuple- Overrides:
addTuplein classSwappableRelation- Returns:
- Throws:
IOExceptionEDBException
-
addTuple
Description copied from class:SwappableRelationadd a tuple- Overrides:
addTuplein classSwappableRelation- Returns:
- Throws:
IOExceptionEDBException
-
setDontCheck4Duplicates
public void setDontCheck4Duplicates(boolean check) -
storeIncremental
- Throws:
IOExceptionEDBException
-
getIncrementalTuples
-
getTupleStore
Description copied from class:SwappableRelationget the tuple store behind- Overrides:
getTupleStorein classSwappableRelation- Returns:
-
sizeInBytes
public long sizeInBytes()Description copied from class:SwappableRelationget the approximate size in bytes used in main memory- Specified by:
sizeInBytesin interfaceCacheUnit- Overrides:
sizeInBytesin classSwappableRelation- Returns:
-
getAllTuples
- Throws:
IOExceptionEDBException
-
swapOut
Description copied from class:SwappableRelationswap out to temp dir- Overrides:
swapOutin classSwappableRelation- Throws:
IOExceptionEDBException
-
swapOut
Description copied from class:SwappableRelationswap out to tuple file- Overrides:
swapOutin classSwappableRelation- Throws:
IOExceptionEDBException
-
swapOutToTupleFile
Description copied from class:SwappableRelationSwap out to a tuple file with a generic name in temp directory- Overrides:
swapOutToTupleFilein classSwappableRelation- Returns:
- Throws:
IOExceptionEDBException
-
remove
Description copied from class:SwappableRelationremove all tuples- Overrides:
removein classSwappableRelation- Throws:
IOException
-
destroy
public void destroy()Description copied from class:SwappableRelationdestroy it. Used in cache manager- Specified by:
destroyin interfaceCacheUnit- Overrides:
destroyin classSwappableRelation
-