static class HeapMemStoreLAB.Chunk extends Object
Modifier and Type | Field and Description |
---|---|
private AtomicInteger |
allocCount
Total number of allocations satisfied from this buffer
|
private byte[] |
data
Actual underlying data
|
private AtomicInteger |
nextFreeOffset
Offset for the next allocation, or the sentinel value -1
which implies that the chunk is still uninitialized.
|
private static int |
OOM |
private int |
size
Size of chunk in bytes
|
private static int |
UNINITIALIZED |
Constructor and Description |
---|
HeapMemStoreLAB.Chunk(int size)
Create an uninitialized chunk.
|
Modifier and Type | Method and Description |
---|---|
int |
alloc(int size)
Try to allocate
size bytes from the chunk. |
(package private) int |
getNextFreeOffset() |
void |
init()
Actually claim the memory for this chunk.
|
(package private) void |
reset()
Reset the offset to UNINITIALIZED before before reusing an old chunk
|
String |
toString() |
private byte[] data
private static final int UNINITIALIZED
private static final int OOM
private AtomicInteger nextFreeOffset
private AtomicInteger allocCount
private final int size
HeapMemStoreLAB.Chunk(int size)
size
- in bytespublic void init()
void reset()
public int alloc(int size)
size
bytes from the chunk.int getNextFreeOffset()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.