optimize empty cached filters to return null
This commit is contained in:
parent
b61735d8ea
commit
45956a5a27
|
@ -171,7 +171,7 @@ public abstract class AbstractConcurrentMapFilterCache extends AbstractIndexComp
|
|||
if (prev != null) {
|
||||
docSet = prev;
|
||||
}
|
||||
return docSet;
|
||||
return docSet == DocSet.EMPTY_DOC_SET ? null : docSet;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
|
@ -180,7 +180,7 @@ public abstract class AbstractWeightedFilterCache extends AbstractIndexComponent
|
|||
innerCache.putIfAbsent(cacheKey, cacheValue);
|
||||
}
|
||||
|
||||
return cacheValue.value();
|
||||
return cacheValue.value() == DocSet.EMPTY_DOC_SET ? null : cacheValue.value();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
|
@ -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 {
|
||||
}
|
Loading…
Reference in New Issue