Package fr.ifremer.isisfish.util.cache
Class IsisCacheBackendOnGuava
java.lang.Object
fr.ifremer.isisfish.util.cache.IsisCacheBackendOnGuava
- All Implemented Interfaces:
IsisCacheBackend
Cache qui reserve de la place pour l'equivalent de N pas de temps dans le cache.
Une premiere instanciation du cache est faite. Puis apres le premier pas
de temps on regarde la taille des objets ayant ete ajoutes au cache pour
recalculer la nouvelle taille pour permettre de stocker N pas de temps.
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface fr.ifremer.isisfish.util.cache.IsisCacheBackend
IsisCacheBackend.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanif true size of cache has been recomputedprotected longla plus grosse donnee mis en cacheprotected longla plus grosse donnee mis en cachestatic doublenumber of time steps to cache by interpolating from the first stepstatic final intstatic final intstatic IsisCacheBackend.Factoryprotected IsisCacheBackendOnGuava.IsisWeigherprotected TimeStepthe last step use to put value in cacheprotected longprotected longprotected longle total en d'element mis en cacheprotected longle total en d'element mis en cachestatic final intprotected longprotected longla plus petite donnee mis en cacheprotected longla plus petite donnee mis en cacheprotected longle total en octet mis en cacheprotected longle total en octet mis en cache au precedent pas de tempsprotected longle total en octet mis en cache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStat(long value) voidaddStepStat(long value) voidadjustedCache(long amount) resizes the cache if amount is not greater than autorized maxCachevoidPrevient le cache, qu'on change de TimeStep et qu'il peut faire du travail s'il en a besoin.voidclear()getStat()get specific backend cache statisticvoidvoidremoveStep(Object o)
-
Field Details
-
POINTER_SIZE
public static final int POINTER_SIZE- See Also:
-
DOUBLE_SIZE
public static final int DOUBLE_SIZE- See Also:
-
CHAR_SIZE
public static final int CHAR_SIZE- See Also:
-
CACHE_STEP
public static double CACHE_STEPnumber of time steps to cache by interpolating from the first step -
factory
-
cache
-
isisWeigher
-
maxMemory
protected long maxMemory -
maxCache
protected long maxCache -
sizeCache
protected long sizeCache -
lastStep
the last step use to put value in cache -
adjusted
protected boolean adjustedif true size of cache has been recomputed -
totalLastStepCached
protected long totalLastStepCachedle total en octet mis en cache au precedent pas de temps -
numberCached
protected long numberCachedle total en d'element mis en cache -
totalCached
protected long totalCachedle total en octet mis en cache -
smallestCached
protected long smallestCachedla plus petite donnee mis en cache -
biggestCached
protected long biggestCachedla plus grosse donnee mis en cache -
numberStepCached
protected long numberStepCachedle total en d'element mis en cache -
totalStepCached
protected long totalStepCachedle total en octet mis en cache -
smallestStepCached
protected long smallestStepCachedla plus petite donnee mis en cache -
biggestStepCached
protected long biggestStepCachedla plus grosse donnee mis en cache
-
-
Constructor Details
-
IsisCacheBackendOnGuava
public IsisCacheBackendOnGuava()
-
-
Method Details
-
addStat
public void addStat(long value) -
addStepStat
public void addStepStat(long value) -
clear
public void clear()- Specified by:
clearin interfaceIsisCacheBackend
-
removeStep
- Specified by:
removeStepin interfaceIsisCacheBackend
-
adjustedCache
public void adjustedCache(long amount) resizes the cache if amount is not greater than autorized maxCache- Parameters:
amount- new size of cache in byte
-
changeStep
public void changeStep()Previent le cache, qu'on change de TimeStep et qu'il peut faire du travail s'il en a besoin. - calcul de statistique - ajustement de la taille du cache -
get
- Specified by:
getin interfaceIsisCacheBackend
-
put
- Specified by:
putin interfaceIsisCacheBackend
-
getStat
Description copied from interface:IsisCacheBackendget specific backend cache statistic- Specified by:
getStatin interfaceIsisCacheBackend- Returns:
- backend specific string cache stat representation
-