インターフェース RedisConnection
- すべてのスーパーインターフェース:
AutoCloseableSE, DefaultedRedisConnection, RedisCommands, RedisCommandsProvider, RedisConnectionCommands, RedisGeoCommands, RedisHashCommands, RedisHyperLogLogCommands, RedisKeyCommands, RedisListCommands, RedisPubSubCommands, RedisScriptingCommands, RedisServerCommands, RedisSetCommands, RedisStreamCommands, RedisStringCommands, RedisTxCommands, RedisZSetCommands
- すべての既知のサブインターフェース:
RedisClusterConnection, RedisConnectionUtils.RedisConnectionProxy, StringRedisConnection
- すべての既知の実装クラス:
AbstractRedisConnection, DefaultStringRedisConnection, JedisClusterConnection, JedisConnection, LettuceClusterConnection, LettuceConnection
@NullUnmarked
public interface RedisConnection
extends RedisCommandsProvider, DefaultedRedisConnection, AutoCloseableSE
Redis サーバーへの接続。
RedisConnection インターフェースは、さまざまな Redis クライアントライブラリ (またはドライバー) にわたる共通の抽象化として機能します。
さらに、基礎となる Redis クライアントライブラリと Spring DAO 例外の間の例外変換を実行します。このメソッドは、可能な限り Redis の名前と規則に従います。
Redis connections とは異なり、おそらくその基礎となるネイティブ接続はスレッドセーフではないため、複数のスレッド間で同時または同時に共有すべきではありません。
Redis コマンドメソッドは、戻り値が null 値ではないというデフォルトの仮定から除外されます。これは、null 値かどうかはコマンドだけでなく接続状態にも依存するためです。トランザクション中またはパイプライン処理中に呼び出されるメソッドは、コマンド呼び出し時に null を返す必要があります。これは、トランザクションが実行されるかパイプラインが閉じられるまでレスポンスが得られないためです。呼び出しコードでの過剰な null チェックを回避し、null 値ではないという誤った仮定を明示しないために、すべてのコマンドインターフェースには @NullUnmarked アノテーションが付けられます。
- 作成者:
- Costin Leau, Christoph Strobl, Mark Paluch, James Howe, John Blum
ネストされたクラスの要約
インターフェース RedisGeoCommands から継承されたネストクラス / インターフェース
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgsインターフェース RedisHashCommands から継承されたネストクラス / インターフェース
RedisHashCommands.HashFieldSetOptionインターフェース RedisListCommands から継承されたネストクラス / インターフェース
RedisListCommands.Direction, RedisListCommands.Positionインターフェース RedisServerCommands から継承されたネストクラス / インターフェース
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOptionインターフェース RedisStreamCommands から継承されたネストクラス / インターフェース
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptionsインターフェース RedisStringCommands から継承されたネストクラス / インターフェース
RedisStringCommands.BitOperation, RedisStringCommands.SetOptionインターフェース RedisZSetCommands から継承されたネストクラス / インターフェース
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgsメソッドのサマリー
インターフェース DefaultedRedisConnection から継承されたメソッド
append, applyHashFieldExpiration, bgReWriteAof, bgSave, bitCount, bitCount, bitField, bitOp, bitPos, bLMove, bLPop, bRPop, bRPopLPush, bZPopMax, bZPopMin, copy, dbSize, decr, decrBy, del, dump, encodingOf, eval, evalSha, evalSha, exists, exists, expire, expire, expireAt, expireAt, flushAll, flushAll, flushDb, flushDb, geoAdd, geoAdd, geoAdd, geoDist, geoDist, geoHash, geoPos, geoRadius, geoRadius, geoRadiusByMember, geoRadiusByMember, geoRemove, geoSearch, geoSearchStore, get, getBit, getClientList, getClientName, getConfig, getDel, getEx, getRange, getSet, hDel, hExists, hExpire, hExpire, hExpireAt, hExpireAt, hGet, hGetAll, hGetDel, hGetEx, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hPersist, hpExpire, hpExpire, hpExpireAt, hpExpireAt, hpTtl, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, hSetEx, hSetNX, hStrLen, hTtl, hTtl, hVals, idletime, incr, incrBy, incrBy, info, info, keys, killClient, lastSave, lIndex, lInsert, lLen, lMove, lPop, lPop, lPos, lPush, lPushX, lRange, lRem, lSet, lTrim, mGet, migrate, migrate, move, mSet, mSetNX, persist, pExpire, pExpire, pExpireAt, pExpireAt, pfAdd, pfCount, pfMerge, pSetEx, pTtl, pTtl, randomKey, refcount, rename, renameNX, replicaOf, replicaOfNoOne, resetConfigStats, restore, rewriteConfig, rPop, rPop, rPopLPush, rPush, rPushX, sAdd, save, scan, sCard, scriptExists, scriptFlush, scriptKill, scriptLoad, sDiff, sDiffStore, set, set, setBit, setClientName, setConfig, setEx, setGet, setNX, setRange, shutdown, shutdown, sInter, sInterCard, sInterStore, sIsMember, sMembers, sMIsMember, sMove, sort, sort, sPop, sPop, sRandMember, sRandMember, sRem, sScan, strLen, sUnion, sUnionStore, time, time, touch, ttl, ttl, type, unlink, xAck, xAdd, xClaim, xClaimJustId, xDel, xGroupCreate, xGroupCreate, xGroupDelConsumer, xGroupDestroy, xInfo, xInfoConsumers, xInfoGroups, xLen, xPending, xPending, xRange, xRange, xRead, xRead, xReadGroup, xReadGroup, xRevRange, xRevRange, xTrim, xTrim, zAdd, zAdd, zCard, zCount, zCount, zDiff, zDiffStore, zDiffWithScores, zIncrBy, zInter, zInterStore, zInterStore, zInterStore, zInterWithScores, zInterWithScores, zInterWithScores, zLexCount, zMScore, zPopMax, zPopMax, zPopMin, zPopMin, zRandMember, zRandMember, zRandMemberWithScore, zRandMemberWithScore, zRange, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByLex, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByLex, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnion, zUnionStore, zUnionStore, zUnionStore, zUnionWithScores, zUnionWithScores, zUnionWithScoresインターフェース RedisCommands から継承されたメソッド
executeインターフェース RedisCommandsProvider から継承されたメソッド
commands, geoCommands, hashCommands, hyperLogLogCommands, keyCommands, listCommands, scriptingCommands, serverCommands, setCommands, streamCommands, stringCommands, zSetCommandsインターフェース RedisConnectionCommands から継承されたメソッド
echo, ping, selectインターフェース RedisGeoCommands から継承されたメソッド
geoAdd, geoRadiusByMemberインターフェース RedisHashCommands から継承されたメソッド
applyHashFieldExpiration, hExpire, hpExpireインターフェース RedisKeyCommands から継承されたメソッド
applyExpiration, expire, expireAt, pExpire, pExpireAt, restore, scanインターフェース RedisListCommands から継承されたメソッド
lPosインターフェース RedisPubSubCommands から継承されたメソッド
getSubscription, isSubscribed, pSubscribe, publish, subscribeインターフェース RedisStreamCommands から継承されたメソッド
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending, xPending, xPending, xPendingインターフェース RedisStringCommands から継承されたメソッド
bitPosインターフェース RedisZSetCommands から継承されたメソッド
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
メソッドの詳細
close
接続を閉じるか終了します。- 次で指定:
- インターフェース
AutoCloseableSEのclose - 例外:
DataAccessException-RedisConnectionを閉じることができなかった場合。
isClosed
boolean isClosed()基になる接続が閉じているかどうかを示します。- 戻り値:
- 接続が閉じている場合は true、それ以外の場合は false。
getNativeConnection
isQueueing
boolean isQueueing()接続が「キュー」(または「マルチ」)モードであるかどうかを示します。キューイングする場合、EXEC または DISCARD コマンドが発行されるまで、すべてのコマンドが延期されます。キューイングでは結果が返されないため、接続はデータと対話するすべての操作で NULL を返します。- 戻り値:
- 接続がキュー / マルチモードの場合は true、それ以外の場合は false
isPipelined
boolean isPipelined()接続が現在パイプライン化されているかどうかを示します。- 戻り値:
- 接続がパイプライン化されている場合は true、それ以外の場合は false
- 関連事項:
openPipeline
void openPipeline()この接続のパイプラインモードをアクティブにします。パイプライン化されると、すべてのコマンドは null を返します(レスポンスはclosePipeline()を介して最後に読み取られます。接続がすでにパイプライン化されているときにこのメソッドを呼び出しても効果はありません。パイプライン化は、レスポンスをすぐにリクエストせずにコマンドを発行するために使用されます。バッチ。MULTI にいくらか似ていますが、パイプラインはアトミック性を保証しません。多くのコマンドを発行するとき(バッチシナリオなど)にのみパフォーマンスを向上させようとします。注:
多くの場合、パフォーマンスのメリットは最小限ですが、使用への影響は少ないため、この機能を使用する前にパフォーマンステストを行うことを検討してください。- 関連事項:
closePipeline
パイプラインでコマンドを実行し、その結果を返します。接続がパイプライン化されていない場合、空のコレクションが返されます。- 戻り値:
- 実行されたコマンドの結果。
- 例外:
RedisPipelineException- パイプラインに不正 / 無効なステートメントが含まれている場合
getSentinelConnection
RedisSentinelConnection getSentinelConnection()- 戻り値:
- Redis Sentinel 使用時は
RedisSentinelConnection。 - 導入:
- 1.4