lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r788291 - in /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport: DocBuilder.java EntityProcessorWrapper.java VariableResolverImpl.java
Date Thu, 25 Jun 2009 08:39:25 GMT
Author: noble
Date: Thu Jun 25 08:39:25 2009
New Revision: 788291

URL: http://svn.apache.org/viewvc?rev=788291&view=rev
Log:
SOLR-996 had an incorrect fix.

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=788291&r1=788290&r2=788291&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
Thu Jun 25 08:39:25 2009
@@ -307,7 +307,6 @@
     ContextImpl ctx = new ContextImpl(entity, vr, null,
             pk == null ? Context.FULL_DUMP : Context.DELTA_DUMP,
             session, parentCtx, this);
-    vr.context = ctx;
     entityProcessor.init(ctx);
 
     if (requestParameters.start > 0) {
@@ -347,7 +346,6 @@
 
           Map<String, Object> arow = entityProcessor.nextRow();
           if (arow == null) {
-            entityProcessor.destroy();
             break;
           }
 
@@ -425,6 +423,7 @@
       if (verboseDebug) {
         writer.log(SolrWriter.END_ENTITY, null, null);
       }
+      entityProcessor.destroy();
     }
   }
 
@@ -587,7 +586,6 @@
 
     EntityProcessor entityProcessor = getEntityProcessor(entity);
     ContextImpl context1 = new ContextImpl(entity, resolver, null, Context.FIND_DELTA, session,
null, this);
-    resolver.context = context1;
     entityProcessor.init(context1);
 
     Set<Map<String, Object>> myModifiedPks = new HashSet<Map<String, Object>>();

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=788291&r1=788290&r2=788291&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
Thu Jun 25 08:39:25 2009
@@ -49,6 +49,8 @@
 
   protected List<Map<String, Object>> rowcache;
 
+  private  Context contextCopy;
+
   public EntityProcessorWrapper(EntityProcessor delegate, DocBuilder docBuilder) {
     this.delegate = delegate;
     this.docBuilder = docBuilder;
@@ -58,6 +60,9 @@
     rowcache = null;
     this.context = context;
     resolver = (VariableResolverImpl) context.getVariableResolver();
+    //context has to be set correctly . keep the copy of the old one so that it can be restored
in destroy
+    contextCopy = resolver.context;
+    resolver.context = context;
     if (entityName == null) {
       onError = resolver.replaceTokens(context.getEntityAttribute(ON_ERROR));
       if (onError == null) onError = ABORT;
@@ -255,6 +260,8 @@
 
   public void destroy() {
     delegate.destroy();
+    resolver.context = contextCopy;
+    contextCopy = null;
   }
 
   @Override

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java?rev=788291&r1=788290&r2=788291&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/VariableResolverImpl.java
Thu Jun 25 08:39:25 2009
@@ -37,7 +37,7 @@
   /**
    * Used for creating Evaluators
    */
-  ContextImpl context;
+  Context context;
 
   private final TemplateString templateString = new TemplateString();
 



Mime
View raw message