/// <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));
 }
 /// <summary>
 /// Create ControlledRealTimeReopenThread, to periodically
 /// reopen the a <seealso cref="ReferenceManager"/>.
 /// </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 (!InstanceFieldsInitialized)
      * {
      *  InitializeInstanceFields();
      *  InstanceFieldsInitialized = true;
      * }*/
     if (targetMaxStaleSec < targetMinStaleSec)
     {
         throw new System.ArgumentException("targetMaxScaleSec (= " + targetMaxStaleSec + ") < targetMinStaleSec (=" + targetMinStaleSec + ")");
     }
     this.Writer           = writer;
     this.Manager          = manager;
     this.TargetMaxStaleNS = (long)(1000000000 * targetMaxStaleSec);
     this.TargetMinStaleNS = (long)(1000000000 * targetMinStaleSec);
     manager.AddListener(new HandleRefresh(this));
 }
Пример #3
0
 public LiveFieldValues(ReferenceManager <S> mgr, T missingValue)
 {
     this.missingValue = missingValue;
     this.mgr          = mgr;
     mgr.AddListener(this);
 }
Пример #4
0
 internal ReferenceContext(ReferenceManager <T> referenceManager)
 {
     this.referenceManager = referenceManager;
     this.reference        = referenceManager.Acquire();
 }
Пример #5
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);
 }