@InterfaceAudience.Private public final class BucketAllocator extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FEWEST_ITEMS_IN_BUCKET |
Modifier and Type | Method and Description |
---|---|
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) |
public static final int FEWEST_ITEMS_IN_BUCKET
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 blockBucketAllocatorException,CacheFullException
CacheFullException
BucketAllocatorException
public int freeBlock(long offset)
offset
- block's offsetpublic 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)
Copyright © 2013 The Apache Software Foundation. All rights reserved.