apply review comments

This commit is contained in:
Simon Willnauer 2015-10-14 09:19:02 +02:00
parent cac073dafa
commit 7999027bf5
2 changed files with 2 additions and 5 deletions

View File

@ -71,7 +71,7 @@ public class IndexSearcherWrapper {
if (reader != nonClosingReaderWrapper) {
if (reader.getCoreCacheKey() != elasticsearchDirectoryReader.getCoreCacheKey()) {
throw new IllegalStateException("wrapped directory reader doesn't delegate IndexReader#getCoreCacheKey, wrappers must override this method and delegate" +
" to the original readers core cache key. Wrapped readers can't used as cache keys since their are used only per request which would lead to subtile bugs");
" to the original readers core cache key. Wrapped readers can't be used as cache keys since their are used only per request which would lead to subtle bugs");
}
if (ElasticsearchDirectoryReader.getElasticsearchDirectoryReader(reader) != elasticsearchDirectoryReader) {
// prevent that somebody wraps with a non-filter reader
@ -109,7 +109,7 @@ public class IndexSearcherWrapper {
}
}
final class NonClosingReaderWrapper extends FilterDirectoryReader {
private static final class NonClosingReaderWrapper extends FilterDirectoryReader {
private NonClosingReaderWrapper(DirectoryReader in) throws IOException {
super(in, new SubReaderWrapper() {

View File

@ -967,9 +967,6 @@ public class IndexShardTests extends ESSingleNodeTestCase {
newShard.refresh("test");
assertEquals(shard.fieldData().stats("foo").getMemorySizeInBytes(), before.getMemorySizeInBytes());
assertEquals(shard.fieldData().stats("foo").getEvictions(), before.getEvictions());
} catch (Throwable t) {
t.printStackTrace();
throw t;
} finally {
newShard.close("just do it", randomBoolean());
}