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

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

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

Jedis.sinterstore介绍

[英]This command works exactly like #sinter(String...) but instead of being returned the resulting set is stored as dstkey.

Time complexity O(NM) worst case where N is the cardinality of the smallest set and M the number of sets
[中]此命令的工作方式与#sinter(String…)完全相同但结果集并没有返回,而是存储为dstkey。
时间复杂度O(N
M)最坏情况,其中N是最小集合的基数,M是集合数

代码示例

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

@Override
 public Long execute(Jedis connection) {
  return connection.sinterstore(dstkey, keys);
 }
}.run(mergedKeys.length, mergedKeys);

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

@Override
 public Long execute(Jedis connection) {
  return connection.sinterstore(dstkey, keys);
 }
}.runBinary(wholeKeys.length, wholeKeys);

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

@Override
public Long sInterStore(byte[] destKey, byte[]... keys) {
  Assert.notNull(destKey, "Destination key must not be null!");
  Assert.notNull(keys, "Source keys must not be null!");
  Assert.noNullElements(keys, "Source keys must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sinterstore(destKey, keys)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sinterstore(destKey, keys)));
      return null;
    }
    return connection.getJedis().sinterstore(destKey, keys);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
 public Long execute(Jedis connection) {
  return connection.sinterstore(dstkey, keys);
 }
}.run(mergedKeys.length, mergedKeys);

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

@Override
 public Long execute(Jedis connection) {
  return connection.sinterstore(dstkey, keys);
 }
}.runBinary(wholeKeys.length, wholeKeys);

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

@Override
public Long sinterstore(String dstkey, String... keys) {
  return jedis.sinterstore(dstkey, keys);
}

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

@Override
public Long sinterstore(String dstkey, String... keys) {
  return jedis.sinterstore(dstkey, keys);
}

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

private Long sinterstore0(Jedis j, String destination, String... keys) {
  return j.sinterstore(destination, keys);
}

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

public Long sinterstore(String dstkey, String... keys) {
  return master.sinterstore(dstkey, keys);
}

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

public Long sinterstore(byte[] dstkey, byte[]... keys) {
  return master.sinterstore(dstkey, keys);
}

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

@Override
public Long sinterstore(String dstkey, String... keys) {
 String command = "sinterstore";
 return instrumented(command, () -> delegated.sinterstore(dstkey, keys));
}

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

@Override
public Long sinterstore(byte[] dstkey, byte[]... keys) {
 String command = "sinterstore";
 return instrumented(command, () -> delegated.sinterstore(dstkey, keys));
}

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

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

代码示例来源:origin: chenjunwen/SpringBootFrame

/**
 * <p>通过key获取指定set中的交集 并将结果存入新的set中</p>
 *
 * @param dstkey
 * @param keys   可以使一个string 也可以是一个string数组
 * @return
 */
public Long sinterstore(String dstkey, String... keys) {
  Jedis jedis = null;
  Long res = null;
  try {
    jedis = pool.getResource();
    res = jedis.sinterstore(dstkey, keys);
  } catch (Exception e) {
    LOGGER.error(e.getMessage());
  } finally {
    returnResource(pool, jedis);
  }
  return res;
}

代码示例来源:origin: appleappleapple/DistributeLearning

/**
 * <p>
 * ͨkeyȡָsetеĽ µset
 * </p>
 * 
 * @param dstkey
 * @param keys
 *            ʹһstring Ҳһstring
 * @return
 */
public Long sinterstore(String dstkey, String... keys) {
  Jedis jedis = null;
  Long res = null;
  try {
    jedis = pool.getResource();
    res = jedis.sinterstore(dstkey, keys);
  } catch (Exception e) {
    LOGGER.error(e.getMessage());
  } finally {
    returnResource(pool, jedis);
  }
  return res;
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

/**
 * This commnad works exactly like {@link #sinter(byte[]...) SINTER} but instead of being returned
 * the resulting set is sotred as dstkey.
 * <p>
 * Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the
 * number of sets
 *
 * @param dstkey
 * @param keys
 * @return Status code reply
 */
public Long sinterstore(byte[] dstkey, byte[]... keys) {
  Jedis jedis = getJedis();
  try {
    return jedis.sinterstore(dstkey, keys);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

/**
 * This commnad works exactly like {@link #sinter(String...) SINTER} but instead of being returned
 * the resulting set is sotred as dstkey.
 * <p>
 * Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the
 * number of sets
 *
 * @param dstkey
 * @param keys
 * @return Status code reply
 */
public Long sinterstore(String dstkey, String... keys) {
  Jedis jedis = getJedis();
  try {
    return jedis.sinterstore(dstkey, keys);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: youtongluan/sumk

@Override
public java.lang.Long sinterstore(byte[] dstkey, byte[]... keys) {
  Exception e1 = null;
  for (int i = 0; i < tryCount; i++) {
    Jedis jedis = null;
    try {
      jedis = pool.getResource();
      return jedis.sinterstore(dstkey, keys);
    } catch (Exception e) {
      if (isConnectException(e)) {
        Log.get(LOG_NAME).error(this.hosts + " - redis connection failed,idle=" + pool.getNumIdle()
            + ",active=" + pool.getNumActive(), e);
        e1 = e;
        continue;
      }
      Log.get(LOG_NAME).error("sinterstore - redis execute error!" + e.getMessage(), e);
      SumkException.throwException(12342411, e.getMessage(), e);
    } finally {
      close(jedis);
    }
  }
  handleRedisException(e1);
  throw new SumkException(12342423, "未知redis异常");
}

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

@Override
public Long sInterStore(byte[] destKey, byte[]... keys) {
  Assert.notNull(destKey, "Destination key must not be null!");
  Assert.notNull(keys, "Source keys must not be null!");
  Assert.noNullElements(keys, "Source keys must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sinterstore(destKey, keys)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sinterstore(destKey, keys)));
      return null;
    }
    return connection.getJedis().sinterstore(destKey, keys);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Long sInterStore(byte[] destKey, byte[]... keys) {
  Assert.notNull(destKey, "Destination key must not be null!");
  Assert.notNull(keys, "Source keys must not be null!");
  Assert.noNullElements(keys, "Source keys must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sinterstore(destKey, keys)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sinterstore(destKey, keys)));
      return null;
    }
    return connection.getJedis().sinterstore(destKey, keys);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Jedis类方法