Reputation: 313
I need to migrate from Redis to Oracle Coherence and looking for the best way to replicate Redis's RScoredSortedSet
functionality. Take a look at the below code:
private RScoredSortedSet<Long> getScoredSet(String key) {
RScoredSortedSet<Long> rssSet = redissonClient.getScoredSortedSet(key);
if(!rssSet.isExists()) {
RLock lock = redissonClient.getLock("lockKey");
if(lock.tryLock(1, 20, TimeUnit.SECONDS)) {
try {
rssSet.clear();
// Add score-value pairs
rssSet.add(score, value);
} finally {
lock.unlock();
}
}
}
return rssSet;
}
My Question:
I'm new to Coherence and Any guidance on how to achieve this in Coherence would be much appreciated.
Upvotes: 0
Views: 33