RKeys.copy method added

pull/1423/head
Nikita 7 years ago
parent ab84ad1883
commit 4e900cb412

@ -485,13 +485,23 @@ public class RedissonKeys implements RKeys {
}
@Override
public void migrate(String name, String host, int port, int database) {
commandExecutor.get(migrateAsync(name, host, port, database));
public void migrate(String name, String host, int port, int database, long timeout) {
commandExecutor.get(migrateAsync(name, host, port, database, timeout));
}
@Override
public RFuture<Void> migrateAsync(String name, String host, int port, int database) {
return commandExecutor.writeAsync(name, RedisCommands.MIGRATE, host, port, name, database);
public RFuture<Void> migrateAsync(String name, String host, int port, int database, long timeout) {
return commandExecutor.writeAsync(name, RedisCommands.MIGRATE, host, port, name, database, timeout);
}
@Override
public void copy(String name, String host, int port, int database, long timeout) {
commandExecutor.get(copyAsync(name, host, port, database, timeout));
}
@Override
public RFuture<Void> copyAsync(String name, String host, int port, int database, long timeout) {
return commandExecutor.writeAsync(name, RedisCommands.MIGRATE, host, port, name, database, timeout, "COPY");
}
@Override

@ -35,14 +35,26 @@ public interface RKeys extends RKeysAsync {
boolean move(String name, int database);
/**
* Transfer an object from source Redis instance to destination Redis instance
* Transfer object from source Redis instance to destination Redis instance
*
* @param name of object
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
*/
void migrate(String name, String host, int port, int database);
void migrate(String name, String host, int port, int database, long timeout);
/**
* Copy object from source Redis instance to destination Redis instance
*
* @param name of object
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
*/
void copy(String name, String host, int port, int database, long timeout);
/**
* Set a timeout for object. After the timeout has expired,

@ -35,15 +35,29 @@ public interface RKeysAsync {
RFuture<Boolean> moveAsync(String name, int database);
/**
* Transfer an object from source Redis instance to destination Redis instance
* Transfer object from source Redis instance to destination Redis instance
*
* @param name of object
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
* @return void
*/
RFuture<Void> migrateAsync(String name, String host, int port, int database);
RFuture<Void> migrateAsync(String name, String host, int port, int database, long timeout);
/**
* Copy object from source Redis instance to destination Redis instance
* in async mode
*
* @param name of object
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
* @return void
*/
RFuture<Void> copyAsync(String name, String host, int port, int database, long timeout);
/**
* Set a timeout for object. After the timeout has expired,

Loading…
Cancel
Save