0

Is there any function like cache.containsAffinity(T myField) to check if such affinity value exists in the cache?

For example, I set cache config like this: <AffinityKey<String>, Object>, and write data using streamer:

streamer.addData(new AffinityKey<>(idKey1, "a"), obj)

streamer.addData(new AffinityKey<>(idKey2, "b"), obj)

streamer.addData(new AffinityKey<>(idKey3, "c"), obj)

How can I check if affinity value "a" exists in the cache and has related data entries, while affinity "f" has no related data?

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Vincent Y
  • 109
  • 6

1 Answers1

0

You can just to do cache.get(new AffinityKey<>(idKey1, "a")) and check returned value

solveMe
  • 1,866
  • 1
  • 18
  • 20