Skip to content

Instantly share code, notes, and snippets.

@gb103
Last active October 30, 2021 05:47
Show Gist options
  • Save gb103/1e362bc0cec78b9ad2d27fae0c646761 to your computer and use it in GitHub Desktop.
Save gb103/1e362bc0cec78b9ad2d27fae0c646761 to your computer and use it in GitHub Desktop.
/**
* sortedScoreTreeSet : Keep all score entries into sorted order.
* trackScoreShuffler : Provide the Map of uniqueue Id and their timestamp based on score, it
* provides the uniqueue Id for the oldest entry for given score. As there can be multiple item of same score,
* that's why used linkedHashMap
* trackScoreMap : Used to check if a item entry is present into the queue and return the item
*/
private var sortedScoreTreeSet //<score>
: TreeSet<Float>
private var trackScoreShuffler // <score, LinkedHashMap<uniqueId, timestamp>
: ConcurrentHashMap<Float, LinkedHashMap<String, Long>>
private var trackScoreMap //<uniqueId, OESFeedItem>
: ConcurrentHashMap<String, T>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment