@Override public void close() { mgr.removeListener(this); }
@Override public void close() { mgr.removeListener(this); }
@Override public void close() { mgr.removeListener(this); }
@Override public void close() { mgr.removeListener(this); }
/** Called when this index is closed. */ synchronized void clear() { maps = new Maps(); tombstones.clear(); ramBytesUsedCurrent.set(0); // NOTE: we can't zero this here, because a refresh thread could be calling InternalEngine.pruneDeletedTombstones at the same time, // and this will lead to an assert trip. Presumably it's fine if our ramBytesUsedTombstones is non-zero after clear since the index // is being closed: //ramBytesUsedTombstones.set(0); if (mgr != null) { mgr.removeListener(this); mgr = null; } }
/** Called when this index is closed. */ synchronized void clear() { maps = new Maps(); tombstones.clear(); ramBytesUsedCurrent.set(0); // NOTE: we can't zero this here, because a refresh thread could be calling InternalEngine.pruneDeletedTombstones at the same time, // and this will lead to an assert trip. Presumably it's fine if our ramBytesUsedTombstones is non-zero after clear since the index // is being closed: //ramBytesUsedTombstones.set(0); if (mgr != null) { mgr.removeListener(this); mgr = null; } }
/** Sync'd because we replace old mgr. */ synchronized void setManager(ReferenceManager<?> newMgr) { if (mgr != null) { mgr.removeListener(this); } mgr = newMgr; // In case InternalEngine closes & opens a new IndexWriter/SearcherManager, all deletes are made visible, so we clear old and // current here. This is safe because caller holds writeLock here (so no concurrent adds/deletes can be happeninge): maps = new Maps(); // So we are notified when reopen starts and finishes mgr.addListener(this); }
/** Sync'd because we replace old mgr. */ synchronized void setManager(ReferenceManager newMgr) { if (mgr != null) { mgr.removeListener(this); } mgr = newMgr; // In case InternalEngine closes & opens a new IndexWriter/SearcherManager, all deletes are made visible, so we clear old and // current here. This is safe because caller holds writeLock here (so no concurrent adds/deletes can be happeninge): maps = new Maps(); // So we are notified when reopen starts and finishes mgr.addListener(this); }