public void uncaughtException(Thread thread, Throwable t) { ZoieHealth.setFatal(); log.error(thread.getName() + " is abruptly terminated", t); } };
public void uncaughtException(Thread thread, Throwable t) { ZoieHealth.setFatal(); log.error(thread.getName() + " is abruptly terminated", t); } };
public void uncaughtException(Thread thread, Throwable t) { ZoieHealth.setFatal(); log.error(thread.getName() + " is abruptly terminated", t); } };
public void closeIndexWriter() { if (_indexWriter != null) { try { _indexWriter.close(); } catch (Exception e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } _indexWriter = null; } }
public void closeIndexWriter() { if (_indexWriter != null) { try { _indexWriter.close(); } catch (Exception e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } _indexWriter = null; } }
public void closeIndexWriter() { if(_indexWriter != null) { try { _indexWriter.close(); } catch(Exception e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } _indexWriter = null; } }
/** * Closes the index reader */ public void closeReader() { if(_currentReader != null) { try { Directory directory = _currentReader.directory(); _currentReader.decRef(); int count = _currentReader.getRefCount(); log.info("final closeReader in dispenser and current refCount: " + count + " at " + directory); if (count > 0) { log.warn("final closeReader call with reference count == " + count + " greater than 0. Potentially, " + "the IndexReaders are not properly return to ZoieSystem."); } } catch(IOException e) { ZoieHealth.setFatal(); log.error("problem closing reader", e); } _currentReader = null; } } }
/** * Refreshes the index reader */ @Override public void refresh() { synchronized (this) { try { LongSet delDocs = _delDocs; clearDeletes(); _dispenser.getNewReader(); markDeletes(delDocs); // re-mark deletes commitDeletes(); } catch (IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } finally { synchronized (readerOpenLock) { readerOpenLock.notifyAll(); } } } }
/** * Refreshes the index reader */ @Override public void refresh() { synchronized (this) { try { LongSet delDocs = _delDocs; clearDeletes(); _dispenser.getNewReader(); markDeletes(delDocs); // re-mark deletes commitDeletes(); } catch (IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } finally { synchronized (readerOpenLock) { readerOpenLock.notifyAll(); } } } }
/** * Refreshes the index reader */ @Override public void refresh() { synchronized(this) { try { LongSet delDocs = _delDocs; clearDeletes(); _dispenser.getNewReader(); markDeletes(delDocs); // re-mark deletes commitDeletes(); } catch (IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(),e); } finally{ synchronized(readerOpenLock){ readerOpenLock.notifyAll(); } } } }
public void refreshDiskReader() throws IOException { log.info("refreshing disk reader ..."); ZoieIndexReader<R> diskIndexReader = null; try { // load a new reader, not in the lock because this should be done in the background // and should not contend with the readers diskIndexReader = _diskIndex.getNewReader(); } catch(IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(),e); throw e; } Mem<R> oldMem = _mem; Mem<R> mem = new Mem<R>(oldMem.get_memIndexA(), oldMem.get_memIndexB(), oldMem.get_currentWritable(), oldMem.get_currentReadOnly(), diskIndexReader); lockAndSwapMem(diskIndexReader, oldMem.get_diskIndexReader(), mem); log.info("disk reader refreshed"); }
public void refreshDiskReader() throws IOException { log.info("refreshing disk reader ..."); ZoieMultiReader<R> diskIndexReader = null; try { // load a new reader, not in the lock because this should be done in the background // and should not contend with the readers diskIndexReader = _diskIndex.getNewReader(); } catch (IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); throw e; } synchronized (_memLock) { Mem<R> oldMem = _mem; ZoieMultiReader<R> oldDiskIndexReader = oldMem.get_diskIndexReader(); if (diskIndexReader != oldDiskIndexReader) { Mem<R> mem = new Mem<R>(oldMem.get_memIndexA(), oldMem.get_memIndexB(), oldMem.get_currentWritable(), oldMem.get_currentReadOnly(), diskIndexReader); if (oldDiskIndexReader != null) { oldDiskIndexReader.decZoieRef(); } diskIndexReader.incZoieRef(); _mem = mem; } } log.info("disk reader refreshed"); }
public void refreshDiskReader() throws IOException { log.info("refreshing disk reader ..."); ZoieMultiReader<R> diskIndexReader = null; try { // load a new reader, not in the lock because this should be done in the background // and should not contend with the readers diskIndexReader = _diskIndex.getNewReader(); } catch (IOException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); throw e; } synchronized (_memLock) { Mem<R> oldMem = _mem; ZoieMultiReader<R> oldDiskIndexReader = oldMem.get_diskIndexReader(); if (diskIndexReader != oldDiskIndexReader) { Mem<R> mem = new Mem<R>(oldMem.get_memIndexA(), oldMem.get_memIndexB(), oldMem.get_currentWritable(), oldMem.get_currentReadOnly(), diskIndexReader); if (oldDiskIndexReader != null) { oldDiskIndexReader.decZoieRef(); } diskIndexReader.incZoieRef(); _mem = mem; } } log.info("disk reader refreshed"); }
@Override public void loadFromIndex(RAMSearchIndex<R> ramIndex) throws ZoieException { synchronized (_optimizeMonitor) { OptimizeType optType = _optScheduler.getScheduledOptimizeType(); _idxMgr.setPartialExpunge(optType == OptimizeType.PARTIAL); try { super.loadFromIndex(ramIndex); } finally { _idxMgr.setDiskIndexerStatus(Status.Sleep); _optScheduler.finished(); _idxMgr.setPartialExpunge(false); } if (optType == OptimizeType.FULL) { try { expungeDeletes(); } catch (IOException ioe) { ZoieHealth.setFatal(); throw new ZoieException(ioe.getMessage(), ioe); } finally { _optScheduler.finished(); } } } }
@Override public void loadFromIndex(RAMSearchIndex<R> ramIndex) throws ZoieException { synchronized (_optimizeMonitor) { OptimizeType optType = _optScheduler.getScheduledOptimizeType(); _idxMgr.setPartialExpunge(optType == OptimizeType.PARTIAL); try { super.loadFromIndex(ramIndex); } finally { _idxMgr.setDiskIndexerStatus(Status.Sleep); _optScheduler.finished(); _idxMgr.setPartialExpunge(false); } if (optType == OptimizeType.FULL) { try { expungeDeletes(); } catch (IOException ioe) { ZoieHealth.setFatal(); throw new ZoieException(ioe.getMessage(), ioe); } finally { _optScheduler.finished(); } } } }
@Override public void consume(Collection<DataEvent<ZoieIndexable>> events) throws ZoieException { // updates the in memory status before and after the work synchronized (_optimizeMonitor) { try { _idxMgr.setDiskIndexerStatus(Status.Working); OptimizeType optType = _optScheduler.getScheduledOptimizeType(); _idxMgr.setPartialExpunge(optType == OptimizeType.PARTIAL); try { super.consume(events); } finally { _optScheduler.finished(); _idxMgr.setPartialExpunge(false); } if (optType == OptimizeType.FULL) { try { expungeDeletes(); } catch (IOException ioe) { ZoieHealth.setFatal(); throw new ZoieException(ioe.getMessage(), ioe); } finally { _optScheduler.finished(); } } } finally { _idxMgr.setDiskIndexerStatus(Status.Sleep); } } }
@Override public void consume(Collection<DataEvent<ZoieIndexable>> events) throws ZoieException { // updates the in memory status before and after the work synchronized (_optimizeMonitor) { try { _idxMgr.setDiskIndexerStatus(Status.Working); OptimizeType optType = _optScheduler.getScheduledOptimizeType(); _idxMgr.setPartialExpunge(optType == OptimizeType.PARTIAL); try { super.consume(events); } finally { _optScheduler.finished(); _idxMgr.setPartialExpunge(false); } if (optType == OptimizeType.FULL) { try { expungeDeletes(); } catch (IOException ioe) { ZoieHealth.setFatal(); throw new ZoieException(ioe.getMessage(), ioe); } finally { _optScheduler.finished(); } } } finally { _idxMgr.setDiskIndexerStatus(Status.Sleep); } } }
public void loadFromIndex(RAMSearchIndex<R> ramIndex) throws ZoieException { try { // get disk search idx, BaseSearchIndex<R> idx = getSearchIndex(); // merge the realyOnly ram idx with the disk idx idx.loadFromIndex(ramIndex); // set new version String newVersion = idx.getVersion() == null ? ramIndex.getVersion() : (_versionComparator .compare(idx.getVersion(), ramIndex.getVersion()) < 0 ? ramIndex.getVersion() : idx .getVersion()); idx.setVersion(newVersion); synchronized (_idxMgr) { // update the disk idx reader idx.refresh(); purgeDocuments(); // inherit deletes idx.markDeletes(ramIndex.getDelDocs()); idx.commitDeletes(); idx.incrementEventCount(ramIndex.getEventsHandled()); _idxMgr.setDiskIndexerStatus(Status.Sleep); } } catch (IOException ioe) { ZoieHealth.setFatal(); log.error("Problem copying segments: " + ioe.getMessage(), ioe); throw new ZoieException(ioe); } }
ZoieHealth.setFatal(); log.error("Problem copying segments: " + ioe.getMessage(), ioe); throw new ZoieException(ioe);
public void loadFromIndex(RAMSearchIndex<R> ramIndex) throws ZoieException { try { // get disk search idx, BaseSearchIndex<R> idx = getSearchIndex(); // merge the realyOnly ram idx with the disk idx idx.loadFromIndex(ramIndex); // set new version String newVersion = idx.getVersion() == null ? ramIndex.getVersion() : (_versionComparator .compare(idx.getVersion(), ramIndex.getVersion()) < 0 ? ramIndex.getVersion() : idx .getVersion()); idx.setVersion(newVersion); synchronized (_idxMgr) { // update the disk idx reader idx.refresh(); purgeDocuments(); // inherit deletes idx.markDeletes(ramIndex.getDelDocs()); idx.commitDeletes(); idx.incrementEventCount(ramIndex.getEventsHandled()); _idxMgr.setDiskIndexerStatus(Status.Sleep); } } catch (IOException ioe) { ZoieHealth.setFatal(); log.error("Problem copying segments: " + ioe.getMessage(), ioe); throw new ZoieException(ioe); } }