org.hibernate.search.backend.impl.lucene.analysis

## Class ConcurrentlyMutableAnalyzer

- java.lang.Object
- - org.apache.lucene.analysis.Analyzer
  - - org.apache.lucene.analysis.AnalyzerWrapper
    - - org.apache.lucene.analysis.DelegatingAnalyzerWrapper
      - - org.hibernate.search.backend.impl.lucene.analysis.ConcurrentlyMutableAnalyzer

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public final class ConcurrentlyMutableAnalyzer
      extends DelegatingAnalyzerWrapper

  An Analyzer implementation which can dynamically be reconfigured. We use this as temporary solution to workaround LUCENE-6212, until a better solution is found.
  Author:
    Sanne Grinovero (C) 2015 Red Hat Inc.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

      `Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.analysis.Analyzer

      `GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcurrentlyMutableAnalyzer(Analyzer initialAnalyzer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Analyzer` | `getWrappedAnalyzer(String fieldName)`
    `boolean` | `isCompatibleWith(ScopedLuceneAnalyzer analyzer)` Checks if the currently set Analyzer is the same as the proposed one, in which case there is no need for replacements or locking.
    `void` | `updateAnalyzer(ScopedLuceneAnalyzer analyzer)` Correct concurrency control requires external locking!

    - ### Methods inherited from class org.apache.lucene.analysis.DelegatingAnalyzerWrapper

      `wrapComponents, wrapReader`

    - ### Methods inherited from class org.apache.lucene.analysis.AnalyzerWrapper

      `createComponents, getOffsetGap, getPositionIncrementGap, initReader`

    - ### Methods inherited from class org.apache.lucene.analysis.Analyzer

      `close, getReuseStrategy, getVersion, setVersion, tokenStream, tokenStream`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConcurrentlyMutableAnalyzer

          public ConcurrentlyMutableAnalyzer(Analyzer initialAnalyzer)

  - ### Method Detail

    - #### getWrappedAnalyzer

          protected Analyzer getWrappedAnalyzer(String fieldName)

      Specified by:
        `getWrappedAnalyzer` in class `AnalyzerWrapper`

    - #### isCompatibleWith

          public boolean isCompatibleWith(ScopedLuceneAnalyzer analyzer)

      Checks if the currently set Analyzer is the same as the proposed one, in which case there is no need for replacements or locking. Correct concurrency control requires external locking!
      Parameters:
        `analyzer` - the `ScopedLuceneAnalyzer` to use for comparison
      Returns:
        true if there is no need to replace the current Analyzer

    - #### updateAnalyzer

          public void updateAnalyzer(ScopedLuceneAnalyzer analyzer)

      Correct concurrency control requires external locking!
      Parameters:
        `analyzer` - the `ScopedLuceneAnalyzer` to use for locking

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved