本文整理了Java中redis.clients.jedis.Jedis.migrate()
方法的一些代码示例,展示了Jedis.migrate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.migrate()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:migrate
暂无
代码示例来源:origin: jfinal/jfinal
/**
* 将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。
*/
public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
}
finally {close(jedis);}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
RedisClusterNode node = connection.getTopologyProvider().getTopology().lookup(target.getHost(), target.getPort());
executeCommandOnSingleNode(client -> client.migrate(target.getHost(), target.getPort(), key, dbIndex, timeoutToUse),
node);
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(
connection.getRequiredPipeline().migrate(target.getHost(), target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().migrate(target.getHost(),
target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
connection.getJedis().migrate(target.getHost(), target.getPort(), key, dbIndex, timeoutToUse);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public String migrate(String host, int port, String key, int destinationDb, int timeout) {
return jedis.migrate(host, port, key, destinationDb, timeout);
}
代码示例来源:origin: mindwind/craft-atom
private String migrate0(Jedis j, String host, int port, String key, int destinationdb, int timeout) {
return j.migrate(host, port, key, destinationdb, timeout);
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public String migrate(String host, int port, String key, int destinationDb, int timeout) {
return jedis.migrate(host, port, key, destinationDb, timeout);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public String migrate(byte[] host, int port, byte[] key, int destinationDb, int timeout) {
String command = "migrate";
return instrumented(command, () -> delegated.migrate(host, port, key, destinationDb, timeout));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public String migrate(String host, int port, String key, int destinationDb, int timeout) {
String command = "migrate";
return instrumented(command, () -> delegated.migrate(host, port, key, destinationDb, timeout));
}
代码示例来源:origin: io.enoa/nosql-redis
default String migrate(String host, int port, String key, int destinationDb, int timeout) {
return this.run((jedis, serializer) -> jedis.migrate(host, port, key, destinationDb, timeout));
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public String migrate(String host, int port, String key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(host, port, key, destinationDb, timeout);
} finally {Streams.safeClose(jedis);}
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public String migrate(byte[] host, int port, byte[] key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(host, port, key, destinationDb, timeout);
} finally {Streams.safeClose(jedis);}
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option,
long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
RedisClusterNode node = connection.getTopologyProvider().getTopology().lookup(target.getHost(), target.getPort());
executeCommandOnSingleNode(client -> client.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(),
key, dbIndex, timeoutToUse), node);
}
代码示例来源:origin: yangfuhai/jboot
/**
* 将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。
*/
public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
} finally {
returnResource(jedis);
}
}
代码示例来源:origin: com.github.sogyf/goja-jfinal
/**
* 将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。
*/
public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
}
finally {close(jedis);}
}
代码示例来源:origin: com.jfinal/jfinal
/**
* 将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。
*/
public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
}
finally {close(jedis);}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option,
long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
RedisClusterNode node = connection.getTopologyProvider().getTopology().lookup(target.getHost(), target.getPort());
executeCommandOnSingleNode(client -> client.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(),
key, dbIndex, timeoutToUse), node);
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline()
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction()
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
connection.getJedis().migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex,
timeoutToUse);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(target, "Target node must not be null!");
int timeoutToUse = timeout <= Integer.MAX_VALUE ? (int) timeout : Integer.MAX_VALUE;
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline()
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction()
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
return;
}
connection.getJedis().migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex,
timeoutToUse);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
内容来源于网络,如有侵权,请联系作者删除!