Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-972

EventListener-s creation changed from a per request ( full / delta-imports) scenario to once through the lifetime of the DIH plugin.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Labels:
      None
    • Environment:

      Java 6, Tomcat 6

      Description

      The EventListener plugin for notification of start / end import events (SOLR-938) creates an instance of EventListener before every notification. This has 2 drawbacks.

      • No state is stored between successive invocations of events as it is a new object
      • When writing plugins for delta imports - it is very inefficient to do a class loader lookup by reflection / instantiate an instance and call a method on the same.

      Attached patch has one EventListener through the lifetime of the DIH plugin .

      Also EventListener is changed to an interface rather than an abstract class for better decoupling (especially painful when the start/end eventlistener has an independent hierarchy by itself ).

      By default, a no-op listener is registered to avoid boiler plate code to check if there is a start / end listener specified. Efficient JRE impls should be able to optimize the no-op for minimum overhead compared to checking the reference for null and branching out.

      Specifying an onImportStart / onImportEnd overrides the default handler though.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kaykay.unique Karthik K
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified