/** * Closes the index reader */ public void closeReader() { if (_currentReader != null) { _currentReader.decZoieRef(); int count = _currentReader.getInnerRefCount(); log.info("final closeReader in dispenser and current refCount: " + count); if (count > 0) { log.warn("final closeReader call with reference count == " + count + " greater than 0. Potentially, " + "the IndexReaders are not properly return to ZoieSystem."); } _currentReader = null; } } }
/** * Closes the index reader */ public void closeReader() { if (_currentReader != null) { _currentReader.decZoieRef(); int count = _currentReader.getInnerRefCount(); log.info("final closeReader in dispenser and current refCount: " + count); if (count > 0) { log.warn("final closeReader call with reference count == " + count + " greater than 0. Potentially, " + "the IndexReaders are not properly return to ZoieSystem."); } _currentReader = null; } } }
/** * Copy the given lists to have immutable behavior. * * @param archives * @param retiree * @param actives * @param decorator */ public Box(List<ZoieMultiReader<R>> archives, List<ZoieSystem<R, D>> archiveZoies, List<ZoieSystem<R, D>> retiree, List<ZoieSystem<R, D>> actives, IndexReaderDecorator<R> decorator) { _archives = new LinkedList<ZoieMultiReader<R>>(archives); _archiveZoies = new LinkedList<ZoieSystem<R, D>>(archiveZoies); _retiree = new LinkedList<ZoieSystem<R, D>>(retiree); _actives = new LinkedList<ZoieSystem<R, D>>(actives); _decorator = decorator; if (log.isDebugEnabled()) { for (ZoieMultiReader<R> r : _archives) { log.debug("archive " + r.directory() + " refCount: " + r.getInnerRefCount()); } } }
/** * Copy the given lists to have immutable behavior. * * @param archives * @param retiree * @param actives * @param decorator */ public Box(List<ZoieMultiReader<R>> archives, List<ZoieSystem<R, D>> archiveZoies, List<ZoieSystem<R, D>> retiree, List<ZoieSystem<R, D>> actives, IndexReaderDecorator<R> decorator) { _archives = new LinkedList<ZoieMultiReader<R>>(archives); _archiveZoies = new LinkedList<ZoieSystem<R, D>>(archiveZoies); _retiree = new LinkedList<ZoieSystem<R, D>>(retiree); _actives = new LinkedList<ZoieSystem<R, D>>(actives); _decorator = decorator; if (log.isDebugEnabled()) { for (ZoieMultiReader<R> r : _archives) { log.debug("archive " + r.directory() + " refCount: " + r.getInnerRefCount()); } } }
/** * The readers removed will also be decZoieRef(). But the readers to be added will NOT get incZoieRef(), * which means we assume the newly added ones have already been incRef(). * remove and add should be <b>disjoint</b> * @param remove the readers to be remove. This has to be disjoint from add. * @param add */ public synchronized void swapArchives(List<ZoieMultiReader<R>> remove, List<ZoieMultiReader<R>> add) { List<ZoieMultiReader<R>> archives = new LinkedList<ZoieMultiReader<R>>(add); if (!box._archives.containsAll(remove)) { log.error("swapArchives: potential sync issue. "); } archives.addAll(box._archives); archives.removeAll(remove); for (ZoieMultiReader<R> r : remove) { r.decZoieRef(); if (log.isDebugEnabled()) { log.debug("remove time " + r.directory() + " refCount: " + r.getInnerRefCount()); } } Box<R, D> newbox = new Box<R, D>(archives, box._archiveZoies, box._retiree, box._actives, _decorator); box = newbox; }
/** * The readers removed will also be decZoieRef(). But the readers to be added will NOT get incZoieRef(), * which means we assume the newly added ones have already been incRef(). * remove and add should be <b>disjoint</b> * @param remove the readers to be remove. This has to be disjoint from add. * @param add */ public synchronized void swapArchives(List<ZoieMultiReader<R>> remove, List<ZoieMultiReader<R>> add) { List<ZoieMultiReader<R>> archives = new LinkedList<ZoieMultiReader<R>>(add); if (!box._archives.containsAll(remove)) { log.error("swapArchives: potential sync issue. "); } archives.addAll(box._archives); archives.removeAll(remove); for (ZoieMultiReader<R> r : remove) { r.decZoieRef(); if (log.isDebugEnabled()) { log.debug("remove time " + r.directory() + " refCount: " + r.getInnerRefCount()); } } Box<R, D> newbox = new Box<R, D>(archives, box._archiveZoies, box._retiree, box._actives, _decorator); box = newbox; }
public void shutdown() { for (ZoieMultiReader<R> r : _archives) { r.decZoieRef(); log.info("refCount at shutdown: " + r.getInnerRefCount() + " " + r.directory());
public void shutdown() { for (ZoieMultiReader<R> r : _archives) { r.decZoieRef(); log.info("refCount at shutdown: " + r.getInnerRefCount() + " " + r.directory());