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
ConstructorDescriptionSwappableIncrementalRelation
(int arity, ReasoningMonitor monitor, String tempDir, boolean releasable, boolean cepReasoning, boolean retracts, boolean sorted) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addTuple
(int tuple) add a tupleboolean
addTuple
(long[] tuple) add a tupleboolean
addTuple
(TupleBuffer tuple) add a tupleboolean
addTupleMM
(long[] tuple) boolean
addTupleMM
(TupleBuffer tuple) boolean
addTupleP
(long[] tuple) boolean
addTupleP
(TupleBuffer tuple) void
clear()
clear relationvoid
destroy()
destroy it.get the tuple store behindboolean
is it in main memoryvoid
remove()
remove all tuplesvoid
setDontCheck4Duplicates
(boolean check) long
size()
number of tupleslong
get the approximate size in bytes used in main memoryvoid
void
swapOut()
swap out to temp dirvoid
swap 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:SwappableRelation
clear relation- Overrides:
clear
in classSwappableRelation
- Throws:
IOException
-
isInMemory
public boolean isInMemory()Description copied from class:SwappableRelation
is it in main memory- Overrides:
isInMemory
in classSwappableRelation
- Returns:
-
size
Description copied from class:SwappableRelation
number of tuples- Overrides:
size
in classSwappableRelation
- Returns:
- Throws:
IOException
EDBException
-
addTupleMM
- Throws:
IOException
EDBException
-
addTupleMM
- Throws:
IOException
EDBException
-
addTuple
Description copied from class:SwappableRelation
add a tuple- Overrides:
addTuple
in classSwappableRelation
- Returns:
- Throws:
IOException
EDBException
-
addTupleP
- Throws:
IOException
EDBException
-
addTupleP
- Throws:
IOException
EDBException
-
addTuple
Description copied from class:SwappableRelation
add a tuple- Overrides:
addTuple
in classSwappableRelation
- Returns:
- Throws:
IOException
EDBException
-
addTuple
Description copied from class:SwappableRelation
add a tuple- Overrides:
addTuple
in classSwappableRelation
- Returns:
- Throws:
IOException
EDBException
-
setDontCheck4Duplicates
public void setDontCheck4Duplicates(boolean check) -
storeIncremental
- Throws:
IOException
EDBException
-
getIncrementalTuples
-
getTupleStore
Description copied from class:SwappableRelation
get the tuple store behind- Overrides:
getTupleStore
in classSwappableRelation
- Returns:
-
sizeInBytes
public long sizeInBytes()Description copied from class:SwappableRelation
get the approximate size in bytes used in main memory- Specified by:
sizeInBytes
in interfaceCacheUnit
- Overrides:
sizeInBytes
in classSwappableRelation
- Returns:
-
getAllTuples
- Throws:
IOException
EDBException
-
swapOut
Description copied from class:SwappableRelation
swap out to temp dir- Overrides:
swapOut
in classSwappableRelation
- Throws:
IOException
EDBException
-
swapOut
Description copied from class:SwappableRelation
swap out to tuple file- Overrides:
swapOut
in classSwappableRelation
- Throws:
IOException
EDBException
-
swapOutToTupleFile
Description copied from class:SwappableRelation
Swap out to a tuple file with a generic name in temp directory- Overrides:
swapOutToTupleFile
in classSwappableRelation
- Returns:
- Throws:
IOException
EDBException
-
remove
Description copied from class:SwappableRelation
remove all tuples- Overrides:
remove
in classSwappableRelation
- Throws:
IOException
-
destroy
public void destroy()Description copied from class:SwappableRelation
destroy it. Used in cache manager- Specified by:
destroy
in interfaceCacheUnit
- Overrides:
destroy
in classSwappableRelation
-