0

I have a use case where I want to create a co-occurrence matrix. Essentially it is going to be something like Map<String, Map<String, Long>>. I wish to use Chronicle-Map for this task.

I checked Multimaps in ChronicleMap and https://github.com/OpenHFT/Chronicle-Map/issues/100. However, I am unable to follow the discussion to make a suitable change.

It would be also okay to have it like a multi-key like Map<String, String, Long> . I looked up the graph example of add and remove edge (in chronicle-map tutorial) which was again too detailed and complicated for me to adapt to my setting.

The way this will be used is to query:

  1. Getting the long value for a very specific combination if key1 and key2.
  2. For a specific key1 return all the key2 along with their respective long value.

Can someone please advise and provide a simple working example.

1 Answers1

1

You need to create a MapMarshaller based on the source of SetMarshaller (yes, it's going to be even more complicated). Or use a Pair<String, String> as a key.

leventov
  • 14,760
  • 11
  • 69
  • 98