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, unregisterSelf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getObjectName
public 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 ManagedObjectMXBean
getName
in class AbstractManagedObject
public java.lang.String getType()
getType
in interface ManagedObjectMXBean
getType
in class AbstractManagedObject
public long getBlockCapacity()
getBlockCapacity
in interface BlockManagerMXBean
public long getMemorySize()
getMemorySize
in interface BlockManagerMXBean
public long getHitCountTotal()
getHitCountTotal
in interface BlockManagerMXBean
public long getMissCountTotal()
getMissCountTotal
in interface BlockManagerMXBean
public double getMissRate()
BlockManagerMXBean
getMissRate
in interface BlockManagerMXBean
public long getBlockReadCountTotal()
getBlockReadCountTotal
in interface BlockManagerMXBean
public long getBlockWriteCountTotal()
getBlockWriteCountTotal
in interface BlockManagerMXBean