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

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

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

JedisCluster.spop介绍

暂无

代码示例

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

@Override
public List<byte[]> sPop(byte[] key, long count) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return new ArrayList<>(connection.getCluster().spop(key, count));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public byte[] sPop(byte[] key) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().spop(key);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: hhfcyong/xxxx-dubbo

/**
 * 移除并返回集合中的一个随机元素
 * @param key
 * @return 被移除的随机元素,当 key 不存在或 key 是空集时,返回 nil 
 */
public String spop(String key){
  return jedisCluster.spop(key);
}
/**

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public byte[] spop(byte[] bytes) {
  return cluster.spop(bytes);
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Set<byte[]> spop(byte[] bytes, long l) {
  return cluster.spop(bytes, l);
}

代码示例来源:origin: hhfcyong/xxxx-dubbo

/**
 * 移除并返回集合中的一个随机元素
 * @param key
 * @return 被移除的随机元素,当 key 不存在或 key 是空集时,返回 nil 
 */
public Set<String> spop(String key,long count){
  return jedisCluster.spop(key, count);
}
/**

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

public byte[] spop(byte[] key) {
  return jedisCluster.spop(key);
}

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

public Set<byte[]> spop(byte[] key, long count) {
  return jedisCluster.spop(key, count);
}

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

public String spop(String key) {
  return jedisCluster.spop(key);
}

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

public Set<String> spop(String key, long count) {
  return jedisCluster.spop(key, count);
}

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

@Override
public List<byte[]> sPop(byte[] key, long count) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return new ArrayList<>(connection.getCluster().spop(key, count));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public List<byte[]> sPop(byte[] key, long count) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return new ArrayList<>(connection.getCluster().spop(key, count));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public byte[] sPop(byte[] key) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().spop(key);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public String spop(final String key) {
  Assert.hasText(key);
  try {
    return cluster.spop(key);
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public Set<String> spop(final String key, final int count) {
  Assert.hasText(key);
  try {
    return cluster.spop(key, count);
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

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

@Override
public byte[] sPop(byte[] key) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().spop(key);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

/**
 * 移除并返回集合中的一个随机元素。
 * 如果只想获取一个随机元素,但不想该元素从集合中被移除的话,可以使用 SRANDMEMBER 命令。
 */
@SuppressWarnings("unchecked")
public <T> T spop(Object key) {
  return (T) valueFromBytes(jedisCluster.spop(keyToBytes(key)));
}

代码示例来源:origin: com.github.yamingd.argo/argo-redis

@Override
public String spop(String key) {
  byte[] bytes = jedisCluster.spop(SafeEncoder.encode(key));
  if (bytes == null){
    return null;
  }
  return SafeEncoder.encode(bytes);
}

代码示例来源:origin: yrain/smart-cache

/**
 * 移除并返回集合中的一个随机元素。
 * 如果只想获取一个随机元素,但不想该元素从集合中被移除的话,可以使用 SRANDMEMBER 命令。
 */
@SuppressWarnings("unchecked")
public <E> E spop(Object key) {
  if (null == key) {
    return null;
  }
  if (cluster) {
    return (E) deserializeVal(jedisCluster.spop(serializeKey(key)));
  } else {
    return (E) deserializeVal(jedisOperator.spop(serializeKey(key)));
  }
}

相关文章

微信公众号

最新文章

更多

JedisCluster类方法