From 6120f26c40351835e923a585b18300c8eaa0a7ed Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 12 Oct 2015 22:43:23 +0200 Subject: [PATCH] Remove unused clear(IndexReader) method from IndexFieldData This method is unused can can simply be removed. It's rather confusing instead since it's another way of invalidating a cache entry but not through the close listener. --- .../elasticsearch/index/fielddata/IndexFieldData.java | 4 +--- .../index/fielddata/IndexFieldDataCache.java | 6 ------ .../ordinals/GlobalOrdinalsIndexFieldData.java | 5 ----- .../index/fielddata/plain/AbstractIndexFieldData.java | 5 ----- .../index/fielddata/plain/IndexIndexFieldData.java | 4 ---- .../fielddata/plain/ParentChildIndexFieldData.java | 5 ----- .../indices/fielddata/cache/IndicesFieldDataCache.java | 6 ------ .../fielddata/NoOrdinalsStringFieldDataTests.java | 5 ----- .../index/query/functionscore/FunctionScoreTests.java | 10 ---------- 9 files changed, 1 insertion(+), 49 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java index c4faa7fa7ee..0d88ab7d3fe 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java @@ -107,12 +107,10 @@ public interface IndexFieldData extends IndexCompone */ void clear(); - void clear(IndexReader reader); - // we need this extended source we we have custom comparators to reuse our field data // in this case, we need to reduce type that will be used when search results are reduced // on another node (we don't have the custom source them...) - public abstract class XFieldComparatorSource extends FieldComparatorSource { + abstract class XFieldComparatorSource extends FieldComparatorSource { /** * Simple wrapper class around a filter that matches parent documents diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataCache.java b/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataCache.java index 86b71c13a46..6ea49650a85 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataCache.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataCache.java @@ -45,8 +45,6 @@ public interface IndexFieldDataCache { */ void clear(String fieldName); - void clear(IndexReader reader); - interface Listener { /** @@ -80,9 +78,5 @@ public interface IndexFieldDataCache { @Override public void clear(String fieldName) { } - - @Override - public void clear(IndexReader reader) { - } } } diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java index 3b4db994a8e..b429cfce577 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java @@ -88,11 +88,6 @@ public abstract class GlobalOrdinalsIndexFieldData extends AbstractIndexComponen // no need to clear, because this is cached and cleared in AbstractBytesIndexFieldData } - @Override - public void clear(IndexReader reader) { - // no need to clear, because this is cached and cleared in AbstractBytesIndexFieldData - } - @Override public long ramBytesUsed() { return memorySizeInBytes; diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractIndexFieldData.java index 4cd172fd22c..34b11c47cc8 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractIndexFieldData.java @@ -64,11 +64,6 @@ public abstract class AbstractIndexFieldData extends cache.clear(fieldNames.indexName()); } - @Override - public void clear(IndexReader reader) { - cache.clear(reader); - } - @Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldNames.indexName()) == null) { diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java index f41f4cd7368..5bd41f85491 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java @@ -111,10 +111,6 @@ public class IndexIndexFieldData extends AbstractIndexOrdinalsFieldData { public void clear() { } - @Override - public void clear(IndexReader reader) { - } - @Override public final AtomicOrdinalsFieldData load(LeafReaderContext context) { return atomicFieldData; diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java index cc88210a883..fcef59b180d 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java @@ -331,11 +331,6 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData