@Override public long getVersion() { return in.getVersion(); }
public SearcherTracker(IndexSearcher searcher) { this.searcher = searcher; version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); searcher.getIndexReader().incRef(); // Use nanoTime not currentTimeMillis since it [in // theory] reduces risk from clock shift recordTimeSec = System.nanoTime() / NANOS_PER_SEC; }
final long version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); SearcherTracker tracker = searchers.get(version); if (tracker == null) {
private DirectoryReader doOpenFromWriter(IndexCommit commit) throws IOException { if (commit != null) { return doOpenFromCommit(commit); } if (writer.nrtIsCurrent(segmentInfos)) { return null; } DirectoryReader reader = writer.getReader(applyAllDeletes, writeAllDeletes); // If in fact no changes took place, return null: if (reader.getVersion() == segmentInfos.getVersion()) { reader.decRef(); return null; } return reader; }
infoStream.message("IW", "return reader version=" + r.getVersion() + " reader=" + r);
result.put("version", reader.getVersion()); result.put("ref_count", reader.getRefCount());
@Override public long getVersion() { return in.getVersion(); }
@Override public long getVersion() { return in.getVersion(); }
@Override public long getVersion() { return in.getVersion(); }
static long getVersion(IndexSearcher indexSearcher) { IndexReader reader = indexSearcher.getIndexReader(); if (reader instanceof DirectoryReader) { return ((DirectoryReader) reader).getVersion(); } return -1; }
static long getVersion(IndexSearcher indexSearcher) { IndexReader reader = indexSearcher.getIndexReader(); if (reader instanceof DirectoryReader) { return ((DirectoryReader) reader).getVersion(); } return -1; }
private long getIndexVersion(SolrIndexSearcher searcher){ return searcher.getIndexReader().getVersion(); }
public TaggerFstCorpus run() throws IOException { return new TaggerFstCorpus(reader, searcher.getIndexReader().getVersion(), null, fstInfo.indexedField, fstInfo.storedField, fstInfo.analyzer, fstInfo.partialMatches,1,100); } });
public Skywalker(IndexReader reader) { this.reader = reader; this.dirImpl = "N/A"; this.version = "-1"; this.formatDetails = new FormatDetails("N/A", "N/A", "N/A"); Directory dir = null; if (reader instanceof DirectoryReader) { dir = ((DirectoryReader) reader).directory(); this.dirImpl = dir.getClass().getName(); this.version = Long.toString(((DirectoryReader) reader).getVersion()); this.formatDetails = getIndexFormat(dir); } }
/** * Invalidates the given the cache entry for the given key and it's context * @param cacheEntity the cache entity to invalidate for * @param reader the reader to invalidate the cache entry for * @param cacheKey the cache key to invalidate */ void invalidate(CacheEntity cacheEntity, DirectoryReader reader, BytesReference cacheKey) { cache.invalidate(new Key(cacheEntity, reader.getVersion(), cacheKey)); }
public SearcherTracker(IndexSearcher searcher) { this.searcher = searcher; version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); searcher.getIndexReader().incRef(); // Use nanoTime not currentTimeMillis since it [in // theory] reduces risk from clock shift recordTimeSec = System.nanoTime() / NANOS_PER_SEC; }
public SearcherTracker(IndexSearcher searcher) { this.searcher = searcher; version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); searcher.getIndexReader().incRef(); // Use nanoTime not currentTimeMillis since it [in // theory] reduces risk from clock shift recordTimeSec = System.nanoTime() / NANOS_PER_SEC; }
public SearcherTracker(IndexSearcher searcher) { this.searcher = searcher; version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); searcher.getIndexReader().incRef(); // Use nanoTime not currentTimeMillis since it [in // theory] reduces risk from clock shift recordTimeSec = System.nanoTime() / NANOS_PER_SEC; }
private static Key buildKey(ShardSearchRequest request, SearchContext context) throws Exception { // TODO: for now, this will create different keys for different JSON order // TODO: tricky to get around this, need to parse and order all, which can be expensive return new Key(context.indexShard(), ((DirectoryReader) context.searcher().getIndexReader()).getVersion(), request.cacheKey()); } }
private DirectoryReader doOpenFromWriter(IndexCommit commit) throws IOException { if (commit != null) { return doOpenFromCommit(commit); } if (writer.nrtIsCurrent(segmentInfos)) { return null; } DirectoryReader reader = writer.getReader(applyAllDeletes, writeAllDeletes); // If in fact no changes took place, return null: if (reader.getVersion() == segmentInfos.getVersion()) { reader.decRef(); return null; } return reader; }