public void start() { if (_thread == null || !_thread.isAlive()) { reset(); _thread = new DataThread<D>(this); _thread.setMaxEventsPerMinute(_maxEventsPerMinute); _thread.start(); } }
public void syncWithVersion(long timeInMillis, String version) throws ZoieException { super.syncWithVersion(timeInMillis, version); readercache.refreshCache(timeInMillis); }
/** * Flush events to the memory index. * * @throws ZoieException */ public void flushEventsToMemoryIndex(long timeout) throws ZoieException { super.flushEvents(timeout); readercache.refreshCache(timeout); }
public void handleIndexingEvent(IndexingEvent evt) { // only interested in IndexUpdateEvent if (evt instanceof IndexUpdatedEvent) { IndexUpdatedEvent updateEvt = (IndexUpdatedEvent) evt; _startTime = updateEvt.getStartIndexingTime(); _endTime = updateEvt.getEndIndexingTime(); _leftOver = updateEvt.getNumDocsLeftInQueue(); _size = updateEvt.getNumDocsIndexed(); _totalSize += _size; _totalTime += (_endTime - _startTime); } }
public static <D> ZoieSystem<IndexReader, D> buildDefaultInstance(File idxDir, ZoieIndexableInterpreter<D> interpreter, ZoieConfig zoieConfig) { return new ZoieSystem<IndexReader, D>(idxDir, interpreter, new DefaultIndexReaderDecorator(), zoieConfig); }
@Override public String getStatus() { DataThread<D> thread = _thread; if (thread == null) return "dead"; return thread.getStatus() + " : " + thread.getState(); }
/** * Waits until all the buffered data events are processed. * @param timeout the max amount of time to wait in milliseconds. * @throws ZoieException */ public void flushEvents(long timeout) throws ZoieException { syncWithVersion(timeout, _bufferedVersion); }
@Override public <R extends IndexReader> AbstractReaderCache<R> newInstance( IndexReaderFactory<R> readerfactory) { return new SimpleReaderCache<R>(readerfactory); } };
/** * Stops the background thread. * <br> * It will stop the thread that sends data events to background DataConsumer. * If more data events comes in, the sender of those events will be blocked. */ @Override public void stop() { _consumerThread.terminate(); }
@Override public <R extends IndexReader> AbstractReaderCache<R> newInstance(IndexReaderFactory<R> readerfactory) { return new SmartReaderCache<R>(readerfactory); } };
@Override public ZoieIndexable convertAndInterpret(File src) { ZoieIndexable idxable = new FileIndexable(src, id); id++; return idxable; } }
@Override public <R extends IndexReader> AbstractReaderCache<R> newInstance( IndexReaderFactory<R> readerfactory) { return new NoopReaderCache<R>(readerfactory); } };
@Override public void start() { if (_thread == null || !_thread.isAlive()) { reset(); _thread = new DataThread<D>(this); _thread.setMaxEventsPerMinute(_maxEventsPerMinute); _thread.setMaxVolatileTime(_maxVolatileTimeInMillis); _thread.start(); } }
public static <D> ZoieSystem<IndexReader, D> buildDefaultInstance(File idxDir, ZoieIndexableInterpreter<D> interpreter,ZoieConfig zoieConfig) { return new ZoieSystem<IndexReader, D>(idxDir, interpreter, new DefaultIndexReaderDecorator(), zoieConfig); }
@Override public void syncWithVersion(long timeInMillis, String version) throws ZoieException { super.syncWithVersion(timeInMillis, version); readercache.refreshCache(timeInMillis); }
/** * Flush events to the memory index. * * @throws ZoieException */ public void flushEventsToMemoryIndex(long timeout) throws ZoieException { super.flushEvents(timeout); readercache.refreshCache(timeout); }
@Override public void start() { if (_thread == null || !_thread.isAlive()) { reset(); _thread = new DataThread<D>(this); _thread.setMaxEventsPerMinute(_maxEventsPerMinute); _thread.setMaxVolatileTime(_maxVolatileTimeInMillis); _thread.start(); } }
public static <D> ZoieSystem<IndexReader, D> buildDefaultInstance(File idxDir, ZoieIndexableInterpreter<D> interpreter, ZoieConfig zoieConfig) { return new ZoieSystem<IndexReader, D>(idxDir, interpreter, new DefaultIndexReaderDecorator(), zoieConfig); }
@Override public void syncWithVersion(long timeInMillis, String version) throws ZoieException { super.syncWithVersion(timeInMillis, version); readercache.refreshCache(timeInMillis); }
/** * Flush events to the memory index. * * @throws ZoieException */ public void flushEventsToMemoryIndex(long timeout) throws ZoieException { super.flushEvents(timeout); readercache.refreshCache(timeout); }