org.w3c.www.protocol.http.cache
Class CacheState
java.lang.Object
|
+--org.w3c.www.protocol.http.cache.CacheState
- public class CacheState
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
GENERATIONS_HISTORY_SIZE
protected static final int GENERATIONS_HISTORY_SIZE
dirid
protected int dirid
byteused
protected int byteused
generation
protected int generation
gensizes
protected int[] gensizes
basegen
protected int basegen
curgen
protected int curgen
filter
protected CacheFilter filter
subdirs
protected org.w3c.www.protocol.http.cache.Subdirectory[] subdirs
CacheState
public CacheState(CacheFilter filter,
jdbmResourceStore store)
- Rebuild the cache state out of the given store of cached entries.
- Parameters:
store
- The resource store for cached entries.
getCacheUsed
public final int getCacheUsed()
getGeneration
public final int getGeneration()
setGeneration
public final void setGeneration(int g)
getBaseGeneration
public final int getBaseGeneration()
setBaseGeneration
public final void setBaseGeneration(int newbase)
getGenerationsSize
public final int[] getGenerationsSize()
setGenerationsSize
public final void setGenerationsSize(int[] sizes)
getNextFile
protected java.io.File getNextFile()
setNextGeneration
public int setNextGeneration()
- Get the next collector generation number, and update state.
- Returns:
- The next (which will be current when the method returns)
collector generation.
updateGenerationSize
protected void updateGenerationSize(int generation,
int size)
- Update generations size
- Parameters:
generation
- The generation whose size is changing.size
- The delta with previous size.
getCurrentGenerationSize
protected int getCurrentGenerationSize()
- Get current generation size.
- Returns:
- The size in bytes of the current generation.
computeCollectGeneration
protected int computeCollectGeneration(int size)
- Compute generation number to sweep, given amount of data to collect.
- Parameters:
size
- The size of data to be collected.
updateCacheSpaceCounter
public int updateCacheSpaceCounter(int size)
- Update cache space counter.
- Parameters:
size
- The number of bytes used (if positif), or the number of
bytes freed (if negative).- Returns:
- The total number of bytes used.
print
public void print(java.io.PrintStream out)