/// <summary> /// Create <see cref="ControlledRealTimeReopenThread{T}"/>, to periodically /// reopen the a <see cref="ReferenceManager{T}"/>. /// </summary> /// <param name="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> /// <param name="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. </param> public ControlledRealTimeReopenThread(TrackingIndexWriter writer, ReferenceManager <T> manager, double targetMaxStaleSec, double targetMinStaleSec) { if (targetMaxStaleSec < targetMinStaleSec) { throw new ArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec.ToString("0.0") + ") < targetMinStaleSec (=" + targetMinStaleSec.ToString("0.0") + ")"); } this.writer = writer; this.manager = manager; this.targetMaxStaleNS = (long)(1000000000 * targetMaxStaleSec); this.targetMinStaleNS = (long)(1000000000 * targetMinStaleSec); manager.AddListener(new HandleRefresh(this)); }
public LiveFieldValues(ReferenceManager <S> mgr, T missingValue) { this.missingValue = missingValue; this.mgr = mgr; mgr.AddListener(this); }
protected LiveFieldValues(ReferenceManager <S> mgr, T missingValue) // LUCENENET: CA1012: Abstract types should not have constructors (marked protected) { this.missingValue = missingValue; this.mgr = mgr; mgr.AddListener(this); }