Package org.apache.lucene.util
package org.apache.lucene.util
Some utility classes.
-
ClassDescriptionAn object whose RAM usage can be computed.Helper methods for constructing nested resource descriptions and debugging RAM usage.Methods for manipulating arrays.Comparator for a fixed number of bytes.Base interface for attributes.An AttributeFactory creates instances of
AttributeImpl
s.Expert: AttributeFactory returning an instance of the givenclazz
for the attributes it implements.Base class for Attributes that can be added to aAttributeSource
.This interface is used to reflect contents ofAttributeSource
orAttributeImpl
.An AttributeSource contains a list of differentAttributeImpl
s, and methods to add and get them.This class holds the state of an AttributeSource.Interface for Bitset-like structures.Bits impl of the specified length with all bits set.Bits impl of the specified length with no bits set.Base implementation for a bit set.ADocIdSetIterator
which iterates over set bits in a bit set.A variety of high efficiency bit twiddling routines and encoders for primitives.Class that Posting and PostingVector use to write byte streams into shared fixed-size byte[] arrays.Abstract class for allocating and freeing byte blocks.A simpleByteBlockPool.Allocator
that never recycles.A simpleByteBlockPool.Allocator
that never recycles, but tracks how much total RAM is in use.Represents byte[], as a slice (offset + length) into an existing byte[].A simple append only random-accessBytesRef
array that stores full copies of the appended bytes in aByteBlockPool
.An extension ofBytesRefIterator
that allows retrieving the index of the current elementUsed to iterate the elements of an array in a given order.A builder forBytesRef
instances.SpecializedBytesRef
comparator thatSortableBytesRefArray.iterator(Comparator)
has optimizations for.BytesRefHash
is a special purpose hash-map like data-structure optimized forBytesRef
instances.Manages allocation of the per-term addresses.A simpleBytesRefHash.BytesStartArray
that tracks memory allocation using a privateCounter
instance.A simple iterator interface forBytesRef
iteration.Represents char[], as a slice (offset + length) into an existing char[].A builder forCharsRef
instances.Helper class used by ServiceLoader to investigate parent/child relationships ofClassLoader
s.SimpleResourceLoader
that usesClassLoader.getResourceAsStream(String)
andClass.forName(String,boolean,ClassLoader)
to open resources and classes, respectively.Java's builtin ThreadLocal has a serious flaw: it can take an arbitrarily long amount of time to dereference the things you had stored in it, even once the ThreadLocal instance itself is no longer referenced.Methods for manipulating (sorting) collections.Class containing some useful methods used by command line toolsSome useful constants.Simple counter classADocIdSetIterator
likeBitSetIterator
but has a doc base in onder to avoid storing previous 0s.A builder ofDocIdSet
s.Utility class to efficiently add many docs in one go.FilterIterator<T,InnerT extends T> AnIterator
implementation that filters elements with a boolean predicate.BitSet of fixed length (numBits), backed by accessible (FixedBitSet.getBits()
) long[], accessed with an int index, implementingBits
andDocIdSet
.A ring buffer that tracks the frequency of the integers that it contains.Annotation to not test a class or constructor withTestRandomChains
integration test.Debugging API for Lucene classes such asIndexWriter
andSegmentInfos
.Sorter
implementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated).A pool for int blocks similar toByteBlockPool
Abstract class for allocating and freeing int blocks.A simpleIntBlockPool.Allocator
that never recycles.AIntBlockPool.SliceReader
that can read int slices written by aIntBlockPool.SliceWriter
AIntBlockPool.SliceWriter
that allows to write multiple integer slices into a givenIntBlockPool
.Adaptive selection algorithm based on the introspective quick select algorithm.Represents int[], as a slice (offset + length) into an existing int[].A builder forIntsRef
instances.IOConsumer<T>An IO operation with a single input that may throw an IOException.IOFunction<T,R> A Function that may throw an IOExceptionIOSupplier<T>This is a result supplier that is allowed to throw an IOException.Utilities for dealing withCloseable
s.Deprecated, for removal: This API element is subject to removal in a future version.IOUtils.IOFunction<T,R> Deprecated, for removal: This API element is subject to removal in a future version.was replaced byIOFunction
.InfoStream implementation that logs every message using Java Utils Logging (JUL) with the supplied log level.BitSet of fixed length (numBits), backed by accessible (LongBitSet.getBits()
) long[], accessed with a long index.A min heap that stores longs; a primitive priority queue that like all priority queues maintains a partial ordering of its elements such that the least element can always be found in constant time.Represents long[], as a slice (offset + length) into an existing long[].Abstraction over an array of longs.A LSB Radix sorter for unsigned int values.MapOfSets<K,V> Helper class for keeping Lists of Objects associated with keys.Math static utility methods.MergedIterator<T extends Comparable<T>>Provides a merged sorted view from several sorted iterators.SimpleResourceLoader
that usesModule.getResourceAsStream(String)
andClass.forName(Module,String)
to open resources and classes, respectively.Radix sorter for variable-length strings.NamedSPILoader<S extends NamedSPILoader.NamedSPI>Helper class for loading named SPIs from classpath (e.g.Interface to supportNamedSPILoader.lookup(String)
by name.A defaultThreadFactory
implementation that accepts the name prefix of the created threads as a constructor argument.Helper APIs to encode numeric values as sortable bytes and vice-versa.On-disk sorting of byte arrays.A bit more descriptive unit for constructors.Utility class to read length-prefixed byte[] entries from an input.Utility class to emit length-prefixed byte[] entries to an output stream for sorting.Represents a logical byte[] as a series of pages.Provides methods to read BytesRefs from a frozen PagedBytes.InfoStream implementation over aPrintStream
such asSystem.out
.A priority queue maintains a partial ordering of its elements such that the least element can always be found in constant time.Creates queries from theAnalyzer
chain.Wraps a term and boostRadix selector.Estimates the size (memory representation) of Java objects.AByteBlockPool.Allocator
implementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls toRecyclingByteBlockAllocator.getByteBlock()
.AIntBlockPool.Allocator
implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls toRecyclingIntBlockAllocator.getIntBlock()
.RefCount<T>Manages reference counting for a given object.Abstraction for loading resources (streams, files, and classes).Interface for a component that needs to be initialized by an implementation ofResourceLoader
.DocIdSet
implementation inspired from http://roaringbitmap.org/A builder ofRoaringDocIdSet
s.RollingBuffer<T extends RollingBuffer.Resettable>Acts like forever growing T[], but internally uses a circular buffer to reuse instances of T.Implement to reset an instanceAnExecutorService
that executes tasks immediately in the calling thread during submit.An implementation of a selection algorithm, ie.A native int hash-based set where one value is reserved to mean "EMPTY" internally.SetOnce<T>A convenient class which offers a semi-immutable object wrapper implementation which allows one to set the value of an object exactly once, and retrieve it many times.Thrown whenSetOnce.set(Object)
is called more than once.Math functions that trade off accuracy for speed.Floating point numbers smaller than 32 bits.Base class for sorting algorithms implementations.A bit set that only stores longs that have at least one bit which is set.Stable radix sorter for variable-length strings.Methods for manipulating strings.Annotation to suppress forbidden-apis errors inside a whole class, a method, or a field.Thrown by lucene on detecting that Thread.interrupt() had been called.Helper methods to ease implementingObject.toString()
.Class to encode java's UTF16 char[] into UTF8 byte[] without always allocating a new byte[] as String.getBytes(StandardCharsets.UTF_8) does.Unwrappable<T>An object with this interface is a wrapper around another object (e.g., a filter with a delegate).Utilities for computations with numeric arraysUse by certain classes to match version compatibility across releases of Lucene.A utility for keeping backwards compatibility on previously abstract methods (or similar replacements).WeakIdentityMap<K,V> Implements a combination ofWeakHashMap
andIdentityHashMap
.
IOConsumer
.