Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2955

Add utitily class to manage NRT reopening


    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.3, 4.0-ALPHA
    • core/index
    • None
    • New


      I created a simple class, NRTManager, that tries to abstract away some
      of the reopen logic when using NRT readers.

      You give it your IW, tell it min and max nanoseconds staleness you can
      tolerate, and it privately runs a reopen thread to periodically reopen
      the searcher.

      It subsumes the SearcherManager from LIA2. Besides running the reopen
      thread, it also adds the notion of a "generation" containing changes
      you've made. So eg it has addDocument, returning a long. You can
      then take that long value and pass it back to the getSearcher method
      and getSearcher will return a searcher that reflects the changes made
      in that generation.

      This gives your app the freedom to force "immediate" consistency (ie
      wait for the reopen) only for those searches that require it, like a
      verifier that adds a doc and then immediately searches for it, but
      also use "eventual consistency" for other searches.

      I want to also add support for the new "applyDeletions" option when
      pulling an NRT reader.

      Also, this is very new and I'm sure buggy – the concurrency is either
      wrong over overly-locking. But it's a start...


        1. LUCENE-2955.patch
          23 kB
          Michael McCandless
        2. LUCENE-2955.patch
          44 kB
          Michael McCandless
        3. LUCENE-2955.patch
          49 kB
          Michael McCandless



            mikemccand Michael McCandless
            mikemccand Michael McCandless
            0 Vote for this issue
            0 Start watching this issue