インターフェース RedisKeyCommands
- すべての既知のサブインターフェース:
DefaultedRedisClusterConnection
、DefaultedRedisConnection
、RedisClusterConnection
、RedisCommands
、RedisConnection
、RedisConnectionUtils.RedisConnectionProxy
、StringRedisConnection
- すべての既知の実装クラス:
AbstractRedisConnection
、DefaultStringRedisConnection
、JedisClusterConnection
、JedisConnection
、LettuceClusterConnection
、LettuceConnection
public interface RedisKeyCommands
Redis でサポートされているキー固有のコマンド。
- 作成者:
- Costin Leau, Christoph Strobl, Mark Paluch, ihaohong
メソッドのサマリー
修飾子と型メソッド説明default BooleanSE
applyExpiration
(byte[] key, Expiration expiration, ExpirationOptions options) copy
(byte[] sourceKey, byte[] targetKey, boolean replace) 指定されたsourceKey
をtargetKey
にコピーします。del
(byte[]... keys) 指定されたkeys
を削除します。byte[]
dump
(byte[] key) key
に格納されている値の直列化されたバージョンを取得します。encodingOf
(byte[] key) 指定されたkey
で値を格納するために使用される内部表現の型を取得します。default BooleanSE
exists
(byte[] key) 指定されたkey
が存在するかどうかを判別します。exists
(byte[]... keys) 指定されたkeys
がいくつ存在するかを数えます。default BooleanSE
expire
(byte[] key, long seconds) 指定されたkey
の存続時間を秒単位で設定します。expire
(byte[] key, long seconds, ExpirationOptions.Condition condition) 指定されたkey
の存続時間を秒単位で設定します。default BooleanSE
expire
(byte[] key, DurationSE duration) seconds
精度を使用して、指定されたkey
の有効期間を設定します。default BooleanSE
expireAt
(byte[] key, long unixTime) 指定されたkey
の有効期限を UNIX タイムスタンプとして設定します。expireAt
(byte[] key, long unixTime, ExpirationOptions.Condition condition) 指定されたkey
の有効期限を UNIX タイムスタンプとして設定します。default BooleanSE
Set the expiration for givenkey
as a UNIX timestamp inseconds
precision.idletime
(byte[] key) 指定されたkey
に格納されているオブジェクトがアイドル状態であるため、Duration
SE を取得します。SetSE<byte[]>
keys
(byte[] pattern) 指定されたpattern
に一致するすべてのキーを検索します。move
(byte[] key, int dbIndex) 指定されたkey
をindex
を使用してデータベースに移動します。persist
(byte[] key) 指定されたkey
から有効期限を削除します。default BooleanSE
pExpire
(byte[] key, long millis) 特定のkey
の存続時間をミリ秒単位で設定します。pExpire
(byte[] key, long millis, ExpirationOptions.Condition condition) 特定のkey
の存続時間をミリ秒単位で設定します。default BooleanSE
pExpire
(byte[] key, DurationSE duration) milliseconds
精度を使用して、指定されたkey
の有効期間を設定します。default BooleanSE
pExpireAt
(byte[] key, long unixTimeInMillis) 指定されたkey
の有効期限を UNIX タイムスタンプとしてミリ秒単位で設定します。pExpireAt
(byte[] key, long unixTimeInMillis, ExpirationOptions.Condition condition) 指定されたkey
の有効期限を UNIX タイムスタンプとしてミリ秒単位で設定します。default BooleanSE
Set the expiration for givenkey
as a UNIX timestamp inmilliseconds
precision.pTtl
(byte[] key) key
の正確な存続時間をミリ秒単位で取得します。pTtl
(byte[] key, TimeUnitSE timeUnit) key
の正確な存続時間を取得し、指定されたTimeUnit
SE に変換します。byte[]
キースペースからランダムなキーを返します。refcount
(byte[] key) 指定されたkey
に関連付けられた値の参照の数を取得します。void
rename
(byte[] oldKey, byte[] newKey) キーoldKey
の名前をnewKey
に変更します。renameNX
(byte[] oldKey, byte[] newKey) newKey
が存在しない場合にのみ、キーoldKey
の名前をnewKey
に変更します。default void
restore
(byte[] key, long ttlInMillis, byte[] serializedValue) void
restore
(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) default Cursor<byte[]>
scan
(KeyScanOptions options) Cursor
を使用して、キーを繰り返し処理します。Cursor<byte[]>
scan
(ScanOptions options) Cursor
を使用して、キーを繰り返し処理します。ListSE<byte[]>
sort
(byte[] key, SortParameters params) key
の要素を並べ替えます。sort
(byte[] key, SortParameters params, byte[] storeKey) key
の要素を並べ替え、結果をstoreKey
に保存します。touch
(byte[]... keys) 指定されたkey(s)
の最終アクセス時間を変更します。ttl
(byte[] key) key
の存続時間を数秒で取得します。ttl
(byte[] key, TimeUnitSE timeUnit) key
の存続時間を取得し、指定されたTimeUnit
SE に変換します。type
(byte[] key) key
に保存されている型を判別します。unlink
(byte[]... keys) キースペースからkeys
のリンクを解除します。
メソッドの詳細
copy
指定されたsourceKey
をtargetKey
にコピーします。- パラメーター:
sourceKey
- null であってはなりません。targetKey
- null であってはなりません。replace
- 既存のキーを置き換えるかどうか。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 導入:
- 2.6
- 関連事項:
exists
指定されたkey
が存在するかどうかを判別します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- キーが存在する場合は true。パイプライン / トランザクションで使用される場合は null。
- 関連事項:
exists
指定されたkeys
がいくつ存在するかを数えます。まったく同じkey
を複数回提供することも、複数回カウントされます。- パラメーター:
keys
- null であってはなりません。- 戻り値:
- 引数として指定されたキーの中に存在するキーの数。パイプライン / トランザクションで使用される場合は null。
- 導入:
- 2.1
del
指定されたkeys
を削除します。- パラメーター:
keys
- null であってはなりません。- 戻り値:
- 削除されたキーの数。パイプライン / トランザクションで使用される場合は null。
- 関連事項:
unlink
キースペースからkeys
のリンクを解除します。del(byte[]...)
とは異なり、ここでの実際のメモリの再利用は非同期で行われます。- パラメーター:
keys
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 導入:
- 2.1
- 関連事項:
type
key
に保存されている型を判別します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
touch
指定されたkey(s)
の最終アクセス時間を変更します。- パラメーター:
keys
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 導入:
- 2.1
- 関連事項:
keys
指定されたpattern
に一致するすべてのキーを検索します。- パラメーター:
pattern
- null であってはなりません。- 戻り値:
- 一致するものが見つからない場合は、
Set
SE を空にします。パイプライン / トランザクションで使用される場合は null。 - 関連事項:
scan
Cursor
を使用して、キーを繰り返し処理します。- パラメーター:
options
- null であってはなりません。- 戻り値:
- 決して null にはなりません。
- 導入:
- 2.4
- 関連事項:
scan
Cursor
を使用して、キーを繰り返し処理します。- パラメーター:
options
- null であってはなりません。- 戻り値:
- 決して null にはなりません。
- 導入:
- 1.4
- 関連事項:
randomKey
キースペースからランダムなキーを返します。- 戻り値:
- 使用可能なキーがない場合、またはパイプラインまたはトランザクションで使用される場合は null。
- 関連事項:
rename
void rename(byte[] oldKey, byte[] newKey) キーoldKey
の名前をnewKey
に変更します。- パラメーター:
oldKey
- null であってはなりません。newKey
- null であってはなりません。- 関連事項:
renameNX
newKey
が存在しない場合にのみ、キーoldKey
の名前をnewKey
に変更します。- パラメーター:
oldKey
- null であってはなりません。newKey
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
applyExpiration
@Nullable default BooleanSE applyExpiration(byte[] key, Expiration expiration, ExpirationOptions options) - パラメーター:
key
- null であってはなりません。expiration
- 適用するExpiration
options
- additional options to be sent along with the command.- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
expire
指定されたkey
の存続時間を秒単位で設定します。- パラメーター:
key
- null であってはなりません。seconds
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 関連事項:
expire
指定されたkey
の存続時間を秒単位で設定します。- パラメーター:
key
- null であってはなりません。seconds
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
expire
seconds
精度を使用して、指定されたkey
の有効期間を設定します。- パラメーター:
key
- null であってはなりません。duration
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
pExpire
特定のkey
の存続時間をミリ秒単位で設定します。- パラメーター:
key
- null であってはなりません。millis
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 関連事項:
pExpire
特定のkey
の存続時間をミリ秒単位で設定します。- パラメーター:
key
- null であってはなりません。millis
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
pExpire
milliseconds
精度を使用して、指定されたkey
の有効期間を設定します。- パラメーター:
key
- null であってはなりません。duration
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
expireAt
指定されたkey
の有効期限を UNIX タイムスタンプとして設定します。- パラメーター:
key
- null であってはなりません。unixTime
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 関連事項:
expireAt
指定されたkey
の有効期限を UNIX タイムスタンプとして設定します。- パラメーター:
key
- null であってはなりません。unixTime
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
expireAt
Set the expiration for givenkey
as a UNIX timestamp inseconds
precision.- パラメーター:
key
- null であってはなりません。unixTime
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
pExpireAt
指定されたkey
の有効期限を UNIX タイムスタンプとしてミリ秒単位で設定します。- パラメーター:
key
- null であってはなりません。unixTimeInMillis
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 関連事項:
pExpireAt
@Nullable BooleanSE pExpireAt(byte[] key, long unixTimeInMillis, ExpirationOptions.Condition condition) 指定されたkey
の有効期限を UNIX タイムスタンプとしてミリ秒単位で設定します。- パラメーター:
key
- null であってはなりません。unixTimeInMillis
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
pExpireAt
Set the expiration for givenkey
as a UNIX timestamp inmilliseconds
precision.- パラメーター:
key
- null であってはなりません。unixTime
-- 戻り値:
- null when used in pipeline / transaction. true if the timeout was set or false if the timeout was not set; for example, the key doesn't exist, or the operation was skipped because of the provided arguments.
- 導入:
- 3.5
- 関連事項:
persist
指定されたkey
から有効期限を削除します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
move
指定されたkey
をindex
を使用してデータベースに移動します。- パラメーター:
key
- null であってはなりません。dbIndex
-- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
ttl
key
の存続時間を数秒で取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
ttl
key
の存続時間を取得し、指定されたTimeUnit
SE に変換します。- パラメーター:
key
- null であってはなりません。timeUnit
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 導入:
- 1.8
- 関連事項:
pTtl
key
の正確な存続時間をミリ秒単位で取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
pTtl
key
の正確な存続時間を取得し、指定されたTimeUnit
SE に変換します。- パラメーター:
key
- null であってはなりません。timeUnit
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 導入:
- 1.8
- 関連事項:
sort
key
の要素を並べ替えます。- パラメーター:
key
- null であってはなりません。params
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
sort
key
の要素を並べ替え、結果をstoreKey
に保存します。- パラメーター:
key
- null であってはなりません。params
- null であってはなりません。storeKey
- null であってはなりません。- 戻り値:
- パイプライン / トランザクションで使用される場合は null。
- 関連事項:
dump
key
に格納されている値の直列化されたバージョンを取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- キーが存在しない場合、またはパイプライン / トランザクションで使用される場合は null。
- 関連事項:
restore
default void restore(byte[] key, long ttlInMillis, byte[] serializedValue) - パラメーター:
key
- null であってはなりません。ttlInMillis
-serializedValue
- null であってはなりません。- 関連事項:
restore
void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) - パラメーター:
key
- null であってはなりません。ttlInMillis
-serializedValue
- null であってはなりません。replace
- エラーの代わりに true を使用して、存在する可能性のある値を置き換えます。- 導入:
- 2.1
- 関連事項:
encodingOf
指定されたkey
で値を格納するために使用される内部表現の型を取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- キーが存在しない場合は
ValueEncoding.RedisValueEncoding.VACANT
、パイプライン / トランザクションで使用される場合は null。 - 例外:
IllegalArgumentExceptionSE
-key
が null の場合。- 導入:
- 2.1
- 関連事項:
idletime
指定されたkey
に格納されているオブジェクトがアイドル状態であるため、Duration
SE を取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- キーが存在しない場合、またはパイプライン / トランザクションで使用される場合は null。
- 例外:
IllegalArgumentExceptionSE
-key
が null の場合。- 導入:
- 2.1
- 関連事項:
refcount
指定されたkey
に関連付けられた値の参照の数を取得します。- パラメーター:
key
- null であってはなりません。- 戻り値:
- キーが存在しない場合、またはパイプライン / トランザクションで使用される場合は null。
- 例外:
IllegalArgumentExceptionSE
-key
が null の場合。- 導入:
- 2.1
- 関連事項: