Common methods
Each Redisson object implements RObject and RExpirable interfaces.
Usage example:
RObject object = redisson.get...()
object.sizeInMemory();
object.delete();
object.rename("newname");
object.isExists();
// listening to expired events
object.addListener((ExpiredObjectListener) name -> {
//...
});
// listening to delete events
object.addListener((DeletedObjectListener) name -> {
//...
});
Name of Redisson object is a key in Redis or Valkey.
Global operations over keys are exposed by RKeys interface. Usage example:
RKeys keys = redisson.getKeys();
Iterable<String> allKeys = keys.getKeys();
Iterable<String> foundedKeys = keys.getKeysByPattern('key*');
long numOfDeletedKeys = keys.delete("obj1", "obj2", "obj3");
long deletedKeysAmount = keys.deleteByPattern("test?");
String randomKey = keys.randomKey();
long keysAmount = keys.count();
keys.flushall();
keys.flushdb();
Usage example: