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

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

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

JedisCluster.lset介绍

暂无

代码示例

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

@Override
public void lSet(byte[] key, long index, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    connection.getCluster().lset(key, index, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

/**
 * 将列表 key 下标为 index 的元素的值设置为 value 
 * 当 index 参数超出范围,或对一个空列表( key 不存在)进行 LSET 时,返回一个错误
 * @param key
 * @param index
 * @param value
 * @return
 */
public String lset(String key,long index,String value){
  return jedisCluster.lset(key, index, value);
}
/**

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

@Override
public String lset(byte[] bytes, long l, byte[] bytes1) {
  return cluster.lset(bytes, l, bytes1);
}

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

public String lset(String key, long index, String value) {
  return jedisCluster.lset(key, index, value);
}

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

public String lset(byte[] key, long index, byte[] value) {
  return jedisCluster.lset(key, index, value);
}

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

@Override
public void lSet(byte[] key, long index, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    connection.getCluster().lset(key, index, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public void lSet(byte[] key, long index, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    connection.getCluster().lset(key, index, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

/**
 * 将列表 key 下标为 index 的元素的值设置为 value 。
 * 当 index 参数超出范围,或对一个空列表( key 不存在)进行 LSET 时,返回一个错误。
 * 关于列表下标的更多信息,请参考 LINDEX 命令。
 */
public String lset(Object key, long index, Object value) {
  return jedisCluster.lset(keyToBytes(key), index, valueToBytes(value));
}

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

@Override
public <T> String lset(Class<T> clazz, String key, int index, T value) {
  try {
    byte[] bytes = getRedisBuffer().write(value);
    return jedisCluster.lset(SafeEncoder.encode(key), index, bytes);
  } catch (IOException e) {
    logger.error(e.getMessage(), e);
    return null;
  }
}

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

@Override
public String lset(String key, int index, String value) {
  return jedisCluster.lset(SafeEncoder.encode(key), index, SafeEncoder.encode(value));
}

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

@Override
public boolean lset(final String key, final int index, final String value) {
  Assert.hasText(key);
  Assert.hasText(value);
  try {
    return isOK(cluster.lset(key, index, value));
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

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

/**
 * 将列表 key 下标为 index 的元素的值设置为 value 。
 * 当 index 参数超出范围,或对一个空列表( key 不存在)进行 LSET 时,返回一个错误。
 * 关于列表下标的更多信息,请参考 LINDEX 命令。
 */
public boolean lset(Object key, Object obj, int index) {
  if (null == key || null == obj) {
    return false;
  }
  if (cluster) {
    return jedisCluster.lset(serializeKey(key), index, serializeVal(obj)).equals("OK");
  } else {
    return jedisOperator.lset(serializeKey(key), index, serializeVal(obj)).equals("OK");
  }
}

相关文章

微信公众号

最新文章

更多

JedisCluster类方法