You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2011/08/04 13:15:08 UTC

svn commit: r1153848 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/ solr/contrib/dataimporthandler/src/java/org/apache/solr/handler...

Author: shalin
Date: Thu Aug  4 11:15:07 2011
New Revision: 1153848

URL: http://svn.apache.org/viewvc?rev=1153848&view=rev
Log:
SOLR-2695 -- Documents are collected in unsynchronized list in multi-threaded debug mode

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test-framework/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.txt
    lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java

Modified: lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.txt?rev=1153848&r1=1153847&r2=1153848&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.txt Thu Aug  4 11:15:07 2011
@@ -17,6 +17,7 @@ Bug Fixes
 * SOLR-2492: DIH does not commit if only deletes are processed (James Dyer via shalin)
 * SOLR-2186: DataImportHandler's multi-threaded option throws NPE (Lance Norskog, Frank Wesemann, shalin)
 * SOLR-2655: DIH multi threaded mode does not resolve attributes correctly (Frank Wesemann, shalin)
+* SOLR-2695: Documents are collected in unsynchronized list in multi-threaded debug mode (Michael McCandless, shalin)
 
 ==================  3.3.0 ==================
 

Modified: lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java?rev=1153848&r1=1153847&r2=1153848&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java (original)
+++ lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java Thu Aug  4 11:15:07 2011
@@ -75,7 +75,7 @@ public class DataImportHandler extends R
 
   private Map<String, Properties> dataSources = new HashMap<String, Properties>();
 
-  private List<SolrInputDocument> debugDocuments;
+  private List<SolrInputDocument> debugDocuments = Collections.synchronizedList(new ArrayList<SolrInputDocument>());
 
   private boolean debugEnabled = true;
 
@@ -207,7 +207,7 @@ public class DataImportHandler extends R
             rsp.add("documents", debugDocuments);
             if (sw.debugLogger != null)
               rsp.add("verbose-output", sw.debugLogger.output);
-            debugDocuments = null;
+            debugDocuments.clear();
           } else {
             message = DataImporter.MSG.DEBUG_NOT_ENABLED;
           }
@@ -287,8 +287,6 @@ public class DataImportHandler extends R
       public boolean upload(SolrInputDocument document) {
         try {
           if (requestParams.debug) {
-            if (debugDocuments == null)
-              debugDocuments = new ArrayList<SolrInputDocument>();
             debugDocuments.add(document);
           }
           return super.upload(document);