Skip to content

Commit 5f48e35

Browse files
committed
Add a comment that explains this cache
1 parent de52716 commit 5f48e35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public class PolicyStepsRegistry {
6767
// keeps track of a mapping from policy/step-name to respective Step, the key is policy name
6868
private final Map<String, Map<Step.StepKey, Step>> stepMap;
6969

70+
// tracks an index->step cache, where the indexmetadata is also tracked for cache invalidation/eviction purposes.
71+
// for a given index, the step can be cached as long as the indexmetadata (and the policy!) hasn't changed. since
72+
// policies change infrequently, the entire cache is cleared on policy change.
7073
private final Map<Index, Tuple<IndexMetadata, Step>> cachedSteps = new ConcurrentHashMap<>();
7174

7275
public PolicyStepsRegistry(NamedXContentRegistry xContentRegistry, Client client, XPackLicenseState licenseState) {

0 commit comments

Comments
 (0)