C# Класс Lucene.Net.Util.FieldCacheSanityChecker

Provides methods for sanity checking that entries in the FieldCache are not wasteful or inconsistent.

Lucene 2.9 Introduced numerous enhancements into how the FieldCache is used by the low levels of Lucene searching (for Sorting and ValueSourceQueries) to improve both the speed for Sorting, as well as reopening of IndexReaders. But these changes have shifted the usage of FieldCache from "top level" IndexReaders (frequently a MultiReader or DirectoryReader) down to the leaf level SegmentReaders. As a result, existing applications that directly access the FieldCache may find RAM usage increase significantly when upgrading to 2.9 or Later. this class provides an API for these applications (or their Unit tests) to check at run time if the FieldCache contains "insane" usages of the FieldCache.

@lucene.experimental
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Check ( ) : Insanity[]

Tests a CacheEntry[] for indication of "insane" cache usage.

NOTE:FieldCache CreationPlaceholder objects are ignored. (:TODO: is this a bad idea? are we masking a real problem?)

CheckSanity ( ) : Insanity[]

Quick and dirty convenience method that instantiates an instance with "good defaults" and uses it to test the CacheEntrys

CheckSanity ( IFieldCache cache ) : Insanity[]

Quick and dirty convenience method

FieldCacheSanityChecker ( ) : System.Collections.Generic

Приватные методы

Метод Описание
CheckSubreaders ( FieldCache.CacheEntry>.MapOfSets valIdToItems, int>.MapOfSets readerFieldToValIds ) : ICollection

Internal helper method used by check that iterates over the keys of readerFieldToValIds and generates a Collection of Insanity instances whenever two (or more) ReaderField instances are found that have an ancestry relationships.

CheckValueMismatch ( FieldCache.CacheEntry>.MapOfSets valIdToItems, int>.MapOfSets readerFieldToValIds, ISet valMismatchKeys ) : ICollection

Internal helper method used by check that iterates over valMismatchKeys and generates a Collection of Insanity instances accordingly. The MapOfSets are used to populate the Insanity objects.

GetAllDescendantReaderKeys ( object seed ) : IList

Checks if the seed is an IndexReader, and if so will walk the hierarchy of subReaders building up a list of the objects returned by {@code seed.getCoreCacheKey()}

Описание методов

Check() публичный Метод

Tests a CacheEntry[] for indication of "insane" cache usage.

NOTE:FieldCache CreationPlaceholder objects are ignored. (:TODO: is this a bad idea? are we masking a real problem?)

public Check ( ) : Insanity[]
Результат Insanity[]

CheckSanity() публичный статический Метод

Quick and dirty convenience method that instantiates an instance with "good defaults" and uses it to test the CacheEntrys
public static CheckSanity ( ) : Insanity[]
Результат Insanity[]

CheckSanity() публичный статический Метод

Quick and dirty convenience method
public static CheckSanity ( IFieldCache cache ) : Insanity[]
cache IFieldCache
Результат Insanity[]

FieldCacheSanityChecker() публичный Метод

public FieldCacheSanityChecker ( ) : System.Collections.Generic
Результат System.Collections.Generic