incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [4/4] git commit: Fixed nasty multi-threading bug. In Lucene 4.0.0 do not create constant field object and reuse across threads.
Date Tue, 23 Oct 2012 16:20:24 GMT
Fixed nasty multi-threading bug.  In Lucene 4.0.0 do not create constant field object and reuse
across threads.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/4adca57d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/4adca57d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/4adca57d

Branch: refs/heads/lucene-4.0.0
Commit: 4adca57daf57d09c76487f0117d7ba357e6b79b4
Parents: bc7b6df
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Oct 23 11:40:24 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Oct 23 11:40:24 2012 -0400

----------------------------------------------------------------------
 .../blur/manager/writer/TransactionRecorder.java   |    4 +++-
 .../java/org/apache/blur/utils/BlurConstants.java  |    4 ----
 .../java/org/apache/blur/utils/RowIndexWriter.java |    2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4adca57d/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
index 2f24e22..d5861f4 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/TransactionRecorder.java
@@ -46,7 +46,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.record.Utils;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Field.Index;
 import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.NRTManager.TrackingIndexWriter;
@@ -328,7 +330,7 @@ public class TransactionRecorder {
     for (int i = 0; i < size; i++) {
       Document document = convert(rowId, records.get(i), builder, analyzer);
       if (i == 0) {
-        document.add(BlurConstants.PRIME_DOC_FIELD);
+        document.add(new Field(BlurConstants.PRIME_DOC, BlurConstants.PRIME_DOC_VALUE, Store.NO,
Index.NOT_ANALYZED_NO_NORMS));
       }
       docs.add(document);
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4adca57d/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java b/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java
index cd0f0bc..e3d7d14 100644
--- a/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java
+++ b/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java
@@ -25,9 +25,6 @@ import org.apache.blur.manager.results.BlurResultComparator;
 import org.apache.blur.manager.results.BlurResultPeekableIteratorComparator;
 import org.apache.blur.manager.results.PeekableIterator;
 import org.apache.blur.thrift.generated.BlurResult;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Field.Index;
-import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.index.Term;
 
 
@@ -102,7 +99,6 @@ public class BlurConstants {
   public static final long ZK_WAIT_TIME = TimeUnit.SECONDS.toMillis(5);
 
   public static final Term PRIME_DOC_TERM = new Term(PRIME_DOC, BlurConstants.PRIME_DOC_VALUE);
-  public static final Field PRIME_DOC_FIELD = new Field(PRIME_DOC, PRIME_DOC_VALUE, Store.YES,
Index.NOT_ANALYZED_NO_NORMS);
 
   static {
     try {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4adca57d/src/blur-core/src/main/java/org/apache/blur/utils/RowIndexWriter.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/RowIndexWriter.java b/src/blur-core/src/main/java/org/apache/blur/utils/RowIndexWriter.java
index 314c399..9b98a46 100644
--- a/src/blur-core/src/main/java/org/apache/blur/utils/RowIndexWriter.java
+++ b/src/blur-core/src/main/java/org/apache/blur/utils/RowIndexWriter.java
@@ -94,7 +94,7 @@ public class RowIndexWriter {
     document.add(new Field(RECORD_ID, recordId, Store.YES, Index.NOT_ANALYZED_NO_NORMS));
     if (addColumns(document, _analyzer, builder, family, record.columns)) {
       if (!primeDocSet) {
-        document.add(BlurConstants.PRIME_DOC_FIELD);
+        document.add(new Field(BlurConstants.PRIME_DOC, BlurConstants.PRIME_DOC_VALUE, Store.NO,
Index.NOT_ANALYZED_NO_NORMS));
         primeDocSet = true;
       }
       documents.add(document);


Mime
View raw message