public void flushEvents() throws ZoieException { try { _store.commit(); } catch (Exception e) { throw new ZoieException(e.getMessage(), e); } }
private void flush() { // FLUSH Collection<DataEvent<D>> tmp; tmp = _batch; _batch = new LinkedList<DataEvent<D>>(); try { if (_dataProvider._consumer != null) { int batchSize = tmp.size(); _dataProvider._consumer.consume(tmp); _eventCount.getAndAdd(batchSize); updateStats(); } } catch (ZoieException e) { log.error(e.getMessage(), e); } _lastFlushTime = System.currentTimeMillis(); }
public void flushEvents() throws ZoieException { try { _store.commit(); } catch (Exception e) { throw new ZoieException(e.getMessage(), e); } }
private void flush() { // FLUSH Collection<DataEvent<D>> tmp; tmp = _batch; _batch = new LinkedList<DataEvent<D>>(); try { if (_dataProvider._consumer != null) { int batchSize = tmp.size(); _dataProvider._consumer.consume(tmp); _eventCount.getAndAdd(batchSize); updateStats(); } } catch (ZoieException e) { log.error(e.getMessage(), e); } _lastFlushTime = System.currentTimeMillis(); }
public void flushEvents() throws ZoieException { try{ _store.commit(); } catch(Exception e){ throw new ZoieException(e.getMessage(),e); } }
private void flush() { // FLUSH Collection<DataEvent<D>> tmp; tmp = _batch; _batch = new LinkedList<DataEvent<D>>(); try { if (_dataProvider._consumer != null) { int batchSize = tmp.size(); _dataProvider._consumer.consume(tmp); _eventCount.getAndAdd(batchSize); updateStats(); } } catch (ZoieException e) { log.error(e.getMessage(), e); } }
@Override public void refreshCache(long timeout) throws ZoieException { long begintime = System.currentTimeMillis(); while (cachedreaderTimestamp <= begintime) { synchronized (cachemonitor) { cachemonitor.notifyAll(); long elapsed = System.currentTimeMillis() - begintime; if (elapsed > timeout) { log.debug("refreshCached reader timeout in " + elapsed + "ms"); throw new ZoieException("refreshCached reader timeout in " + elapsed + "ms"); } long timetowait = Math.min(timeout - elapsed, 200); try { cachemonitor.wait(timetowait); } catch (InterruptedException e) { log.warn("refreshCache", e); } } } }
} catch (ZoieException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } finally { long t2 = System.currentTimeMillis();
@Override public void refreshCache(long timeout) throws ZoieException { long begintime = System.currentTimeMillis(); while (cachedreaderTimestamp <= begintime) { synchronized (cachemonitor) { cachemonitor.notifyAll(); long elapsed = System.currentTimeMillis() - begintime; if (elapsed > timeout) { log.debug("refreshCached reader timeout in " + elapsed + "ms"); throw new ZoieException("refreshCached reader timeout in " + elapsed + "ms"); } long timetowait = Math.min(timeout - elapsed, 200); try { cachemonitor.wait(timetowait); } catch (InterruptedException e) { log.warn("refreshCache", e); } } } }
} catch (ZoieException e) { ZoieHealth.setFatal(); log.error(e.getMessage(), e); } finally { long t2 = System.currentTimeMillis();
@Override public void refreshCache(long timeout) throws ZoieException { long begintime = System.currentTimeMillis(); while (cachedreaderTimestamp <= begintime) { synchronized (cachemonitor) { cachemonitor.notifyAll(); long elapsed = System.currentTimeMillis() - begintime; if (elapsed > timeout) { log.debug("refreshCached reader timeout in " + elapsed + "ms"); throw new ZoieException("refreshCached reader timeout in " + elapsed + "ms"); } long timetowait = Math.min(timeout - elapsed, 200); try { cachemonitor.wait(timetowait); } catch (InterruptedException e) { log.warn("refreshCache", e); } } } }
log.error(e.getMessage(),e);
@Override public void refreshCache(long timeout) throws ZoieException { long begintime = System.currentTimeMillis(); while (cachedreaderTimestamp <= begintime) { synchronized (cachemonitor) { cachemonitor.notifyAll(); long elapsed = System.currentTimeMillis() - begintime; if (elapsed > timeout) { log.debug("refreshCached reader timeout in " + elapsed + "ms"); throw new ZoieException("refreshCached reader timeout in " + elapsed + "ms"); } long timetowait = Math.min(timeout - elapsed, 200); try { cachemonitor.wait(timetowait); } catch (InterruptedException e) { log.warn("refreshCache", e); } } } }
log.error(e.getMessage(),e);
/** * Wait for timeOut amount of time for the indexing thread to process data events. * If there are still remaining unprocessed events by the end of timeOut duration, * a ZoieException is thrown. * @param timeOut a timeout value in milliseconds. * @throws ZoieException */ public void flushEvents(long timeOut) throws ZoieException { synchronized (this) { while (_eventCount > 0) { _flush = true; this.notifyAll(); long now1 = System.currentTimeMillis(); if (timeOut <= 0) { log.error("sync timed out"); throw new ZoieException("timed out"); } try { long waittime = Math.min(200, timeOut); this.wait(waittime); } catch (InterruptedException e) { throw new ZoieException(e.getMessage()); } long now2 = System.currentTimeMillis(); timeOut -= (now2 - now1); } } }
break; } catch (ZoieException e) { if (e.getMessage().indexOf("timed out") < 0) { break; } else {
/** * Wait for timeOut amount of time for the indexing thread to process data events. * If there are still remaining unprocessed events by the end of timeOut duration, * a ZoieException is thrown. * @param timeOut a timeout value in milliseconds. * @throws ZoieException */ public void flushEvents(long timeOut) throws ZoieException { synchronized (this) { while (_eventCount > 0) { _flush = true; this.notifyAll(); long now1 = System.currentTimeMillis(); if (timeOut <= 0) { log.error("sync timed out"); throw new ZoieException("timed out"); } try { long waittime = Math.min(200, timeOut); this.wait(waittime); } catch (InterruptedException e) { throw new ZoieException(e.getMessage()); } long now2 = System.currentTimeMillis(); timeOut -= (now2 - now1); } } }
break; } catch (ZoieException e) { if (e.getMessage().indexOf("timed out") < 0) { break; } else {
public void syncWithVersion(long timeInMillis, String version) throws ZoieException { if (version == null) return; long now = System.currentTimeMillis(); long due = now + timeInMillis; synchronized (this) { try { while (_flushedVersion == null || _versionComparator.compare(_flushedVersion, version) < 0) { if (now >= due) { throw new ZoieException("sync timed out"); } try { this.notifyAll(); _flushing = true; this.wait(Math.min(due - now, 200)); } catch (InterruptedException e) { log.warn(e.getMessage(), e); } now = System.currentTimeMillis(); } } finally { _flushing = false; } } }
break; } catch (ZoieException e) { if (e.getMessage().indexOf("timed out") < 0) { break; } else {