Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6178

Add ability to define indexable classes via config

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 8.2.0.Final
    • None
    • Embedded Querying
    • None

    Description

      Queryable classes are currently auto-detected on the fly by the QueryInterceptor on each write operation. The set of discovered classes is replicated by means of ClusterRegistry.

      This approach creates a lot of technical complexity and the implementation has a number of flaws; some have been fixed after several iterations but the solution is still brittle and can lead to locking issues. It also forces Hibernate Search to reconfigure the factory which is rather messy. Instead of continuing to patch and 'improve' this we should consider pre-declaring the indexable classes in the cache configuration (indexing configuration actually).

      Given the impact of this change to existing codebase I would propose an approach that allows an easy transition:
      1. Introduction of a new config in indexing configuration to be able to specify the classes.
      2. If cache is indexed but no indexable classes were defined fallback to on-demand auto-detection as it worked in 8.1.
      3. If cache is indexed and classes were specified use them and do not perform on-demand auto-detection anymore. Also do not use ClusterRegistry to propagate the set of classes anymore.

      This is how it should work in 8.2. Auto-detection should also be documented as deprecated in 8.2 and should be removed completely in 9.0. In 9.0, marking a cache as indexed but not specifying which exact classes should result in an error at config time validation.

      Attachments

        Activity

          People

            anistor Adrian Nistor (Inactive)
            anistor Adrian Nistor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: