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

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

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

JedisCluster.lpushx介绍

暂无

代码示例

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

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

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

public Long lpushx(String key, String... string) {
  return jedisCluster.lpushx(key, string);
}

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

/**
 * 将值 value 插入到列表 key 的表头
 * @param key
 * @param value
 * @return 列表长度
 */
public long lpushx(String key,String value){
  return jedisCluster.lpushx(key, value);
}
/**

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

@Override
public Long lpushx(byte[] bytes, byte[]... bytes1) {
  return cluster.lpushx(bytes, bytes1);
}

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

public Long lpushx(byte[] key, byte[]... string) {
  return jedisCluster.lpushx(key, string);
}

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

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

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

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

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

@Override
public Long lpushx(String key, String... values) {
  return jedisCluster.lpushx(SafeEncoder.encode(key), SafeEncoder.encodeMany(values));
}

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

@Override
public <T> Long lpushx(Class<T> clazz, String key, T... values) {
  try {
    byte[][] bytes = new byte[values.length][];
    for (int i = 0; i < values.length; i++) {
      bytes[i] = getRedisBuffer().write(values[i]);
    }
    return jedisCluster.lpushx(SafeEncoder.encode(key), bytes);
  } catch (IOException e) {
    logger.error(e.getMessage(), e);
    return 0l;
  }
}

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

for (String value : values) {
  if (pushed == 0) {
    pushed += cluster.lpushx(key, value);
  } else if (cluster.lpushx(key, value) > 0) {
    pushed++;

相关文章

微信公众号

最新文章

更多

JedisCluster类方法