org.springframework.data.redis.connection.RedisConnection.exists()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(169)

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

RedisConnection.exists介绍

暂无

代码示例

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

@Override
public Long exists(byte[]... keys) {
  return convertAndReturn(delegate.exists(keys), identityConverter);
}

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

@Override
public Boolean exists(byte[] key) {
  return convertAndReturn(delegate.exists(key), identityConverter);
}

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

boolean doCheckLock(String name, RedisConnection connection) {
  return connection.exists(createCacheLockKey(name));
}

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

@Override
public Long countExistingKeys(Collection<K> keys) {
  Assert.notNull(keys, "Keys must not be null!");
  byte[][] rawKeys = rawKeys(keys);
  return execute(connection -> connection.exists(rawKeys), true);
}

代码示例来源:origin: apache/nifi

@Override
public <K> boolean containsKey(final K key, final Serializer<K> keySerializer) throws IOException {
  return withConnection(redisConnection -> {
    final byte[] k = serialize(key, keySerializer);
    return redisConnection.exists(k);
  });
}

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

@Override
public Boolean hasKey(K key) {
  byte[] rawKey = rawKey(key);
  return execute(connection -> connection.exists(rawKey), true);
}

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

@Override
public Long exists(String... keys) {
  return convertAndReturn(delegate.exists(serializeMulti(keys)), identityConverter);
}

代码示例来源:origin: zhangxd1989/springboot-dubbox

/**
 * 判断某个主键是否存在
 *
 * @param key the key
 * @return the boolean
 */
public boolean exists(final String key) {
  return redisTemplate.execute((RedisCallback<Boolean>) connection -> connection.exists(key.getBytes(DEFAULT_CHARSET)));
}

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

toBytes(":"), value);
if (connection.exists(existingValueIndexKey)) {
  redisUpdateObject.addIndexToUpdate(new RedisUpdateObject.Index(existingValueIndexKey, DataType.SET));
        toBytes(":"), value);
    if (connection.exists(existingValueIndexKey)) {
      redisUpdateObject.addIndexToUpdate(new RedisUpdateObject.Index(existingValueIndexKey, DataType.SET));

代码示例来源:origin: bill1012/AdminEAP

public Boolean doInRedis(RedisConnection connection)
      throws DataAccessException {
    RedisSerializer<String> serializer = getRedisSerializer();
    byte[] keyStr = serializer.serialize(key);
    return connection.exists(keyStr);
  }
});

代码示例来源:origin: souyunku/SpringBootExamples

/**
 * 判断是否缓存了数据
 *
 * @param key 数据KEY
 * @return 判断是否缓存了
 */
public static boolean isCached(String key) {
  return cacheUtils.redisTemplate.execute((RedisCallback<Boolean>) connection -> {
    return connection.exists(key.getBytes());
  });
}

代码示例来源:origin: liuht777/Taroco

/**
 * 判断某个主键是否存在
 *
 * @param key the key
 * @return the boolean
 */
public boolean exists(final String key) {
  return redisTemplate.execute((RedisCallback<Boolean>) connection -> connection.exists(key.getBytes(DEFAULT_CHARSET)));
}

代码示例来源:origin: com.y3tu/y3tu-tool-web

/**
 * 判断某个主键是否存在
 *
 * @param key the key
 * @return the boolean
 */
public boolean exists(final String key) {
  return redisTemplate.execute((RedisCallback<Boolean>) connection -> connection.exists(key.getBytes(DEFAULT_CHARSET)));
}

代码示例来源:origin: org.hsweb/hsweb-web-core

@Override
public boolean isLogin(String userId) {
  return (Boolean) sessionRedisTemplate.execute((RedisCallback) connection ->
      connection.exists(("http.session.user:" + userId).getBytes())
  );
}

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

@Override
public Boolean exists(byte[] key) {
  return convertAndReturn(delegate.exists(key), identityConverter);
}

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

@Override
public Boolean exists(byte[] key) {
  return convertAndReturn(delegate.exists(key), identityConverter);
}

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

@Override
public Long exists(byte[]... keys) {
  return convertAndReturn(delegate.exists(keys), identityConverter);
}

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

@Override
public Long countExistingKeys(Collection<K> keys) {
  Assert.notNull(keys, "Keys must not be null!");
  byte[][] rawKeys = rawKeys(keys);
  return execute(connection -> connection.exists(rawKeys), true);
}

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

@Override
public Boolean hasKey(K key) {
  byte[] rawKey = rawKey(key);
  return execute(connection -> connection.exists(rawKey), true);
}

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

@Override
public Long exists(String... keys) {
  return convertAndReturn(delegate.exists(serializeMulti(keys)), identityConverter);
}

相关文章

微信公众号

最新文章

更多

RedisConnection类方法