Class CacheManager3
java.lang.Object
com.semedy.reasoner.edb.persistentstore.CacheManager3
- Author:
- angele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidadd to list of units to destruct at the endstatic voidstatic booleancheck4release(long size) check whether a unit with a certain size should be releasedstatic voidclear()clear all lists.static voidfreeUp(int size) free up memory by releasing cached unitsstatic intfor statistic purposestatic intstatic intfor statistic purposestatic intfor statistic purposestatic intfor statistic purposestatic voidrelease all listed unitsstatic voidremove a cache unitstatic voidstatic voidsetTest(boolean t) static voidstop()static voidcache recently used blocks, free up cached blocks which has not been used for the longest time
-
Constructor Details
-
CacheManager3
public CacheManager3()
-
-
Method Details
-
setLock
-
getCounter
public static int getCounter() -
touch
cache recently used blocks, free up cached blocks which has not been used for the longest time -
addToDestroy
add to list of units to destruct at the end- Parameters:
c-
-
addToReleasedUnits
-
addToAddedUnits
-
remove
remove a cache unit- Parameters:
c-
-
setTest
public static void setTest(boolean t) -
releaseAll
release all listed units- Throws:
IOExceptionEDBException
-
check4release
public static boolean check4release(long size) check whether a unit with a certain size should be released- Parameters:
size-- Returns:
-
clear
clear all lists. Used at the end of a run, e.g. at end of a test to clear all up, destroy destroyables- Throws:
EDBExceptionIOException
-
freeUp
public static void freeUp(int size) free up memory by releasing cached units- Parameters:
size-- Throws:
IOException
-
getNumPages
public static int getNumPages()for statistic purpose- Returns:
-
getAddedPages
public static int getAddedPages()for statistic purpose- Returns:
-
getPagesToDestroy
public static int getPagesToDestroy()for statistic purpose- Returns:
-
getReleasedPages
public static int getReleasedPages()for statistic purpose- Returns:
-
getReleasedClasses
-
getAddedClasses
-
stop
- Throws:
InterruptedException
-