Пример #1
0
        public virtual void Reload()
        {
            Log.Info(m => m("Reloading index."));

            lock (reloadLock)
            {
                var newTracker = new SearcherClientTracker(CreateSearcher());

                var tmpHandler = SearcherLoading;

                if (tmpHandler != null)
                {
                    Log.Debug(m => m("Invoking SearcherLoading event."));
                    tmpHandler(this, new SearcherLoadEventArgs(newTracker.Searcher));
                }

                lock (searcherLock)
                {
                    if (tracker != null)
                    {
                        tracker.Dispose();
                    }

                    tracker = newTracker;
                }
            }

            Log.Debug(m => m("Index reloading completed."));
        }
Пример #2
0
        public virtual void Reload()
        {
            Log.Info(m => m("Reloading index."));

            lock (reloadLock)
            {
                var newTracker = new SearcherClientTracker(CreateSearcher());

                var tmpHandler = SearcherLoading;

                if (tmpHandler != null)
                {
                    Log.Debug(m => m("Invoking SearcherLoading event."));
                    tmpHandler(this, new SearcherLoadEventArgs(newTracker.Searcher));
                }

                lock (searcherLock)
                {
                    if (tracker != null)
                    {
                        tracker.Dispose();
                    }

                    tracker = newTracker;
                }
            }

            Log.Debug(m => m("Index reloading completed."));
        }
Пример #3
0
        public void Dispose()
        {
            lock (searcherLock)
            {
                AssertNotDisposed();

                disposed = true;

                if (tracker == null) return;

                if (!tracker.TryDispose())
                {
                    Log.Warn(m => m("Context is being disposed before all handles were released."));
                }

                tracker = null;
            }
        }
Пример #4
0
        public virtual void Reload()
        {
            lock (reloadLock)
            {
                AssertNotDisposed();
                Log.Info(() => ("Reloading index."));

                IndexSearcher searcher;
                if (reader == null)
                {
                    searcher = CreateSearcher();
                    reader   = searcher.IndexReader;
                }
                else if (!ReopenSearcher(out searcher))
                {
                    return;
                }

                var newTracker = new SearcherClientTracker(searcher);

                var tmpHandler = SearcherLoading;

                if (tmpHandler != null)
                {
                    Log.Debug(() => ("Invoking SearcherLoading event."));
                    tmpHandler(this, new SearcherLoadEventArgs(newTracker.Searcher));
                }

                lock (searcherLock)
                {
                    if (tracker != null)
                    {
                        tracker.Dispose();
                    }

                    tracker = newTracker;
                }
            }

            Log.Debug(() => ("Index reloading completed."));
        }
Пример #5
0
        public void Dispose()
        {
            lock (searcherLock)
            {
                AssertNotDisposed();

                disposed = true;

                if (tracker == null)
                {
                    return;
                }

                if (!tracker.TryDispose())
                {
                    Log.Warn(() => ("Context is being disposed before all handles were released."));
                }

                tracker = null;
            }
        }
Пример #6
0
        public virtual void Reload()
        {
            lock (reloadLock)
            {
                var newTracker = new SearcherClientTracker(CreateSearcher());

                var tmpHandler = SearcherLoading;

                if (tmpHandler != null)
                {
                    tmpHandler(this, new SearcherLoadEventArgs(newTracker.Searcher));
                }

                lock (searcherLock)
                {
                    if (tracker != null)
                    {
                        tracker.Dispose();
                    }

                    tracker = newTracker;
                }
            }
        }
Пример #7
0
 public SearcherHandle(SearcherClientTracker tracker)
 {
     this.tracker = tracker;
     tracker.AddClient(this);
 }
Пример #8
0
 public SearcherHandle(SearcherClientTracker tracker)
 {
     this.tracker = tracker;
     tracker.AddClient(this);
 }
Пример #9
0
        public virtual void Reload()
        {
            lock (reloadLock)
            {
                AssertNotDisposed();
                Log.Info(m => m("Reloading index."));

                IndexSearcher searcher;
                if (reader == null)
                {
                    searcher = CreateSearcher();
                    reader = searcher.IndexReader;
                }
                else if (!ReopenSearcher(out searcher))
                {
                    return;
                }

                var newTracker = new SearcherClientTracker(searcher);

                var tmpHandler = SearcherLoading;

                if (tmpHandler != null)
                {
                    Log.Debug(m => m("Invoking SearcherLoading event."));
                    tmpHandler(this, new SearcherLoadEventArgs(newTracker.Searcher));
                }

                lock (searcherLock)
                {
                    if (tracker != null)
                    {
                        tracker.Dispose();
                    }

                    tracker = newTracker;
                }
            }

            Log.Debug(m => m("Index reloading completed."));
        }