/** The missingValue must be non-null. */ public LiveFieldValues(ReferenceManager<S> mgr, T missingValue) { this.missingValue = missingValue; this.mgr = mgr; mgr.addListener(this); }
/** * Create ControlledRealTimeReopenThread, to periodically * reopen the a {@link ReferenceManager}. * * @param targetMaxStaleSec Maximum time until a new * reader must be opened; this sets the upper bound * on how slowly reopens may occur, when no * caller is waiting for a specific generation to * become visible. * * @param targetMinStaleSec Mininum time until a new * reader can be opened; this sets the lower bound * on how quickly reopens may occur, when a caller * is waiting for a specific generation to * become visible. */ public ControlledRealTimeReopenThread(IndexWriter writer, ReferenceManager<T> manager, double targetMaxStaleSec, double targetMinStaleSec) { if (targetMaxStaleSec < targetMinStaleSec) { throw new IllegalArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec + ") < targetMinStaleSec (=" + targetMinStaleSec + ")"); } this.writer = writer; this.manager = manager; this.targetMaxStaleNS = (long) (1000000000*targetMaxStaleSec); this.targetMinStaleNS = (long) (1000000000*targetMinStaleSec); manager.addListener(new HandleRefresh()); }
/** The missingValue must be non-null. */ public LiveFieldValues(ReferenceManager<S> mgr, T missingValue) { this.missingValue = missingValue; this.mgr = mgr; mgr.addListener(this); }
/** The missingValue must be non-null. */ public LiveFieldValues(ReferenceManager<S> mgr, T missingValue) { this.missingValue = missingValue; this.mgr = mgr; mgr.addListener(this); }
/** The missingValue must be non-null. */ public LiveFieldValues(ReferenceManager<S> mgr, T missingValue) { this.missingValue = missingValue; this.mgr = mgr; mgr.addListener(this); }
/** * Create ControlledRealTimeReopenThread, to periodically * reopen the a {@link ReferenceManager}. * * @param targetMaxStaleSec Maximum time until a new * reader must be opened; this sets the upper bound * on how slowly reopens may occur, when no * caller is waiting for a specific generation to * become visible. * * @param targetMinStaleSec Mininum time until a new * reader can be opened; this sets the lower bound * on how quickly reopens may occur, when a caller * is waiting for a specific generation to * become visible. */ public ControlledRealTimeReopenThread(TrackingIndexWriter writer, ReferenceManager<T> manager, double targetMaxStaleSec, double targetMinStaleSec) { if (targetMaxStaleSec < targetMinStaleSec) { throw new IllegalArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec + ") < targetMinStaleSec (=" + targetMinStaleSec + ")"); } this.writer = writer; this.manager = manager; this.targetMaxStaleNS = (long) (1000000000*targetMaxStaleSec); this.targetMinStaleNS = (long) (1000000000*targetMinStaleSec); manager.addListener(new HandleRefresh()); }
/** * Create ControlledRealTimeReopenThread, to periodically * reopen the a {@link ReferenceManager}. * * @param targetMaxStaleSec Maximum time until a new * reader must be opened; this sets the upper bound * on how slowly reopens may occur, when no * caller is waiting for a specific generation to * become visible. * * @param targetMinStaleSec Mininum time until a new * reader can be opened; this sets the lower bound * on how quickly reopens may occur, when a caller * is waiting for a specific generation to * become visible. */ public ControlledRealTimeReopenThread(IndexWriter writer, ReferenceManager<T> manager, double targetMaxStaleSec, double targetMinStaleSec) { if (targetMaxStaleSec < targetMinStaleSec) { throw new IllegalArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec + ") < targetMinStaleSec (=" + targetMinStaleSec + ")"); } this.writer = writer; this.manager = manager; this.targetMaxStaleNS = (long) (1000000000*targetMaxStaleSec); this.targetMinStaleNS = (long) (1000000000*targetMinStaleSec); manager.addListener(new HandleRefresh()); }
/** * Create ControlledRealTimeReopenThread, to periodically * reopen the a {@link ReferenceManager}. * * @param targetMaxStaleSec Maximum time until a new * reader must be opened; this sets the upper bound * on how slowly reopens may occur, when no * caller is waiting for a specific generation to * become visible. * * @param targetMinStaleSec Mininum time until a new * reader can be opened; this sets the lower bound * on how quickly reopens may occur, when a caller * is waiting for a specific generation to * become visible. */ public ControlledRealTimeReopenThread(TrackingIndexWriter writer, ReferenceManager<T> manager, double targetMaxStaleSec, double targetMinStaleSec) { if (targetMaxStaleSec < targetMinStaleSec) { throw new IllegalArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec + ") < targetMinStaleSec (=" + targetMinStaleSec + ")"); } this.writer = writer; this.manager = manager; this.targetMaxStaleNS = (long) (1000000000*targetMaxStaleSec); this.targetMinStaleNS = (long) (1000000000*targetMinStaleSec); manager.addListener(new HandleRefresh()); }
/** 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); }