List of usage examples for org.apache.lucene.index LeafReader getCoreCacheHelper
public abstract CacheHelper getCoreCacheHelper();
From source file:org.elasticsearch.common.lucene.uid.PerThreadIDVersionAndSeqNoLookup.java
License:Apache License
/** * Initialize lookup for the provided segment *//*from w ww .j a v a 2s. c o m*/ PerThreadIDVersionAndSeqNoLookup(LeafReader reader, String uidField) throws IOException { this.uidField = uidField; Terms terms = reader.terms(uidField); if (terms == null) { throw new IllegalArgumentException("reader misses the [" + uidField + "] field"); } termsEnum = terms.iterator(); if (reader.getNumericDocValues(VersionFieldMapper.NAME) == null) { throw new IllegalArgumentException("reader misses the [" + VersionFieldMapper.NAME + "] field"); } Object readerKey = null; assert (readerKey = reader.getCoreCacheHelper().getKey()) != null; this.readerKey = readerKey; }