diff --git a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/QueryIndex.java b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/QueryIndex.java index fd486e2e5..609a67a0e 100644 --- a/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/QueryIndex.java +++ b/spectator-reg-atlas/src/main/java/com/netflix/spectator/atlas/impl/QueryIndex.java @@ -106,16 +106,26 @@ private static int compare(String k1, String k2) { private volatile String key; + // Checks for :eq clauses private final ConcurrentHashMap> equalChecks; + // Checks for other key queries, e.g. :re, :in, :gt, :lt, etc. Prefix tree is used to + // filter regex and in clauses. The matching is cached to avoid expensive regex checks + // as much as possible. private final ConcurrentHashMap> otherChecks; private final PrefixTree otherChecksTree; private final Cache>> otherChecksCache; + // Index for :has queries private volatile QueryIndex hasKeyIdx; + + // Index for queries that do not have a clause for a given key private volatile QueryIndex otherKeysIdx; + + // Index for :not queries to capture entries where a key is missing private volatile QueryIndex missingKeysIdx; + // Matches for this level of the tree private final Set matches; /** Create a new instance. */