Package-level declarations

Types

Link copied to clipboard

This exception is thrown when there is an attempt to access something that has already been closed.

Link copied to clipboard
abstract class BaseDirectory : Directory

Base implementation for a concrete Directory that uses a LockFactory for locking.

Link copied to clipboard
class BufferedChecksum @JvmOverloads constructor(in: Checksum, bufferSize: Int = DEFAULT_BUFFERSIZE) : Checksum

Wraps another Checksum with an internal buffer to speed up checksum calculations.

Link copied to clipboard

Simple implementation of ChecksumIndexInput that wraps another input and delegates calls.

Link copied to clipboard
abstract class BufferedIndexInput(resourceDesc: String, bufferSize: Int = BUFFER_SIZE) : IndexInput, RandomAccessInput

Base implementation class for buffered IndexInput.

Link copied to clipboard

DataInput backed by a byte array. WARNING: This class omits all low-level checks.

Link copied to clipboard

DataOutput backed by a byte array. WARNING: This class omits most low-level checks, so be sure to test heavily with assertions enabled.

Link copied to clipboard

A DataInput implementing RandomAccessInput and reading data from a list of [ ]s.

Link copied to clipboard
class ByteBuffersDataOutput @JvmOverloads constructor(minBitsPerBlock: Int = DEFAULT_MIN_BITS_PER_BLOCK, maxBitsPerBlock: Int = DEFAULT_MAX_BITS_PER_BLOCK, blockAllocate: (Int) -> ByteBuffer = ALLOCATE_BB_ON_HEAP, blockReuse: (ByteBuffer) -> Unit = NO_REUSE) : DataOutput, Accountable

A DataOutput storing data in a list of ByteBuffers.

Link copied to clipboard

A Directory storing files as lists of ByteBuffers in memory.

Link copied to clipboard
Link copied to clipboard
class ByteBuffersIndexOutput(delegate: ByteBuffersDataOutput, resourceDescription: String, name: String, checksum: Checksum, onClose: (ByteBuffersDataOutput) -> Unit?) : IndexOutput
Link copied to clipboard

Extension of IndexInput, computing checksum as it goes. Callers can retrieve the checksum via .getChecksum.

Link copied to clipboard
abstract class DataInput : Cloneable<DataInput>

Abstract base class for performing read operations of Lucene's low-level data types.

Link copied to clipboard
abstract class DataOutput

Abstract base class for performing write operations of Lucene's low-level data types.

Link copied to clipboard
abstract class Directory : AutoCloseable

A Directory provides an abstraction layer for storing a list of files. A directory contains only files (no sub-folder hierarchy).

Link copied to clipboard

Probe interface for tests that need to identify precise directory failure paths without relying on stack-trace inspection, which is very expensive on Kotlin/Native.

Link copied to clipboard
class FileSwitchDirectory(primaryExtensions: Set<String>, primaryDir: Directory, secondaryDir: Directory, doClose: Boolean) : Directory

Expert: A Directory instance that switches files between two other Directory instances.

Link copied to clipboard
abstract class FilterDirectory : Directory

Directory implementation that delegates calls to another directory. This class can be used to add limitations on top of an existing Directory implementation such as [ ] or to add additional sanity checks for tests. However, if you plan to write your own Directory implementation, you should consider extending directly [ ] or BaseDirectory rather than try to reuse functionality of existing [ ]s by extending this class.

Link copied to clipboard
open class FilterIndexInput(resourceDescription: String, in: IndexInput) : IndexInput

IndexInput implementation that delegates calls to another IndexInput. This class can be used to add limitations on top of an existing IndexInput implementation or to add additional sanity checks for tests. However, if you plan to write your own IndexInput implementation, you should consider extending directly IndexInput or DataInput rather than try to reuse functionality of existing IndexInputs by extending this class.

Link copied to clipboard

IndexOutput implementation that delegates calls to another directory. This class can be used to add limitations on top of an existing IndexOutput implementation such as [ ] or to add additional sanity checks for tests. However, if you plan to write your own IndexOutput implementation, you should consider extending directly [ ] or DataOutput rather than try to reuse functionality of existing [ ]s by extending this class.

Link copied to clipboard
data class FlushInfo(val numDocs: Int, val estimatedSegmentSize: Long)

A FlushInfo provides information required for a FLUSH context. It is used as part of an [ ] in case of FLUSH context.

Link copied to clipboard
abstract class FSDirectory : BaseDirectory

Base class for Directory implementations that store index files in the file system. There are currently two core subclasses:

Link copied to clipboard
abstract class FSLockFactory : LockFactory

Base class for file system based locking implementation. This class is explicitly checking that the passed Directory is an FSDirectory.

Link copied to clipboard

Abstract base class for input from a file in a Directory. A random-access input stream. Used for all Lucene index input operations.

Link copied to clipboard

A DataOutput for appending data to a file in a Directory.

Link copied to clipboard
Link copied to clipboard
class IOContext(context: IOContext.Context, mergeInfo: MergeInfo?, flushInfo: FlushInfo?, val readAdvice: ReadAdvice)

IOContext holds additional details on the merge/search context. An IOContext object can never be passed as a null parameter to either or

Link copied to clipboard
abstract class Lock : AutoCloseable

An interprocess mutex lock.

Link copied to clipboard
abstract class LockFactory

Base class for Locking implementation. Directory uses instances of this class to implement locking.

Link copied to clipboard
class LockObtainFailedException : IOException

This exception is thrown when the write.lock could not be acquired. This happens when a writer tries to open an index that another writer already has open.

Link copied to clipboard
class LockReleaseFailedException : IOException

This exception is thrown when the write.lock could not be released.

Link copied to clipboard

This class makes a best-effort check that a provided Lock is valid before any destructive filesystem operation.

Link copied to clipboard

Simple standalone server that must be running when you use VerifyingLockFactory. This server simply verifies at most one process holds the lock at a time. Run without any args to see usage.

Link copied to clipboard
data class MergeInfo(val totalMaxDoc: Int, val estimatedMergeBytes: Long, val isExternal: Boolean, val mergeMaxNumSegments: Int)

A MergeInfo provides information required for a MERGE context. It is used as part of an [ ] in case of MERGE context.

Link copied to clipboard
class MMapDirectory(path: Path, lockFactory: LockFactory = FSLockFactory.default, maxChunkSize: Long = DEFAULT_MAX_CHUNK_SIZE) : FSDirectory

File-based Directory implementation that uses mmap for reading, and [ ] for writing.

Link copied to clipboard
class NativeFSLockFactory(val fs: FileSystem = FileSystem.SYSTEM) : FSLockFactory

Implements LockFactory using native OS file locks. Note that because this LockFactory relies on java.nio.* APIs for locking, any problems with those APIs will cause locking to fail. Specifically, on certain NFS environments the java.nio.* locks will fail (the lock can incorrectly be double acquired) whereas SimpleFSLockFactory worked perfectly in those same environments. For NFS based access to an index, it's recommended that you try [ ] first and work around the one limitation that a lock file could be left when the JVM exits abnormally.

Link copied to clipboard
class NIOFSDirectory(path: Path, lockFactory: LockFactory = FSLockFactory.default) : FSDirectory

An FSDirectory implementation that uses java.nio's FileChannel's positional read, which allows multiple threads to read from the same file without synchronizing.

Link copied to clipboard

Use this LockFactory to disable locking entirely. This is a singleton, you have to use INSTANCE.

Link copied to clipboard
open class NRTCachingDirectory(delegate: Directory, maxMergeSizeMB: Double, maxCachedMB: Double) : FilterDirectory, Accountable

Wraps a RAM-resident directory around any provided delegate directory, to be used during NRT search.

Link copied to clipboard
open class OutputStreamIndexOutput(resourceDescription: String, name: String, out: OutputStream, bufferSize: Int) : IndexOutput

Implementation class for buffered IndexOutput that writes to an OutputStream.

Link copied to clipboard

Random Access Index API. Unlike IndexInput, this has no concept of file position, all reads are absolute. However, like IndexInput, it is only intended for use by a single thread.

Link copied to clipboard
abstract class RateLimiter

Abstract base class to rate limit IO. Typically implementations are shared across multiple IndexInputs or IndexOutputs (for example those involved all merging). Those IndexInputs and IndexOutputs would call .pause whenever the have read or written more than .getMinPauseCheckBytes bytes.

Link copied to clipboard

Advice regarding the read access pattern.

Link copied to clipboard
Link copied to clipboard

Implements a LockFactory that provides locks scoped to a single JVM.

Link copied to clipboard

Directory that wraps another, and that sleeps and retries if obtaining the lock fails.

Link copied to clipboard

A delegating Directory that records which files were written to and deleted.