public final class ElasticsearchDirectoryReader
extends org.apache.lucene.index.FilterDirectoryReader
FilterDirectoryReader
that exposes
Elasticsearch internal per shard / index information like the shard ID.Modifier and Type | Method and Description |
---|---|
static void |
addReaderCloseListener(org.apache.lucene.index.DirectoryReader reader,
org.apache.lucene.index.IndexReader.ReaderClosedListener listener)
Adds the given listener to the provided directory reader.
|
protected org.apache.lucene.index.DirectoryReader |
doWrapDirectoryReader(org.apache.lucene.index.DirectoryReader in) |
static ElasticsearchDirectoryReader |
getElasticsearchDirectoryReader(org.apache.lucene.index.DirectoryReader reader)
Tries to unwrap the given reader until the first
ElasticsearchDirectoryReader instance is found or null if no instance is found; |
ShardId |
shardId()
Returns the shard id this index belongs to.
|
static ElasticsearchDirectoryReader |
wrap(org.apache.lucene.index.DirectoryReader reader,
ShardId shardId)
Wraps the given reader in a
ElasticsearchDirectoryReader as
well as all it's sub-readers in ElasticsearchLeafReader to
expose the given shard Id. |
doClose, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, getDelegate, getIndexCommit, getVersion, isCurrent, unwrap
directory, indexExists, listCommits, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged
docFreq, document, getDocCount, getSequentialSubReaders, getSumDocFreq, getSumTotalTermFreq, getTermVectors, maxDoc, numDocs, readerBase, readerIndex, totalTermFreq
addReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getCombinedCoreAndDeletesKey, getCoreCacheKey, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, removeReaderClosedListener, tryIncRef
public ShardId shardId()
protected org.apache.lucene.index.DirectoryReader doWrapDirectoryReader(org.apache.lucene.index.DirectoryReader in) throws java.io.IOException
doWrapDirectoryReader
in class org.apache.lucene.index.FilterDirectoryReader
java.io.IOException
public static ElasticsearchDirectoryReader wrap(org.apache.lucene.index.DirectoryReader reader, ShardId shardId) throws java.io.IOException
ElasticsearchDirectoryReader
as
well as all it's sub-readers in ElasticsearchLeafReader
to
expose the given shard Id.reader
- the reader to wrapshardId
- the shard ID to expose via the elasticsearch internal reader wrappers.java.io.IOException
public static void addReaderCloseListener(org.apache.lucene.index.DirectoryReader reader, org.apache.lucene.index.IndexReader.ReaderClosedListener listener)
ElasticsearchDirectoryReader
in it's hierarchy
otherwise we can't safely install the listener.java.lang.IllegalArgumentException
- if the reader doesn't contain an ElasticsearchDirectoryReader
in it's hierarchypublic static ElasticsearchDirectoryReader getElasticsearchDirectoryReader(org.apache.lucene.index.DirectoryReader reader)
ElasticsearchDirectoryReader
instance is found or null
if no instance is found;