Module org.apache.lucene.memory
Package org.apache.lucene.index.memory
Class MemoryIndex.SlicedIntBlockPool
java.lang.Object
org.apache.lucene.util.IntBlockPool
org.apache.lucene.index.memory.MemoryIndex.SlicedIntBlockPool
- Enclosing class:
- MemoryIndex
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
AMemoryIndex.SlicedIntBlockPool.SliceReader
that can read int slices written by aMemoryIndex.SlicedIntBlockPool.SliceWriter
(package private) static class
AMemoryIndex.SlicedIntBlockPool.SliceWriter
that allows to write multiple integer slices into a givenIntBlockPool
.Nested classes/interfaces inherited from class org.apache.lucene.util.IntBlockPool
IntBlockPool.Allocator, IntBlockPool.DirectAllocator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
The first level size for new slicesprivate static final int[]
An array holding the level sizes for int slices.private static final int[]
An array holding the offset into theLEVEL_SIZE_ARRAY
to quickly navigate to the next slice level.Fields inherited from class org.apache.lucene.util.IntBlockPool
buffer, buffers, INT_BLOCK_MASK, INT_BLOCK_SHIFT, INT_BLOCK_SIZE, intOffset, intUpto
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
allocSlice
(int[] slice, int sliceOffset) Allocates a new slice from the given offsetprivate static boolean
assertSliceBuffer
(int[] buffer) private int
newSlice
(int size) Creates a new int slice with the given starting size and returns the slices offset in the pool.Methods inherited from class org.apache.lucene.util.IntBlockPool
nextBuffer, reset
-
Field Details
-
NEXT_LEVEL_ARRAY
private static final int[] NEXT_LEVEL_ARRAYAn array holding the offset into theLEVEL_SIZE_ARRAY
to quickly navigate to the next slice level. -
LEVEL_SIZE_ARRAY
private static final int[] LEVEL_SIZE_ARRAYAn array holding the level sizes for int slices. -
FIRST_LEVEL_SIZE
private static final int FIRST_LEVEL_SIZEThe first level size for new slices
-
-
Constructor Details
-
SlicedIntBlockPool
SlicedIntBlockPool(IntBlockPool.Allocator allocator)
-
-
Method Details
-
newSlice
private int newSlice(int size) Creates a new int slice with the given starting size and returns the slices offset in the pool. -
assertSliceBuffer
private static boolean assertSliceBuffer(int[] buffer) -
allocSlice
private int allocSlice(int[] slice, int sliceOffset) Allocates a new slice from the given offset
-