|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.IntBlockPool.Allocator org.apache.lucene.util.RecyclingIntBlockAllocator
public final class RecyclingIntBlockAllocator
A IntBlockPool.Allocator
implementation that recycles unused int
blocks in a buffer and reuses them in subsequent calls to
getIntBlock()
.
Note: This class is not thread-safe
Field Summary | |
---|---|
static int |
DEFAULT_BUFFERED_BLOCKS
|
Fields inherited from class org.apache.lucene.util.IntBlockPool.Allocator |
---|
blockSize |
Constructor Summary | |
---|---|
RecyclingIntBlockAllocator()
Creates a new RecyclingIntBlockAllocator with a block size of
IntBlockPool.INT_BLOCK_SIZE , upper buffered docs limit of
DEFAULT_BUFFERED_BLOCKS (64). |
|
RecyclingIntBlockAllocator(int blockSize,
int maxBufferedBlocks)
Creates a new RecyclingIntBlockAllocator . |
|
RecyclingIntBlockAllocator(int blockSize,
int maxBufferedBlocks,
Counter bytesUsed)
Creates a new RecyclingIntBlockAllocator |
Method Summary | |
---|---|
long |
bytesUsed()
|
int |
freeBlocks(int num)
Removes the given number of int blocks from the buffer if possible. |
int[] |
getIntBlock()
|
int |
maxBufferedBlocks()
|
int |
numBufferedBlocks()
|
void |
recycleIntBlocks(int[][] blocks,
int start,
int end)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFERED_BLOCKS
Constructor Detail |
---|
public RecyclingIntBlockAllocator(int blockSize, int maxBufferedBlocks, Counter bytesUsed)
RecyclingIntBlockAllocator
blockSize
- the block size in bytesmaxBufferedBlocks
- maximum number of buffered int blockbytesUsed
- Counter
reference counting internally allocated bytespublic RecyclingIntBlockAllocator(int blockSize, int maxBufferedBlocks)
RecyclingIntBlockAllocator
.
blockSize
- the size of each block returned by this allocatormaxBufferedBlocks
- maximum number of buffered int blockspublic RecyclingIntBlockAllocator()
RecyclingIntBlockAllocator
with a block size of
IntBlockPool.INT_BLOCK_SIZE
, upper buffered docs limit of
DEFAULT_BUFFERED_BLOCKS
(64).
Method Detail |
---|
public int[] getIntBlock()
getIntBlock
in class IntBlockPool.Allocator
public void recycleIntBlocks(int[][] blocks, int start, int end)
recycleIntBlocks
in class IntBlockPool.Allocator
public int numBufferedBlocks()
public long bytesUsed()
IntBlockPool.Allocator
public int maxBufferedBlocks()
public int freeBlocks(int num)
num
- the number of int blocks to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |