Permalink
Browse files

fix cleanup of of has child/parent

check if the collected uids were processed before trying to push them back to the cache
  • Loading branch information...
1 parent 3cd54fc commit 7bf233a174d5833adaf7ab018c601796060e3eb8 @kimchy kimchy committed Sep 14, 2012
@@ -140,7 +140,9 @@ public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
}
public void clear() {
- CacheRecycler.pushHashSet(collectedUids);
+ if (collectedUids != null) {
+ CacheRecycler.pushHashSet(collectedUids);
+ }
collectedUids = null;
}
@@ -21,7 +21,10 @@
import gnu.trove.set.hash.THashSet;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.*;
+import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.DocIdSet;
+import org.apache.lucene.search.Filter;
+import org.apache.lucene.search.Query;
import org.apache.lucene.util.FixedBitSet;
import org.elasticsearch.ElasticSearchIllegalStateException;
import org.elasticsearch.common.CacheRecycler;
@@ -107,7 +110,9 @@ public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
}
public void clear() {
- CacheRecycler.pushHashSet(parents);
+ if (parents != null) {
+ CacheRecycler.pushHashSet(parents);
+ }
parents = null;
}

0 comments on commit 7bf233a

Please sign in to comment.