redis.clients.jedis.Jedis.sinter()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中redis.clients.jedis.Jedis.sinter()方法的一些代码示例,展示了Jedis.sinter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.sinter()方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:sinter

Jedis.sinter介绍

[英]Return the members of a set resulting from the intersection of all the sets hold at the specified keys. Like in #lrange(String,long,long) the result is sent to the client as a multi-bulk reply (see the protocol specification for more information). If just a single key is specified, then this command produces the same result as #smembers(String). Actually SMEMBERS is just syntax sugar for SINTER.

Non existing keys are considered like empty sets, so if one of the keys is missing an empty set is returned (since the intersection with an empty set always is an empty set).

Time complexity O(NM) worst case where N is the cardinality of the smallest set and M the number of sets
[中]返回在指定关键点处保留的所有集合的交集所产生的集合成员。与#lrange(String,long,long)类似,结果将作为多批量回复发送到客户端(有关更多信息,请参阅协议规范)。如果只指定了一个键,则此命令将生成与#smembers(字符串)相同的结果。事实上,SMEMBERS只是烧结用的一种语法糖。
不存在的关键点被视为空集,因此如果其中一个关键点缺失,将返回一个空集(因为与空集的交集始终是空集)。
时间复杂度O(N
M)最坏情况,其中N是最小集合的基数,M是集合数

代码示例

代码示例来源:origin: sohutv/cachecloud

@Override
 public Set<String> execute(Jedis connection) {
  return connection.sinter(keys);
 }
}.run(keys.length, keys);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Set<byte[]> execute(Jedis connection) {
  return connection.sinter(keys);
 }
}.runBinary(keys.length, keys);

代码示例来源:origin: jfinal/jfinal

/**
 * 返回多个集合的交集,多个集合由 keys 指定
 */
@SuppressWarnings("rawtypes")
public Set sinter(Object... keys) {
  Jedis jedis = getJedis();
  try {
    Set<byte[]> data = jedis.sinter(keysToBytesArray(keys));
    Set<Object> result = new HashSet<Object>();
    valueSetFromBytesSet(data, result);
    return result;
  }
  finally {close(jedis);}
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Set<byte[]> sInter(byte[]... keys) {
  Assert.notNull(keys, "Keys must not be null!");
  Assert.noNullElements(keys, "Keys must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sinter(keys)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sinter(keys)));
      return null;
    }
    return connection.getJedis().sinter(keys);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
 public Set<String> execute(Jedis connection) {
  return connection.sinter(keys);
 }
}.run(keys.length, keys);

代码示例来源:origin: io.leopard/leopard-redis

@Override
  public Object execute(Jedis jedis) {
    return jedis.sinter(keys);
  }
});

代码示例来源:origin: io.leopard/leopard-redis

@Override
public Set<String> sinter(String... keys) {
  return jedis.sinter(keys);
}

代码示例来源:origin: io.leopard/leopard-redis

@Override
public Set<String> sinter(String... keys) {
  return jedis.sinter(keys);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
 public Set<byte[]> execute(Jedis connection) {
  return connection.sinter(keys);
 }
}.runBinary(keys.length, keys);

代码示例来源:origin: penggle/jedis-ms-sentinel

public Set<String> sinter(String... keys) {
  return master.sinter(keys);
}

代码示例来源:origin: penggle/jedis-ms-sentinel

public Set<byte[]> sinter(byte[]... keys) {
  return master.sinter(keys);
}

代码示例来源:origin: mindwind/craft-atom

private Set<String> sinter0(Jedis j, String... keys) {
  return j.sinter(keys);
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Set<String> sinter(String... keys) {
 String command = "sinter";
 return instrumented(command, () -> delegated.sinter(keys));
}

代码示例来源:origin: com.github.biezhi/unique-support-redis

@Override
  Set<String> execute() {
    Jedis _jedis = jedis.getShard(keys[0]);
    return _jedis.sinter(keys);
  }
}.getResult();

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Set<byte[]> sinter(byte[]... keys) {
 String command = "sinter";
 return instrumented(command, () -> delegated.sinter(keys));
}

代码示例来源:origin: wxiaoqi/ace-cache

@Override
public Set<String> sinter(String... keys) {
  Jedis jedis = null;
  Set<String> res = null;
  try {
    jedis = pool.getResource();
    res = jedis.sinter(keys);
  } catch (Exception e) {
    LOGGER.error(e.getMessage());
  } finally {
    returnResource(pool, jedis);
  }
  return res;
}

代码示例来源:origin: com.jfinal/jfinal

/**
 * 返回多个集合的交集,多个集合由 keys 指定
 */
@SuppressWarnings("rawtypes")
public Set sinter(Object... keys) {
  Jedis jedis = getJedis();
  try {
    Set<byte[]> data = jedis.sinter(keysToBytesArray(keys));
    Set<Object> result = new HashSet<Object>();
    valueSetFromBytesSet(data, result);
    return result;
  }
  finally {close(jedis);}
}

代码示例来源:origin: com.github.sogyf/goja-jfinal

/**
 * 返回多个集合的交集,多个集合由 keys 指定
 */
@SuppressWarnings("rawtypes")
public Set sinter(Object... keys) {
  Jedis jedis = getJedis();
  try {
    Set<byte[]> data = jedis.sinter(keysToBytesArray(keys));
    Set<Object> result = new HashSet<Object>();
    valueSetFromBytesSet(data, result);
    return result;
  }
  finally {close(jedis);}
}

代码示例来源:origin: yangfuhai/jboot

/**
 * 返回多个集合的交集,多个集合由 keys 指定
 */
@SuppressWarnings("rawtypes")
public Set sinter(Object... keys) {
  Jedis jedis = getJedis();
  try {
    Set<byte[]> data = jedis.sinter(keysToBytesArray(keys));
    Set<Object> result = new HashSet<Object>();
    valueSetFromBytesSet(data, result);
    return result;
  } finally {
    returnResource(jedis);
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Set<byte[]> sInter(byte[]... keys) {
  Assert.notNull(keys, "Keys must not be null!");
  Assert.noNullElements(keys, "Keys must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sinter(keys)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sinter(keys)));
      return null;
    }
    return connection.getJedis().sinter(keys);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

微信公众号

最新文章

更多

Jedis类方法