public interface DatabaseCommands
Modifier and Type | Method and Description |
---|---|
boolean |
copy(byte[] srcKey,
byte[] dstKey,
int db,
boolean replace)
Binary version of
COPY . |
boolean |
copy(java.lang.String srcKey,
java.lang.String dstKey,
int db,
boolean replace)
Copy the value stored at the source key to the destination key.
|
long |
dbSize()
Return the number of keys in the currently-selected database.
|
java.lang.String |
flushDB()
Delete all the keys of the currently selected DB.
|
java.lang.String |
flushDB(FlushMode flushMode)
Delete all the keys of the currently selected DB.
|
java.lang.String |
migrate(java.lang.String host,
int port,
byte[] key,
int destinationDB,
int timeout)
Binary version of
MIGRATE . |
java.lang.String |
migrate(java.lang.String host,
int port,
int destinationDB,
int timeout,
MigrateParams params,
byte[]... keys)
Binary version of
MIGRATE . |
java.lang.String |
migrate(java.lang.String host,
int port,
int destinationDB,
int timeout,
MigrateParams params,
java.lang.String... keys)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
java.lang.String |
migrate(java.lang.String host,
int port,
java.lang.String key,
int destinationDB,
int timeout)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
long |
move(byte[] key,
int dbIndex)
Binary version of
MOVE . |
long |
move(java.lang.String key,
int dbIndex)
Move the specified key from the currently selected DB to the specified destination DB.
|
java.lang.String |
select(int index)
Select the DB with having the specified zero-based numeric index.
|
java.lang.String |
swapDB(int index1,
int index2)
This command swaps two Redis databases, so that immediately all the clients connected to a
given database will see the data of the other database, and the other way around.
|
java.lang.String select(int index)
index
- the indexlong dbSize()
java.lang.String flushDB()
java.lang.String flushDB(FlushMode flushMode)
flushMode
- can be SYNC or ASYNCjava.lang.String swapDB(int index1, int index2)
index1
- index2
- long move(java.lang.String key, int dbIndex)
key
- The specified keydbIndex
- Specified destination databaselong move(byte[] key, int dbIndex)
MOVE
.move(String, int)
boolean copy(java.lang.String srcKey, java.lang.String dstKey, int db, boolean replace)
srcKey
- the source key.dstKey
- the destination key.db
- allows specifying an alternative logical database index for the destination key.replace
- removes the destination key before copying the value to it, in order to avoid error.boolean copy(byte[] srcKey, byte[] dstKey, int db, boolean replace)
COPY
.copy(String, String, int, boolean)
java.lang.String migrate(java.lang.String host, int port, java.lang.String key, int destinationDB, int timeout)
host
- target hostport
- target portkey
- migrate keydestinationDB
- target dbtimeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.java.lang.String migrate(java.lang.String host, int port, byte[] key, int destinationDB, int timeout)
MIGRATE
.migrate(String, int, String, int, int)
java.lang.String migrate(java.lang.String host, int port, int destinationDB, int timeout, MigrateParams params, java.lang.String... keys)
host
- target hostport
- target portdestinationDB
- target dbtimeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.params
- MigrateParams
keys
- to migratejava.lang.String migrate(java.lang.String host, int port, int destinationDB, int timeout, MigrateParams params, byte[]... keys)
MIGRATE
.Copyright © 2023. All rights reserved.