@Override protected void decRef(DirectoryReader reference) throws IOException { reference.decRef(); }
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; }
public synchronized DirectoryReader borrowReader(final boolean staleOk) throws IOException, JSONException { blockForLatest(staleOk); if (reader == null) { etag = newEtag(); } if (reader != null) { reader.decRef(); } reader = DirectoryReader.open(writer, !staleOk, false); if (readerDirty) { etag = newEtag(); readerDirty = false; } reader.incRef(); return reader; }
@Override protected void decRef(DirectoryReader reference) throws IOException { reference.decRef(); }
@Override protected void decRef(DirectoryReader reference) throws IOException { reference.decRef(); }
@Override protected void decRef(DirectoryReader reference) throws IOException { reference.decRef(); }
public void decZoieRef() { long refCount = zoieRefCounter.decrementAndGet(); if (refCount < 0) { log.warn("refCount should never be lower than 0"); } if (refCount == 0) { try { in.decRef(); } catch (IOException e) { log.error("decZoieRef exception, ", e); } } }
public void decZoieRef() { long refCount = zoieRefCounter.decrementAndGet(); if (refCount < 0) { log.warn("refCount should never be lower than 0"); } if (refCount == 0) { try { in.decRef(); } catch (IOException e) { log.error("decZoieRef exception, ", e); } } }
/** * Set the index reader. Takes ownership of that index reader, that is, * internally performs indexReader.incRef() (If caller no longer needs that * reader it should decRef()/close() it after calling this method, otherwise, * the reader will remain open). * @param indexReader The indexReader to set. */ public synchronized void setIndexReader(DirectoryReader indexReader) throws IOException { if (indexReader == this.indexReader) { return; } if (this.indexReader != null) { // Release current IR this.indexReader.decRef(); } this.indexReader = indexReader; if (indexReader != null) { // Hold reference to new IR indexReader.incRef(); indexSearcher = new IndexSearcher(indexReader); // TODO Some day we should make the query cache in this module configurable and control clearing the cache indexSearcher.setQueryCache(null); } else { indexSearcher = null; } }
try { if ( oldReader != null ) { oldReader.decRef();
try { if ( oldReader != null ) { oldReader.decRef();
@Override public int doLogic() throws IOException { Directory dir = getRunData().getDirectory(); DirectoryReader r = null; if (commitUserData != null) { r = DirectoryReader.open(OpenReaderTask.findIndexCommit(dir, commitUserData)); } else { r = DirectoryReader.open(dir); } getRunData().setIndexReader(r); // We transfer reference to the run data r.decRef(); return 1; }
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; }
private DirectoryReader doOpenFromWriter(IndexCommit commit) throws IOException { if (commit != null) { return doOpenFromCommit(commit); } if (writer.nrtIsCurrent(segmentInfos)) { return null; } DirectoryReader reader = writer.getReader(applyAllDeletes); // If in fact no changes took place, return null: if (reader.getVersion() == segmentInfos.getVersion()) { reader.decRef(); return null; } return reader; }
private DirectoryReader doOpenFromWriter(IndexCommit commit) throws IOException { if (commit != null) { return doOpenFromCommit(commit); } if (writer.nrtIsCurrent(segmentInfos)) { return null; } DirectoryReader reader = writer.getReader(applyAllDeletes); // If in fact no changes took place, return null: if (reader.getVersion() == segmentInfos.getVersion()) { reader.decRef(); return null; } return reader; }