Example usage for org.springframework.data.redis.connection.jedis JedisClientUtils execute

List of usage examples for org.springframework.data.redis.connection.jedis JedisClientUtils execute

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection.jedis JedisClientUtils execute.

Prototype

static <T> T execute(String command, byte[][] keys, byte[][] args, Supplier<Jedis> jedis,
        Function<Client, T> responseMapper) 

Source Link

Document

Execute an arbitrary on the supplied Jedis instance.

Usage

From source file:org.springframework.data.redis.connection.jedis.JedisClusterConnection.java

@Nullable
<T> T execute(String command, byte[] key, Collection<byte[]> args, Function<Client, T> responseMapper) {

    Assert.notNull(command, "Command must not be null!");
    Assert.notNull(key, "Key must not be null!");
    Assert.notNull(args, "Args must not be null!");

    byte[][] commandArgs = getCommandArguments(key, args);

    RedisClusterNode keyMaster = topologyProvider.getTopology().getKeyServingMasterNode(key);

    return clusterCommandExecutor.executeCommandOnSingleNode(
            (JedisClusterCommandCallback<T>) client -> JedisClientUtils.execute(command, EMPTY_2D_BYTE_ARRAY,
                    commandArgs, () -> client, responseMapper),
            keyMaster).getValue();//ww  w . j a  v a  2  s .  co  m
}