[
https://issues.apache.org/jira/browse/GEODE-8089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102254#comment-17102254
]
ASF GitHub Bot commented on GEODE-8089:
---------------------------------------
dschneider-pivotal commented on a change in pull request #5058:
URL: https://github.com/apache/geode/pull/5058#discussion_r421936016
##########
File path:
geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/RedisSet.java
##########
@@ -98,6 +102,156 @@ public static boolean del(Region<ByteArrayWrapper,
RedisSet> region,
}
}
+ public static int scard(Region<ByteArrayWrapper, RedisSet> region,
ByteArrayWrapper key) {
+ RedisSet redisSet = region.get(key);
+ if (redisSet != null) {
+ return redisSet.size();
+ } else {
+ return -1;
+ }
+ }
+
+ public static boolean sismember(Region<ByteArrayWrapper, RedisSet> region,
+ ByteArrayWrapper key, ByteArrayWrapper member) {
+ RedisSet redisSet = region.get(key);
+ if (redisSet != null) {
+ return redisSet.contains(member);
+ } else {
+ return false;
+ }
+ }
+
+ public static Collection<ByteArrayWrapper>
srandmember(Region<ByteArrayWrapper, RedisSet> region,
+ ByteArrayWrapper key, int count) {
+ RedisSet redisSet = region.get(key);
+ if (redisSet != null) {
+ return redisSet.srandmember(count);
+ } else {
+ return null;
+ }
+ }
+
+ public static Collection<ByteArrayWrapper> spop(Region<ByteArrayWrapper,
RedisSet> region,
+ ByteArrayWrapper key, int popCount) {
+ RedisSet redisSet = region.get(key);
+ if (redisSet != null) {
+ return redisSet.doSpop(region, key, popCount);
+ } else {
+ return null;
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> change more redis set commands to use function and deltas
> ---------------------------------------------------------
>
> Key: GEODE-8089
> URL: https://issues.apache.org/jira/browse/GEODE-8089
> Project: Geode
> Issue Type: Improvement
> Components: redis
> Reporter: Darrel Schneider
> Priority: Major
>
> GEODE-8048 was a good start of a new implementation of redis sets but it only
> did 4 of the set commands.
> All the redis set commands should use functions and deltas in their
> implementation.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)