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 classAMemoryIndex.SlicedIntBlockPool.SliceReaderthat can read int slices written by aMemoryIndex.SlicedIntBlockPool.SliceWriter(package private) static classAMemoryIndex.SlicedIntBlockPool.SliceWriterthat 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 intThe 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_ARRAYto 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 intallocSlice(int[] slice, int sliceOffset) Allocates a new slice from the given offsetprivate static booleanassertSliceBuffer(int[] buffer) For slices, buffers must be filled with zeros, so that we can find a slice's end based on a non-zero final value.private intnewSlice(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_ARRAYto 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
-
assertSliceBuffer
private static boolean assertSliceBuffer(int[] buffer) For slices, buffers must be filled with zeros, so that we can find a slice's end based on a non-zero final value. -
newSlice
private int newSlice(int size) Creates a new int slice with the given starting size and returns the slices offset in the pool.- See Also:
-
allocSlice
private int allocSlice(int[] slice, int sliceOffset) Allocates a new slice from the given offset
-