|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator
@InterfaceAudience.Private public final class BucketAllocator
This class is used to allocate a block with specified size and free the block when evicting. It manages an array of buckets, each bucket is associated with a size and caches elements up to this size. For completely empty bucket, this size could be re-specified dynamically. This class is not thread safe.
| Field Summary | |
|---|---|
static int |
FEWEST_ITEMS_IN_BUCKET
|
| Method Summary | |
|---|---|
long |
allocateBlock(int blockSize)
Allocate a block with specified size. |
void |
dumpToLog()
|
int |
freeBlock(long offset)
Free a block with the offset |
long |
freeBlock(long[] freeList)
|
long |
getFreeSize()
|
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics[] |
getIndexStatistics()
|
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics[] |
getIndexStatistics(org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics grandTotal)
|
String |
getInfo()
|
static int |
getMaximumAllocationIndex()
|
long |
getTotalSize()
|
long |
getUsedSize()
|
void |
logStatistics()
|
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.BucketSizeInfo |
roundUpToBucketSizeInfo(int blockSize)
Round up the given block size to bucket size, and get the corresponding BucketSizeInfo |
int |
sizeIndexOfAllocation(long offset)
|
int |
sizeOfAllocation(long offset)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FEWEST_ITEMS_IN_BUCKET
| Method Detail |
|---|
public org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.BucketSizeInfo roundUpToBucketSizeInfo(int blockSize)
blockSize -
public String getInfo()
public long getUsedSize()
public long getFreeSize()
public long getTotalSize()
public long allocateBlock(int blockSize)
throws CacheFullException,
BucketAllocatorException
blockSize - size of block
BucketAllocatorException,CacheFullException
CacheFullException
BucketAllocatorExceptionpublic int freeBlock(long offset)
offset - block's offset
public int sizeIndexOfAllocation(long offset)
public int sizeOfAllocation(long offset)
public static int getMaximumAllocationIndex()
public void dumpToLog()
public void logStatistics()
public org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics[] getIndexStatistics(org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics grandTotal)
public org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics[] getIndexStatistics()
public long freeBlock(long[] freeList)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||