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

DocBuilder should pass EntityProcessorWrapper in notifyListener

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 5.0
    • None
    • None
    • Windows 7; Apache Solr 5.0.0

    Description

      Within an onImportEnd listener, I would like to be able to do this:

      String entityName = context.getEntityAttribute("name");
      

      Because the DocBuilder.notifyListener passes a null EntityProcessorWrapper, the entity is not accessible at all in the onImportEnd event.

      Suggested Fix: DocBuilder.notifyListener should pass the currentEntityProcessorWrapper into the ContextImpl constructor on line 173 of DocBuilder.java

       private void notifyListener(EventListener listener, Exception lastException) {
          String currentProcess;
          if (dataImporter.getStatus() == DataImporter.Status.RUNNING_DELTA_DUMP) {
            currentProcess = Context.DELTA_DUMP;
          } else {
            currentProcess = Context.FULL_DUMP;
          }
          ContextImpl ctx = new ContextImpl(null, getVariableResolver(), null, currentProcess, session, null, this); //FIX: PASS first argument
          ctx.setLastException(lastException);
          listener.onEvent(ctx);
        }
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            agenaill Alex Genaille
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment