|
73 | 73 | * customisation. On a 32Gb heap, a 10% cache would be 3.2Gb which is large enough to store BitSets representing 25 billion docs. |
74 | 74 | * <p> |
75 | 75 | * However, because queries can be templated by user metadata and that metadata can change frequently, it is common for the |
76 | | - * effetively lifetime of a single DLS query to be relatively short. We do not want to sacrifice 10% of heap to a cache that is storing |
77 | | - * BitSets that are not longer needed, so we set the TTL on this cache to be 2 hours ({@link #CACHE_TTL_SETTING}). This time has been |
| 76 | + * effective lifetime of a single DLS query to be relatively short. We do not want to sacrifice 10% of heap to a cache that is storing |
| 77 | + * BitSets that are no longer needed, so we set the TTL on this cache to be 2 hours ({@link #CACHE_TTL_SETTING}). This time has been |
78 | 78 | * chosen so that it will retain BitSets that are in active use during a user's session, but not be an ongoing drain on memory. |
79 | 79 | * |
80 | 80 | * @see org.elasticsearch.index.cache.bitset.BitsetFilterCache |
@@ -171,7 +171,7 @@ private void onCacheEviction(RemovalNotification<BitsetCacheKey, BitSet> notific |
171 | 171 | } |
172 | 172 | // We push this to a background thread, so that it reduces the risk of blocking searches, but also so that the lock management is |
173 | 173 | // simpler - this callback is likely to take place on a thread that is actively adding something to the cache, and is therefore |
174 | | - // holding the read ("update") side of the lock. It is not possible to upgrade a read lock to a write ("eviction") lock, but we |
| 174 | + // holding the read ("update") side of the lock. It is not possible to upgrade a read lock to a write lock ("eviction"), but we |
175 | 175 | // need to acquire that lock here. |
176 | 176 | cleanupExecutor.submit(() -> { |
177 | 177 | try (ReleasableLock ignored = cacheEvictionLock.acquire()) { |
@@ -214,7 +214,7 @@ public long ramBytesUsed() { |
214 | 214 | /** |
215 | 215 | * Obtain the {@link BitSet} for the given {@code query} in the given {@code context}. |
216 | 216 | * If there is a cached entry for that query and context, it will be returned. |
217 | | - * Otherwise a new BitSet will be created and stored in the cache. |
| 217 | + * Otherwise, a new BitSet will be created and stored in the cache. |
218 | 218 | * The returned BitSet may be null (e.g. if the query has no results). |
219 | 219 | */ |
220 | 220 | @Nullable |
|
0 commit comments