diff --git a/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisClient.java b/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisClient.java index 3df7c543..2d743d86 100644 --- a/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisClient.java +++ b/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisClient.java @@ -15,6 +15,7 @@ ******************************************************************************/ package com.netflix.dyno.jedis; +import com.google.common.collect.Sets; import com.netflix.discovery.DiscoveryClient; import com.netflix.discovery.EurekaClient; import com.netflix.dyno.connectionpool.*; @@ -26,12 +27,13 @@ import com.netflix.dyno.connectionpool.impl.lb.HttpEndpointBasedTokenMapSupplier; import com.netflix.dyno.connectionpool.impl.utils.CollectionUtils; import com.netflix.dyno.connectionpool.impl.utils.ZipUtils; -import com.netflix.dyno.contrib.*; - +import com.netflix.dyno.contrib.ArchaiusConnectionPoolConfiguration; +import com.netflix.dyno.contrib.DynoCPMonitor; +import com.netflix.dyno.contrib.DynoOPMonitor; +import com.netflix.dyno.contrib.EurekaHostsSupplier; import org.slf4j.Logger; - -import redis.clients.jedis.BinaryClient.LIST_POSITION; import redis.clients.jedis.*; +import redis.clients.jedis.BinaryClient.LIST_POSITION; import redis.clients.jedis.params.geo.GeoRadiusParam; import redis.clients.jedis.params.sortedset.ZAddParams; import redis.clients.jedis.params.sortedset.ZIncrByParams; @@ -2593,7 +2595,13 @@ public Long msetnx(String... keysvalues) { @Override public Set sinter(String... keys) { - throw new UnsupportedOperationException("not yet implemented"); + Set allResults = d_smembers(keys[0]).getResult(); + //loop through keys and intersect to a set, use d_smembers + for(int i = 1; i < keys.length; i++) { + allResults = Sets.intersection(allResults, d_smembers(keys[i]).getResult()); + } + + return allResults; } public Long sinterstore(final String dstkey, final String... keys) { @@ -2612,7 +2620,14 @@ public Long sort(String key, String dstkey) { @Override public Set sunion(String... keys) { - throw new UnsupportedOperationException("not yet implemented"); + Set allResults = new HashSet(); + //loop through keys and append to a set, use d_smembers + for(String key : keys) { + OperationResult> results = d_smembers(key); + allResults.addAll(results.getResult()); + } + + return allResults; } @Override