@InterfaceAudience.Private public class ChunkCreator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ChunkCreator.ChunkType
Types of chunks, based on their sizes
|
private class |
ChunkCreator.MemStoreChunkPool
A pool of
Chunk instances. |
Modifier and Type | Field and Description |
---|---|
private AtomicInteger |
chunkID |
private Map<Integer,Chunk> |
chunkIdMap |
(package private) static boolean |
chunkPoolDisabled |
private int |
chunkSize |
private ChunkCreator.MemStoreChunkPool |
dataChunksPool |
private ChunkCreator.MemStoreChunkPool |
indexChunksPool |
(package private) static ChunkCreator |
instance |
private static org.slf4j.Logger |
LOG |
private boolean |
offheap |
static int |
SIZEOF_CHUNK_HEADER |
Constructor and Description |
---|
ChunkCreator(int chunkSize,
boolean offheap,
long globalMemStoreSize,
float poolSizePercentage,
float initialCountPercentage,
HeapMemoryManager heapMemoryManager,
float indexChunkSizePercentage) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
clearChunkIds() |
(package private) void |
clearChunksInPool() |
(package private) static void |
clearDisableFlag() |
private Chunk |
createChunk(boolean pool,
CompactingMemStore.IndexType chunkIndexType,
int size)
Creates the chunk either onheap or offheap
|
private Chunk |
createChunkForPool(CompactingMemStore.IndexType chunkIndexType,
int chunkSize) |
(package private) Chunk |
getChunk()
Creates and inits a chunk.
|
(package private) Chunk |
getChunk(ChunkCreator.ChunkType chunkType)
Creates and inits a chunk.
|
(package private) Chunk |
getChunk(CompactingMemStore.IndexType chunkIndexType)
Creates and inits a chunk.
|
(package private) Chunk |
getChunk(CompactingMemStore.IndexType chunkIndexType,
ChunkCreator.ChunkType chunkType)
Creates and inits a chunk with specific index type and type.
|
(package private) Chunk |
getChunk(CompactingMemStore.IndexType chunkIndexType,
int size)
Creates and inits a chunk.
|
(package private) Chunk |
getChunk(int id) |
(package private) int |
getChunkSize() |
(package private) int |
getChunkSize(ChunkCreator.ChunkType chunkType) |
static ChunkCreator |
getInstance() |
(package private) Chunk |
getJumboChunk(int jumboSize)
Creates and inits a chunk of a special size, bigger than a regular chunk size.
|
(package private) int |
getMaxCount() |
(package private) int |
getMaxCount(ChunkCreator.ChunkType chunkType) |
(package private) int |
getPoolSize() |
(package private) int |
getPoolSize(ChunkCreator.ChunkType chunkType) |
static ChunkCreator |
initialize(int chunkSize,
boolean offheap,
long globalMemStoreSize,
float poolSizePercentage,
float initialCountPercentage,
HeapMemoryManager heapMemoryManager)
Initializes the instance of ChunkCreator
|
private ChunkCreator.MemStoreChunkPool |
initializePool(String label,
long globalMemStoreSize,
float poolSizePercentage,
float initialCountPercentage,
int chunkSize,
HeapMemoryManager heapMemoryManager) |
private void |
initializePools(int chunkSize,
long globalMemStoreSize,
float poolSizePercentage,
float indexChunkSizePercentage,
float initialCountPercentage,
HeapMemoryManager heapMemoryManager) |
(package private) boolean |
isChunkInPool(int chunkId) |
(package private) boolean |
isOffheap() |
(package private) int |
numberOfMappedChunks() |
(package private) void |
putbackChunks(Set<Integer> chunks) |
(package private) Chunk |
removeChunk(int chunkId) |
private void |
removeChunks(Set<Integer> chunkIDs) |
private static final org.slf4j.Logger LOG
private AtomicInteger chunkID
public static final int SIZEOF_CHUNK_HEADER
private Map<Integer,Chunk> chunkIdMap
private final boolean offheap
static ChunkCreator instance
static boolean chunkPoolDisabled
private ChunkCreator.MemStoreChunkPool dataChunksPool
private int chunkSize
private ChunkCreator.MemStoreChunkPool indexChunksPool
ChunkCreator(int chunkSize, boolean offheap, long globalMemStoreSize, float poolSizePercentage, float initialCountPercentage, HeapMemoryManager heapMemoryManager, float indexChunkSizePercentage)
private void initializePools(int chunkSize, long globalMemStoreSize, float poolSizePercentage, float indexChunkSizePercentage, float initialCountPercentage, HeapMemoryManager heapMemoryManager)
public static ChunkCreator initialize(int chunkSize, boolean offheap, long globalMemStoreSize, float poolSizePercentage, float initialCountPercentage, HeapMemoryManager heapMemoryManager)
chunkSize
- the chunkSizeoffheap
- indicates if the chunk is to be created offheap or notglobalMemStoreSize
- the global memstore sizepoolSizePercentage
- pool size percentageinitialCountPercentage
- the initial count of the chunk pool if anyheapMemoryManager
- the heapmemory managerpublic static ChunkCreator getInstance()
Chunk getChunk(ChunkCreator.ChunkType chunkType)
Chunk getChunk()
Chunk getChunk(CompactingMemStore.IndexType chunkIndexType)
Chunk getChunk(CompactingMemStore.IndexType chunkIndexType, ChunkCreator.ChunkType chunkType)
Chunk getChunk(CompactingMemStore.IndexType chunkIndexType, int size)
chunkIndexType
- whether the requested chunk is going to be used with CellChunkMap indexsize
- the size of the chunk to be allocated, in bytesChunk getJumboChunk(int jumboSize)
jumboSize
- the special size to be usedprivate Chunk createChunk(boolean pool, CompactingMemStore.IndexType chunkIndexType, int size)
pool
- indicates if the chunks have to be created which will be used by the PoolchunkIndexType
- whether the requested chunk is going to be used with CellChunkMap indexsize
- the size of the chunk to be allocated, in bytesprivate Chunk createChunkForPool(CompactingMemStore.IndexType chunkIndexType, int chunkSize)
boolean isOffheap()
private void removeChunks(Set<Integer> chunkIDs)
Chunk removeChunk(int chunkId)
int numberOfMappedChunks()
void clearChunkIds()
static void clearDisableFlag()
private ChunkCreator.MemStoreChunkPool initializePool(String label, long globalMemStoreSize, float poolSizePercentage, float initialCountPercentage, int chunkSize, HeapMemoryManager heapMemoryManager)
int getMaxCount()
int getMaxCount(ChunkCreator.ChunkType chunkType)
int getPoolSize()
int getPoolSize(ChunkCreator.ChunkType chunkType)
boolean isChunkInPool(int chunkId)
void clearChunksInPool()
int getChunkSize()
int getChunkSize(ChunkCreator.ChunkType chunkType)
void putbackChunks(Set<Integer> chunks)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.