public final class BlockManager extends AbstractManagedObject implements BlockManagerMXBean
| Modifier and Type | Method and Description |
|---|---|
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 |
ensureMemoryCapacity(long memorySize) |
void |
flush()
Flushes all 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 |
getBlockCacheMemoryCapacity() |
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 |
getMemorySize()
Returns the capacity in bytes.
|
long |
getMissCountTotal()
Returns the miss count.
|
double |
getMissRate()
Returns the block cache miss rate.
|
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) |
addObjectNameProperties, getObjectName, registerSelf, toString, unregisterSelfclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetObjectNamepublic static BlockManager create()
public static BlockManager getBlockManager()
public void ensureCapacity(int minCapacity)
minCapacity - the minimum capacity in blockspublic void setCapacity(int minCapacity)
minCapacity - the minimum capacity in blockspublic void ensureMemoryCapacity(long memorySize)
public long getBlockCacheMemoryCapacity()
public boolean isEnableMmap()
public void setEnableMmap(boolean isEnable)
public int allocateStoreId()
public void flush(BlockStore store)
public void flush()
public void freeStore(BlockStore store)
public void freeStoreId(int storeId)
public void clear()
public java.lang.String getName()
getName in interface ManagedObjectMXBeangetName in class AbstractManagedObjectpublic java.lang.String getType()
getType in interface ManagedObjectMXBeangetType in class AbstractManagedObjectpublic long getBlockCapacity()
getBlockCapacity in interface BlockManagerMXBeanpublic long getMemorySize()
getMemorySize in interface BlockManagerMXBeanpublic long getHitCountTotal()
getHitCountTotal in interface BlockManagerMXBeanpublic long getMissCountTotal()
getMissCountTotal in interface BlockManagerMXBeanpublic double getMissRate()
BlockManagerMXBeangetMissRate in interface BlockManagerMXBeanpublic long getBlockReadCountTotal()
getBlockReadCountTotal in interface BlockManagerMXBeanpublic long getBlockWriteCountTotal()
getBlockWriteCountTotal in interface BlockManagerMXBean