org.springframework.data.redis.connection.RedisServerCommands Java Examples

The following examples show how to use org.springframework.data.redis.connection.RedisServerCommands. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingShutdownCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.SHUTDOWN, () -> getConnection().shutdown());
  verify(mockRedisConnection()).shutdown();

  commandCreatesNewSpan(RedisCommand.SHUTDOWN,
      () -> getConnection().shutdown(RedisServerCommands.ShutdownOption.SAVE));
  verify(mockRedisConnection()).shutdown(RedisServerCommands.ShutdownOption.SAVE);
}
 
Example #2
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingMigrateCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.MIGRATE,
      () -> getConnection().migrate("key".getBytes(), null, 0,
          RedisServerCommands.MigrateOption.REPLACE));
  verify(mockRedisConnection())
      .migrate("key".getBytes(), null, 0, RedisServerCommands.MigrateOption.REPLACE);

  commandCreatesNewSpan(RedisCommand.MIGRATE,
      () -> getConnection().migrate("key".getBytes(), null, 0,
          RedisServerCommands.MigrateOption.REPLACE, 0L));
  verify(mockRedisConnection())
      .migrate("key".getBytes(), null, 0, RedisServerCommands.MigrateOption.REPLACE, 0L);
}
 
Example #3
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingShutdownCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.SHUTDOWN, () -> getConnection().shutdown());
  verify(mockRedisConnection()).shutdown();

  commandCreatesNewSpan(RedisCommand.SHUTDOWN,
      () -> getConnection().shutdown(RedisServerCommands.ShutdownOption.SAVE));
  verify(mockRedisConnection()).shutdown(RedisServerCommands.ShutdownOption.SAVE);
}
 
Example #4
Source File: TracingRedisConnectionTest.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Test
public void invokingMigrateCreatesNewSpan() {
  commandCreatesNewSpan(RedisCommand.MIGRATE,
      () -> getConnection().migrate("key".getBytes(), null, 0,
          RedisServerCommands.MigrateOption.REPLACE));
  verify(mockRedisConnection())
      .migrate("key".getBytes(), null, 0, RedisServerCommands.MigrateOption.REPLACE);

  commandCreatesNewSpan(RedisCommand.MIGRATE,
      () -> getConnection().migrate("key".getBytes(), null, 0,
          RedisServerCommands.MigrateOption.REPLACE, 0L));
  verify(mockRedisConnection())
      .migrate("key".getBytes(), null, 0, RedisServerCommands.MigrateOption.REPLACE, 0L);
}
 
Example #5
Source File: TracingRedisConnection.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public RedisServerCommands serverCommands() {
  return connection.serverCommands();
}
 
Example #6
Source File: RedisRepository.java    From microservices-platform with Apache License 2.0 2 votes vote down vote up
/**
 * 集合数量
 *
 * @return the long
 */
public long dbSize() {
    return redisTemplate.execute(RedisServerCommands::dbSize);
}
 
Example #7
Source File: RedisRepository.java    From SpringBoot2.0 with Apache License 2.0 2 votes vote down vote up
/**
 * 集合数量
 *
 * @return the long
 */
public long dbSize() {
    return redisTemplate.execute(RedisServerCommands::dbSize);
}
 
Example #8
Source File: TarocoRedisRepository.java    From Taroco with Apache License 2.0 2 votes vote down vote up
/**
 * 集合数量
 *
 * @return the long
 */
public long dbSize() {
    return redisTemplate.execute(RedisServerCommands::dbSize);
}
 
Example #9
Source File: TarocoRedisRepository.java    From Taroco with Apache License 2.0 2 votes vote down vote up
/**
 * 集合数量
 *
 * @return the long
 */
public long dbSize() {
    return redisTemplate.execute(RedisServerCommands::dbSize);
}