Skip to content

Commit 7cd8db9

Browse files
committed
Improve performance of LettuceProvider by using HLEN instead of HKEYS
1 parent 0ca34b1 commit 7cd8db9

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

proxy/src/main/java/com/velocityctd/proxy/redis/provider/LettuceProvider.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,19 @@ public void upsert(@NotNull V value) {
486486
*/
487487
@Override
488488
public Collection<V> values() {
489-
return depotCommands.hvals(this.name).stream().map(this::deserialize).toList();
489+
return depotCommands.hvals(this.name).stream()
490+
.map(this::deserialize)
491+
.toList();
492+
}
493+
494+
/**
495+
* Returns the number of entries stored in this depot.
496+
*
497+
* @return the number of entries in this depot
498+
*/
499+
@Override
500+
public int size() {
501+
return depotCommands.hlen(this.name).intValue();
490502
}
491503

492504
/**

0 commit comments

Comments
 (0)