incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Fixed BLUR-195
Date Tue, 06 Aug 2013 19:17:20 GMT
Fixed BLUR-195


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

Branch: refs/heads/master
Commit: ab5f4ab095f9a02af532e69034d384f777ffa313
Parents: 9991a8b
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Aug 6 15:16:58 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Aug 6 15:16:58 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/manager/writer/IndexImporter.java   | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ab5f4ab0/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java b/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java
index 8c31d6b..d1990c3 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java
@@ -175,6 +175,7 @@ public class IndexImporter extends TimerTask implements Closeable {
       BlurPartitioner blurPartitioner = new BlurPartitioner();
       Text key = new Text();
       int numberOfShards = _shardContext.getTableContext().getDescriptor().getShardCount();
+      int shardId = BlurUtil.getShardIndex(shard);
       for (AtomicReaderContext context : leaves) {
         AtomicReader atomicReader = context.reader();
         Fields fields = atomicReader.fields();
@@ -183,16 +184,13 @@ public class IndexImporter extends TimerTask implements Closeable {
           TermsEnum termsEnum = terms.iterator(null);
           BytesRef ref = null;
           while ((ref = termsEnum.next()) != null) {
-            byte[] rowIdInBytes = ref.bytes;
-            key.set(rowIdInBytes, 0, rowIdInBytes.length);
+            key.set(ref.bytes, ref.offset, ref.length);
             int partition = blurPartitioner.getPartition(key, null, numberOfShards);
-            int shardId = BlurUtil.getShardIndex(shard);
             if (shardId != partition) {
               return false;
             }
             if (emitDeletes) {
-              Term term = new Term(BlurConstants.ROW_ID, BytesRef.deepCopyOf(ref));
-              indexWriter.deleteDocuments(term);
+              indexWriter.deleteDocuments(new Term(BlurConstants.ROW_ID, BytesRef.deepCopyOf(ref)));
             }
           }
         }


Mime
View raw message