optimize empty cached filters to return null

This commit is contained in:
kimchy 2011-05-23 04:56:57 +03:00
parent b61735d8ea
commit 45956a5a27
3 changed files with 2 additions and 25 deletions

View File

@ -171,7 +171,7 @@ public abstract class AbstractConcurrentMapFilterCache extends AbstractIndexComp
if (prev != null) { if (prev != null) {
docSet = prev; docSet = prev;
} }
return docSet; return docSet == DocSet.EMPTY_DOC_SET ? null : docSet;
} }
public String toString() { public String toString() {

View File

@ -180,7 +180,7 @@ public abstract class AbstractWeightedFilterCache extends AbstractIndexComponent
innerCache.putIfAbsent(cacheKey, cacheValue); innerCache.putIfAbsent(cacheKey, cacheValue);
} }
return cacheValue.value(); return cacheValue.value() == DocSet.EMPTY_DOC_SET ? null : cacheValue.value();
} }
public String toString() { public String toString() {

View File

@ -1,23 +0,0 @@
/*
* Licensed to Elastic Search and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Elastic Search licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.index.cache.filter.support;
public class FilterCacheHelper {
}