How to get amount of all entries of a certain type from IgniteCache?

Viewed 33

I have IgniteCache<T1, T2> cache where data of different types is placed including the auth tokens of logged-in users (IgniteCache<UUID, List<'SomeObject'>>). I want to get statistic about how many authorized users I have, so I want to get from my cache all this tokens and count them. How can I do this?

1 Answers

You can issue a Scan Query where the callback will only count entries containing token.

To speed it up, you can issue an Affinity Run for every cache partition to make sure no data is sent via network.

Related