Merge pull request #14072 from s1monw/remove_clear_index_reader

Remove unused clear(IndexReader) method from IndexFieldData
This commit is contained in:
Simon Willnauer 2015-10-13 11:48:15 +02:00
commit b9ba5fb765
9 changed files with 1 additions and 49 deletions

View File

@ -107,12 +107,10 @@ public interface IndexFieldData<FD extends AtomicFieldData> 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

View File

@ -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) {
}
}
}

View File

@ -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;

View File

@ -64,11 +64,6 @@ public abstract class AbstractIndexFieldData<FD extends AtomicFieldData> 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) {

View File

@ -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;

View File

@ -331,11 +331,6 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData<AtomicPare
ParentChildIndexFieldData.this.clear();
}
@Override
public void clear(IndexReader reader) {
ParentChildIndexFieldData.this.clear(reader);
}
@Override
public Index index() {
return ParentChildIndexFieldData.this.index();

View File

@ -227,12 +227,6 @@ public class IndicesFieldDataCache extends AbstractComponent implements RemovalL
// soon as possible
cache.refresh();
}
@Override
public void clear(IndexReader indexReader) {
cache.invalidate(new Key(this, indexReader.getCoreCacheKey(), null));
// don't call cache.cleanUp here as it would have bad performance implications
}
}
public static class Key {

View File

@ -70,11 +70,6 @@ public class NoOrdinalsStringFieldDataTests extends PagedBytesStringFieldDataTes
in.clear();
}
@Override
public void clear(IndexReader reader) {
in.clear(reader);
}
};
}

View File

@ -128,11 +128,6 @@ public class FunctionScoreTests extends ESTestCase {
throw new UnsupportedOperationException(UNSUPPORTED);
}
@Override
public void clear(IndexReader reader) {
throw new UnsupportedOperationException(UNSUPPORTED);
}
@Override
public Index index() {
throw new UnsupportedOperationException(UNSUPPORTED);
@ -227,11 +222,6 @@ public class FunctionScoreTests extends ESTestCase {
throw new UnsupportedOperationException(UNSUPPORTED);
}
@Override
public void clear(IndexReader reader) {
throw new UnsupportedOperationException(UNSUPPORTED);
}
@Override
public Index index() {
throw new UnsupportedOperationException(UNSUPPORTED);