Class SwappableRelation
java.lang.Object
com.semedy.reasoner.edb.persistentstore.AbstractCacheUnit
com.semedy.reasoner.reasoning.processes.SwappableRelation
- All Implemented Interfaces:
CacheUnit
- Direct Known Subclasses:
SwappableIncrementalRelation
Store for a swappable relation.
Either relation is in main memory or it is persistent.
Main memory incremental relation can be swapped out.
Either relation is in main memory or it is persistent.
Main memory incremental relation can be swapped out.
- Author:
- angele
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSwappableRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts) SwappableRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts, boolean duplicates) the receiver it is a part of -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddTuple(int tuple) add a tuplebooleanaddTuple(long[] tuple) add a tuplebooleanaddTuple(TupleBuffer tuple) add a tuplevoidclear()clear relationvoiddestroy()destroy it.voidfinalize()finally destroy itget all tuples as reasoning relationget the tuple store behindbooleanis it in main memorybooleanis it releasable?voidrelease()swap out.voidremove()remove all tupleslongsize()number of tupleslongget the approximate size in bytes used in main memoryswapout and return it as (persistent) reasoning relationvoidswapOut()swap out to temp dirvoidswap out to tuple fileSwap out to a tuple file with a generic name in temp directory
-
Field Details
-
_tupleStore
tuple store
-
-
Constructor Details
-
SwappableRelation
public SwappableRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts, boolean duplicates) the receiver it is a part of -
SwappableRelation
public SwappableRelation(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts)
-
-
Method Details
-
clear
clear relation- Throws:
IOException
-
isInMemory
public boolean isInMemory()is it in main memory- Returns:
-
addTuple
add a tuple- Parameters:
tuple-- Returns:
- Throws:
IOExceptionEDBException
-
addTuple
add a tuple- Parameters:
tuple-- Returns:
- Throws:
IOExceptionEDBException
-
addTuple
add a tuple- Parameters:
tuple-- Returns:
- Throws:
IOExceptionEDBException
-
getTuples
get all tuples as reasoning relation -
getTupleStore
get the tuple store behind- Returns:
-
sizeInBytes
public long sizeInBytes()get the approximate size in bytes used in main memory- Specified by:
sizeInBytesin interfaceCacheUnit- Specified by:
sizeInBytesin classAbstractCacheUnit- Returns:
-
swapout
swapout and return it as (persistent) reasoning relation- Parameters:
tupleFile-- Returns:
- Throws:
IOExceptionEDBException
-
swapOutToTupleFile
Swap out to a tuple file with a generic name in temp directory- Returns:
- Throws:
IOExceptionEDBException
-
swapOut
swap out to tuple file- Parameters:
tupleFile-- Throws:
IOExceptionEDBException
-
swapOut
swap out to temp dir- Throws:
IOExceptionEDBException
-
release
swap out. Used in cache manager- Specified by:
releasein interfaceCacheUnit- Specified by:
releasein classAbstractCacheUnit- Throws:
EDBExceptionIOException
-
isReleasable
is it releasable?- Specified by:
isReleasablein interfaceCacheUnit- Specified by:
isReleasablein classAbstractCacheUnit- Returns:
- Throws:
IOException
-
remove
remove all tuples- Throws:
IOException
-
size
number of tuples- Returns:
- Throws:
IOExceptionEDBException
-
destroy
public void destroy()destroy it. Used in cache manager -
finalize
public void finalize()finally destroy it
-