Package-level declarations
Types
An object whose RAM usage can be computed.
Helper methods for constructing nested resource descriptions and debugging RAM usage.
Base class for Attributes that can be added to a org.gnit.lucenekmp.util.AttributeSource.
This interface is used to reflect contents of AttributeSource or AttributeImpl.
An AttributeSource contains a list of different AttributeImpls, and methods to add and get them. There can only be a single instance of an attribute in the same AttributeSource instance. This is ensured by passing in the actual type of the Attribute (Class
Base implementation for a bit set.
A DocIdSetIterator which iterates over set bits in a bit set.
This class enables the allocation of fixed-size buffers and their management as part of a buffer array. Allocation is done through the use of an Allocator which can be customized, e.g. to allow recycling old buffers. There are methods for writing (.append and reading from the buffers (e.g. .readBytes, which handle read/write operations across buffer boundaries.
Represents byte[], as a slice (offset + length) into an existing byte[]. The bytes property should never be null; use EMPTY_BYTES if necessary.
A simple append only random-access BytesRef array that stores full copies of the appended bytes in a ByteBlockPool.
Represents a logical list of ByteRef backed by a ByteBlockPool. It uses up to two bytes to record the length of the BytesRef followed by the actual bytes. They can be read using the start position returned when they are appended.
A builder for BytesRef instances.
Specialized BytesRef comparator that StringSorter has optimizations for.
BytesRefHash is a special purpose hash-map like data-structure optimized for [ ] instances. BytesRefHash maintains mappings of byte arrays to ids (Map
A simple iterator interface for BytesRef iteration.
Represents char[], as a slice (offset + length) into an existing char[]. The {@link #chars} member should never be null; use {@link #EMPTY_CHARS} if necessary.
A builder for CharsRef instances.
No-op classloader for Kotlin Multiplatform is used.
Simple ResourceLoader that resolves resources from the filesystem.
Thread-local storage with a close hook to release references.
Methods for manipulating (sorting) and creating collections. Sort methods work directly on the supplied lists and don't copy to/from arrays before/after. For medium size collections as used in the Lucene indexer that is much more efficient.
Class containing some useful methods used by command line tools
A DocIdSetIterator like BitSetIterator but has a doc base in order to avoid storing previous 0s.
A builder of DocIdSets. At first it uses a sparse structure to gather documents, and then upgrades to a non-sparse bit set once enough hits match.
This class provides ability to track the reference counts of a set of index files and delete them when their counts decreased to 0.
An Iterator implementation that filters elements with a boolean predicate.
BitSet of fixed length (numBits), backed by accessible (.getBits) long[], accessed with an int index, implementing Bits and DocIdSet. If you need to manage more than 2.1B bits, use LongBitSet.
A ring buffer that tracks the frequency of the integers that it contains. This is typically useful to track the hash codes of popular recently-used items.
This class contains utility methods and constants for group varint
Debugging API for Lucene classes such as IndexWriter and SegmentInfos.
Sorter implementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated). Small arrays are sorted with binary sort.
A pool for int blocks similar to ByteBlockPool
Adaptive selection algorithm based on the introspective quick select algorithm. The quick select algorithm uses an interpolation variant of Tukey's ninther median-of-medians for pivot, and Bentley-McIlroy 3-way partitioning. For the introspective protection, it shuffles the sub-range if the max recursive depth is exceeded.
Sorter implementation based on a variant of the quicksort algorithm called introsort: when the recursion level exceeds the log of the length of the array to sort, it falls back to heapsort. This prevents quicksort from running into its worst-case quadratic runtime. Selects the pivot using Tukey's ninther median-of-medians, and partitions using Bentley-McIlroy 3-way partitioning. Small ranges are sorted with insertion sort.
A builder for IntsRef instances.
Boolean supplier that is allowed to throw an IOException.
An I/O operation with a single input that can throw an IOException. (Functional interface)
A Function that may throw an IOException (functional interface).
A Runnable that may throw an IOException
This is a result supplier that is allowed to throw an IOException.
BitSet of fixed length (numBits), backed by accessible (.getBits) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
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. Put()'s and pop()'s require log(size). This heap provides unbounded growth via .push, and bounded-size insertion based on its nominal maxSize via .insertWithOverflow. The heap is a min heap, meaning that the top element is the lowest value of the heap.
Abstraction over an array of longs.
A LSB Radix sorter for unsigned int values.
Provides a merged sorted view from several sorted iterators.
Radix sorter for variable-length strings. This class sorts based on the most significant byte first and falls back to IntroSorter when the size of the buckets to sort becomes small.
Helper class for loading named SPIs from classpath (e.g. Codec, PostingsFormat).
A default ThreadFactory implementation that accepts the name prefix of the created threads as a constructor argument. Otherwise, this factory yields the same semantics as the thread factory returned by Executors.defaultThreadFactory.
Low-overhead crash probe for kotlin/native fatal-signal diagnostics.
Helper APIs to encode numeric values as sortable bytes and vice-versa.
On-disk sorting of byte arrays.
Represents a logical byte[] as a series of pages. You can write-once into the logical byte[] (append only), using copy, and then retrieve slices (BytesRef) into it using fill.
InfoStream implementation over a PrintStream such as System.out.
Creates queries from the Analyzer chain.
Radix selector.
Estimates the size (memory representation) of Java objects.
Simplified version of Lucene's RamUsageTester.
A ByteBlockPool.Allocator implementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls to .byteBlock.
A IntBlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to .intBlock.
Abstraction for loading resources (streams, files, and classes).
Implemented by analysis factories that need access to external resources.
DocIdSet implementation inspired from http://roaringbitmap.org/
Simplified port of Lucene's RollingBuffer. Acts like a growable T[] with reuse of instances.
An ExecutorService that executes tasks immediately in the calling thread during submit.
A native int hash-based set where one value is reserved to mean "EMPTY" internally. The space overhead is fairly low as there is only one power-of-two sized int[] to hold the values. The set is re-hashed when adding a value that would make it >= 75% full. Consider extending and over-riding hash if the values might be poor hash keys; Lucene docids should be fine. The internal fields are exposed publicly to enable more efficient use at the expense of better O-O principles.
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. If .set is called more than once, AlreadySetException is thrown and the operation will fail.
Math functions that trade off accuracy for speed.
Floating point numbers smaller than 32 bits.
A bit set that only stores longs that have at least one bit which is set. The way it works is that the space of bits is divided into blocks of 4096 bits, which is 64 longs. Then for each block, we have:
Stable radix sorter for variable-length strings.
Methods for manipulating strings.
A BytesRef sorter tries to use a efficient radix sorter if StringSorter.cmp is a BytesRefComparator, otherwise fallback to StringSorter.fallbackSorter
Thrown by lucene on detecting that Thread.interrupt() had been called. Unlike Java's InterruptedException, this exception is not checked..
Helper methods to ease implementing Object.toString.
Class to encode java's UTF16 char[] into UTF8 byte[] without always allocating a new byte[] as String.getBytes(StandardCharsets.UTF_8) does.
An object with this interface is a wrapper around another object (e.g., a filter with a delegate). The method .unwrap can be called to get the wrapped object
Utilities for computations with numeric arrays, especially algebraic operations like vector dot products. This class uses SIMD vectorization if the corresponding Java module is available and enabled. To enable vectorized code, pass --add-modules jdk.incubator.vector to Java's command line.
Functions
Returns a sequence of Unicode code point values from this string.
Reads 2 bytes from this ByteArray in big-endian order, starting at offset, and returns the result as a Short.
Reads 2 bytes in little-endian order from this ByteArray starting at the given offset.
Writes a 16-bit short into the byte array at the given offset in little-endian order.