All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.commands.SetBinaryCommands Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package redis.clients.jedis.commands;

import java.util.List;
import java.util.Set;

import redis.clients.jedis.params.ScanParams;
import redis.clients.jedis.resps.ScanResult;

public interface SetBinaryCommands {

  long sadd(byte[] key, byte[]... members);

  Set smembers(byte[] key);

  long srem(byte[] key, byte[]... members);

  byte[] spop(byte[] key);

  Set spop(byte[] key, long count);

  long scard(byte[] key);

  boolean sismember(byte[] key, byte[] member);

  List smismember(byte[] key, byte[]... members);

  byte[] srandmember(byte[] key);

  List srandmember(byte[] key, int count);

  default ScanResult sscan(byte[] key, byte[] cursor) {
    return sscan(key, cursor, new ScanParams());
  }

  ScanResult sscan(byte[] key, byte[] cursor, ScanParams params);

  Set sdiff(byte[]... keys);

  long sdiffstore(byte[] dstkey, byte[]... keys);

  Set sinter(byte[]... keys);

  long sinterstore(byte[] dstkey, byte[]... keys);

  /**
   * This command works exactly like {@link SetBinaryCommands#sinter(byte[][]) SINTER} but instead of returning
   * the result set, it returns just the cardinality of the result. LIMIT defaults to 0 and means unlimited
   * 

* Time complexity O(N*M) worst case where N is the cardinality of the smallest * @param keys * @return The cardinality of the set which would result from the intersection of all the given sets */ long sintercard(byte[]... keys); /** * This command works exactly like {@link SetBinaryCommands#sinter(byte[][]) SINTER} but instead of returning * the result set, it returns just the cardinality of the result. *

* Time complexity O(N*M) worst case where N is the cardinality of the smallest * @param limit If the intersection cardinality reaches limit partway through the computation, * the algorithm will exit and yield limit as the cardinality. * @param keys * @return The cardinality of the set which would result from the intersection of all the given sets */ long sintercard(int limit, byte[]... keys); Set sunion(byte[]... keys); long sunionstore(byte[] dstkey, byte[]... keys); long smove(byte[] srckey, byte[] dstkey, byte[] member); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy