ozone core API

org.ozoneDB.core.storage
Class GcListeningDelayCache

java.lang.Object
  extended byorg.ozoneDB.core.storage.AbstractTrimmingCache
      extended byorg.ozoneDB.core.storage.DelayCache
          extended byorg.ozoneDB.core.storage.GcListeningDelayCache
All Implemented Interfaces:
Cache, PropertyConfigurable, TrimmingCache

public class GcListeningDelayCache
extends DelayCache

Version:
$Id: GcListeningDelayCache.java,v 1.3.2.1 2004/03/28 16:40:04 per_nyfelt Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)

Nested Class Summary
private  class GcListeningDelayCache.GcIndicatorThread
          Is woken up every time the gc has completed a run, or is in the process of a run.
(package private) static class GcListeningDelayCache.Item
           
 
Nested classes inherited from class org.ozoneDB.core.storage.DelayCache
DelayCache.TimedEntry
 
Nested classes inherited from class org.ozoneDB.core.storage.TrimmingCache
TrimmingCache.TrimHandler
 
Field Summary
private  java.lang.ref.WeakReference gcIndicator
          gets cleared every time the jvm gc runs
private  java.lang.Thread gcIndicatorThread
           
private  java.lang.ref.ReferenceQueue gcQueue
           
private  long highThreshold
           
static PropertyInfo HIGHTHRESHOLD
           
private static java.util.logging.Logger log
           
private  long lowThreshold
           
static PropertyInfo LOWTHRESHOLD
           
 
Fields inherited from class org.ozoneDB.core.storage.DelayCache
DELAY, INITIALCAPACITY, LOADFACTOR, MINSLEEPTIME
 
Fields inherited from class org.ozoneDB.core.storage.AbstractTrimmingCache
 
Constructor Summary
GcListeningDelayCache(java.util.Properties properties, java.lang.String prefix)
           
 
Method Summary
 long getHighThreshold()
           
 long getLowThreshold()
           
static void main(java.lang.String[] args)
           
private  void ourGC()
           
private  void resetGcIndicator()
          Creates an object that is only weakly referenced.
 void setHighThreshold(long highThreshold)
          value in range
 void setLowThreshold(long lowThreshold)
          value in range <0, min(1,highThreshold)] indicating when cache should throw away all its entries.
 
Methods inherited from class org.ozoneDB.core.storage.DelayCache
copyToMap, get, getDelay, getEntries, getKeysToEntries, getMinSleepTime, getPropertyInfos, put, remove, setDelay, setMinSleepTime, size
 
Methods inherited from class org.ozoneDB.core.storage.AbstractTrimmingCache
getPrefix, getSynchronizer, getTrimHandler, setSynchronizer, setTrimHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.core.storage.PropertyConfigurable
getPrefix
 

Field Detail

log

private static java.util.logging.Logger log

HIGHTHRESHOLD

public static final PropertyInfo HIGHTHRESHOLD

LOWTHRESHOLD

public static final PropertyInfo LOWTHRESHOLD

gcIndicator

private java.lang.ref.WeakReference gcIndicator
gets cleared every time the jvm gc runs


gcQueue

private java.lang.ref.ReferenceQueue gcQueue

gcIndicatorThread

private java.lang.Thread gcIndicatorThread

lowThreshold

private long lowThreshold

highThreshold

private long highThreshold
Constructor Detail

GcListeningDelayCache

public GcListeningDelayCache(java.util.Properties properties,
                             java.lang.String prefix)
Method Detail

resetGcIndicator

private final void resetGcIndicator()
Creates an object that is only weakly referenced. There is a 1 on 1 correspondance between this weak reference getting enqueued and a jvm gc run


ourGC

private void ourGC()

setHighThreshold

public void setHighThreshold(long highThreshold)
value in range

setLowThreshold

public void setLowThreshold(long lowThreshold)
value in range <0, min(1,highThreshold)] indicating when cache should throw away all its entries.


getHighThreshold

public long getHighThreshold()

getLowThreshold

public long getLowThreshold()

main

public static void main(java.lang.String[] args)

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.