com.caucho.db.block
Class BlockManager

java.lang.Object
  extended by com.caucho.management.server.AbstractManagedObject
      extended by com.caucho.db.block.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.
 void clear()
           
static BlockManager create()
          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(BlockStore store)
          Frees blocks with the given store.
 void freeStore(BlockStore store)
          Frees blocks with the given store.
 void freeStoreId(int storeId)
          Frees a store id.
 long getBlockCapacity()
          Returns the capacity.
static BlockManager getBlockManager()
           
 long getBlockReadCountTotal()
          Returns the read count.
 long getBlockWriteCountTotal()
          Returns the write count.
 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
 boolean isEnableMmap()
           
 void setCapacity(int minCapacity)
          Ensures the cache has a minimum number of blocks.
 void setEnableMmap(boolean isEnable)
           
 
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()
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

setCapacity

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

Parameters:
minCapacity - the minimum capacity in blocks

isEnableMmap

public boolean isEnableMmap()

setEnableMmap

public void setEnableMmap(boolean isEnable)

allocateStoreId

public int allocateStoreId()
Allocates a store id.


flush

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


freeStore

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


freeStoreId

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


clear

public void clear()

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

getBlockReadCountTotal

public long getBlockReadCountTotal()
Returns the read count.

Specified by:
getBlockReadCountTotal in interface BlockManagerMXBean

getBlockWriteCountTotal

public long getBlockWriteCountTotal()
Returns the write count.

Specified by:
getBlockWriteCountTotal in interface BlockManagerMXBean