[BUILD] Remember to use AtomicReader.addCoreClosedListener when upgrading to Lucene 4.9.
This commit is contained in:
parent
e97a381db2
commit
be29138962
|
@ -21,6 +21,7 @@ package org.elasticsearch.common.lucene;
|
|||
import org.apache.lucene.index.AtomicReader;
|
||||
import org.apache.lucene.index.FilterAtomicReader;
|
||||
import org.apache.lucene.index.SegmentReader;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.elasticsearch.ElasticsearchIllegalStateException;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
|
||||
|
@ -44,6 +45,10 @@ public class SegmentReaderUtils {
|
|||
return internalSegmentReader(reader, false);
|
||||
}
|
||||
|
||||
static {
|
||||
assert Version.LUCENE_48.onOrAfter(Lucene.VERSION) : "Use AtomicReader.addCoreClosedListener instead of trying to unwrap the atomic reader: https://issues.apache.org/jira/browse/LUCENE-5701";
|
||||
}
|
||||
|
||||
public static boolean registerCoreListener(AtomicReader reader, SegmentReader.CoreClosedListener listener) {
|
||||
SegmentReader segReader = SegmentReaderUtils.segmentReaderOrNull(reader);
|
||||
if (segReader != null) {
|
||||
|
|
Loading…
Reference in New Issue