com.caucho.db.store
Class BlockManager

java.lang.Object
  extended by com.caucho.management.server.AbstractManagedObject
      extended by com.caucho.db.store.BlockManager
All Implemented Interfaces:
BlockManagerMXBean, ManagedObjectMXBean

public final class BlockManager
extends AbstractManagedObject
implements BlockManagerMXBean

Manages the block cache


Method Summary
 int allocateStoreId()
          Allocates a store id.
static BlockManager create(int minEntries)
          Returns the block manager, ensuring a minimum number of entries.
 void ensureCapacity(int minCapacity)
          Ensures the cache has a minimum number of blocks.
 void flush(Store store)
          Frees blocks with the given store.
 void freeStore(Store store)
          Frees blocks with the given store.
 void freeStoreId(int storeId)
          Frees a store id.
 long getBlockCapacity()
          Returns the capacity.
static BlockManager getBlockManager()
           
 long getHitCountTotal()
          Returns the hit count.
 long getMissCountTotal()
          Returns the miss count.
 java.lang.String getName()
          The managed name is null
 java.lang.String getType()
          The managed type is BlockManager
 
Methods inherited from class com.caucho.management.server.AbstractManagedObject
addObjectNameProperties, getObjectName, registerSelf, toString, unregisterSelf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.management.server.ManagedObjectMXBean
getObjectName
 

Method Detail

create

public static BlockManager create(int minEntries)
Returns the block manager, ensuring a minimum number of entries.


getBlockManager

public static BlockManager getBlockManager()

ensureCapacity

public void ensureCapacity(int minCapacity)
Ensures the cache has a minimum number of blocks.

Parameters:
minCapacity - the minimum capacity in blocks

allocateStoreId

public int allocateStoreId()
Allocates a store id.


flush

public void flush(Store store)
Frees blocks with the given store.


freeStore

public void freeStore(Store store)
Frees blocks with the given store.


freeStoreId

public void freeStoreId(int storeId)
Frees a store id.


getName

public java.lang.String getName()
The managed name is null

Specified by:
getName in interface ManagedObjectMXBean
Specified by:
getName in class AbstractManagedObject

getType

public java.lang.String getType()
The managed type is BlockManager

Specified by:
getType in interface ManagedObjectMXBean
Overrides:
getType in class AbstractManagedObject

getBlockCapacity

public long getBlockCapacity()
Returns the capacity.

Specified by:
getBlockCapacity in interface BlockManagerMXBean

getHitCountTotal

public long getHitCountTotal()
Returns the hit count.

Specified by:
getHitCountTotal in interface BlockManagerMXBean

getMissCountTotal

public long getMissCountTotal()
Returns the miss count.

Specified by:
getMissCountTotal in interface BlockManagerMXBean