@InterfaceAudience.Private public final class BucketAllocator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BucketAllocator.Bucket |
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.
|
int |
freeBlock(long offset)
Free a block with the offset
|
long |
freeBlock(long[] freeList) |
BucketAllocator.Bucket[] |
getBuckets() |
long |
getFreeSize() |
long |
getTotalSize() |
long |
getUsedSize() |
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) |
String |
toString() |
public static final int FEWEST_ITEMS_IN_BUCKET
public org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.BucketSizeInfo roundUpToBucketSizeInfo(int blockSize)
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 BucketAllocator.Bucket[] getBuckets()
public long freeBlock(long[] freeList)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.