예제 #1
0
 /// <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));
 }
예제 #2
0
 public LiveFieldValues(ReferenceManager <S> mgr, T missingValue)
 {
     this.missingValue = missingValue;
     this.mgr          = mgr;
     mgr.AddListener(this);
 }
예제 #3
0
 internal ReferenceContext(ReferenceManager <T> referenceManager)
 {
     this.referenceManager = referenceManager;
     this.reference        = referenceManager.Acquire();
 }
예제 #4
0
 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);
 }