クラス LettuceConnection
java.lang.ObjectSE
org.springframework.data.redis.connection.AbstractRedisConnection
org.springframework.data.redis.connection.lettuce.LettuceConnection
- 実装されているすべてのインターフェース:
AutoCloseableSE
、DefaultedRedisConnection
、RedisCommands
、RedisCommandsProvider
、RedisConnection
、RedisConnectionCommands
、RedisGeoCommands
、RedisHashCommands
、RedisHyperLogLogCommands
、RedisKeyCommands
、RedisListCommands
、RedisPubSubCommands
、RedisScriptingCommands
、RedisServerCommands
、RedisSetCommands
、RedisStreamCommands
、RedisStringCommands
、RedisTxCommands
、RedisZSetCommands
- 既知の直属サブクラス
LettuceClusterConnection
上に
RedisConnection
実装 Lettuce Redis クライアント。LettuceConnection
によって使用される基になる Lettuce RedisClient および StatefulRedisConnection インスタンスはスレッドセーフですが、このクラス自体はスレッドセーフではありません。Redis コマンドやその他の操作を実行するときに、LettuceConnection
のインスタンスを複数のスレッド間で共有しないでください。アプリケーションで最適なパフォーマンスが必要な場合は、基盤となる Lettuce クライアントライブラリ (ドライバー) によって提供される低レベルの API に直接アクセスすることをお勧めします。このようなスレッドセーフ保証が可能です。getNativeConnection()
を呼び出して、必要に応じてネイティブリソースを使用するだけです。
- 作成者:
- Costin Leau, Jennifer Hickey, Christoph Strobl, Thomas Darimont, David Liu, Mark Paluch, Ninad Divadkar, Tamil Selvan, ihaohong, John Blum
ネストされたクラスの要約
ネストされたクラス修飾子と型クラス説明static interface
パイプラインフラッシュの動作を制御するための戦略インターフェース。static interface
現在進行中のパイプラインのフラッシュに関連付けられている状態オブジェクト。インターフェース org.springframework.data.redis.connection.RedisGeoCommands から継承されたネストクラス / インターフェース
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgs
インターフェース org.springframework.data.redis.connection.RedisListCommands から継承されたネストクラス / インターフェース
RedisListCommands.Direction, RedisListCommands.Position
インターフェース org.springframework.data.redis.connection.RedisServerCommands から継承されたネストクラス / インターフェース
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOption
インターフェース org.springframework.data.redis.connection.RedisStreamCommands から継承されたネストクラス / インターフェース
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptions
インターフェース org.springframework.data.redis.connection.RedisStringCommands から継承されたネストクラス / インターフェース
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
インターフェース org.springframework.data.redis.connection.RedisZSetCommands から継承されたネストクラス / インターフェース
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs
コンストラクターの概要
コンストラクターコンストラクター説明LettuceConnection
(long timeout, io.lettuce.core.RedisClient client) 新しいLettuceConnection
を作成します。LettuceConnection
(io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, long timeout, io.lettuce.core.AbstractRedisClient client, int defaultDbIndex) 新しいLettuceConnection
を作成します。LettuceConnection
(io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, long timeout, io.lettuce.core.RedisClient client) 新しいLettuceConnection
を作成します。LettuceConnection
(io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, long timeout, int defaultDbIndex) 新しいLettuceConnection
を作成します。メソッドのサマリー
修飾子と型メソッド説明void
close()
接続を閉じるか終了します。パイプラインでコマンドを実行し、その結果を返します。commands()
RedisCommands
を取得します。protected DataAccessException
void
discard()
RedisTxCommands.multi()
の後に発行されたすべてのコマンドを破棄します。protected LettuceSubscription
doCreateSubscription
(MessageListener listener, io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[], byte[]> connection, LettuceConnectionProvider connectionProvider) LettuceSubscription
を作成するためのカスタマイズフック。protected io.lettuce.core.api.StatefulConnection<byte[],
byte[]> byte[]
echo
(byte[] message) サーバーラウンドトリップを介してmessage
を返します。exec()
RedisTxCommands.multi()
で開始されたトランザクションでキューに入れられたすべてのコマンドを実行します。指定された Redis コマンドと指定された引数のネイティブまたは生の実行。execute
(StringSE command, io.lettuce.core.output.CommandOutput commandOutputTypeHint, byte[]... args) 指定された引数と一緒に指定されたコマンドの「ネイティブ」または「生」の実行。RedisGeoCommands
を取得します。protected io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands<byte[],
byte[]> protected io.lettuce.core.cluster.api.sync.RedisClusterCommands<byte[],
byte[]> io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands<byte[],
byte[]> ネイティブ接続(基になるライブラリ / ドライバオブジェクト)を返します。protected RedisSentinelConnection
getSentinelConnection
(RedisNode sentinel) RedisSentinelCommands
を特定のノードに接続します。この接続の現在のサブスクリプションを返します。接続がサブスクライブされていない場合は null を返します。RedisHashCommands
を取得します。RedisHyperLogLogCommands
を取得します。protected boolean
ping を送信して、ノードがアクティブかどうかを確認します。boolean
isClosed()
基になる接続が閉じているかどうかを示します。boolean
接続が現在パイプライン化されているかどうかを示します。boolean
接続が「キュー」(または「マルチ」)モードであるかどうかを示します。boolean
現在の接続が(少なくとも 1 つのチャネルに)サブスクライブされているかどうかを示します。RedisKeyCommands
を取得します。RedisListCommands
を取得します。void
multi()
トランザクションブロックの開始をマークします。void
この接続のパイプラインモードをアクティブにします。ping()
接続のテスト。void
pSubscribe
(MessageListener listener, byte[]... patterns) 指定されたパターンに一致するすべてのチャネルへの接続をサブスクライブします。publish
(byte[] channel, byte[] message) 指定されたメッセージを指定されたチャネルに公開します。RedisScriptingCommands
を取得します。void
select
(int dbIndex) 正のdbIndex
が指定された DB を選択します。RedisServerCommands
を取得します。RedisSetCommands
を取得します。void
setConvertPipelineAndTxResults
(boolean convertPipelineAndTxResults) パイプライン化されたトランザクション結果を期待されるデータ型に変換する必要があるかどうかを指定します。void
setPipeliningFlushPolicy
(LettuceConnection.PipeliningFlushPolicy pipeliningFlushPolicy) パイプラインを使用する場合のフラッシュポリシーを構成します。RedisStreamCommands
を取得します。RedisStringCommands
を取得します。void
subscribe
(MessageListener listener, byte[]... channels) 指定されたチャネルへの接続をサブスクライブします。protected io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[],
byte[]> 現在の接続をclose()
し、Redis サーバーへの新しい pub/ サブ接続を開きます。void
unwatch()
以前のすべてのRedisTxCommands.watch(byte[]...)
キーをフラッシュします。void
watch
(byte[]... keys) RedisTxCommands.multi()
で開始されたトランザクション中の変更について、指定されたkeys
を監視します。RedisZSetCommands
を取得します。クラス org.springframework.data.redis.connection.AbstractRedisConnection から継承されたメソッド
getSentinelConnection, hasRedisSentinelConfigured, setSentinelConfiguration
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.data.redis.connection.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, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hPersist, hpExpire, hpExpire, hpExpireAt, hpExpireAt, hpTtl, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, 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, 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
インターフェース org.springframework.data.redis.connection.RedisGeoCommands から継承されたメソッド
geoAdd, geoRadiusByMember
インターフェース org.springframework.data.redis.connection.RedisHashCommands から継承されたメソッド
applyHashFieldExpiration, hExpire, hpExpire
インターフェース org.springframework.data.redis.connection.RedisKeyCommands から継承されたメソッド
applyExpiration, expire, expireAt, pExpire, pExpireAt, restore, scan
インターフェース org.springframework.data.redis.connection.RedisListCommands から継承されたメソッド
lPos
インターフェース org.springframework.data.redis.connection.RedisStreamCommands から継承されたメソッド
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending
インターフェース org.springframework.data.redis.connection.RedisStringCommands から継承されたメソッド
bitPos
インターフェース org.springframework.data.redis.connection.RedisZSetCommands から継承されたメソッド
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
コンストラクターの詳細
LettuceConnection
public LettuceConnection(long timeout, io.lettuce.core.RedisClient client) 新しいLettuceConnection
を作成します。- パラメーター:
timeout
- 接続タイムアウト (ミリ秒単位)client
- ネイティブ接続をインスタンス化するときに使用するRedisClient
LettuceConnection
public LettuceConnection(@Nullable io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, long timeout, io.lettuce.core.RedisClient client) 新しいLettuceConnection
を作成します。- パラメーター:
sharedConnection
- 他のLettuceConnection
と共有されるネイティブ接続。トランザクションやブロック操作には使用されませんtimeout
- 接続タイムアウト (ミリ秒単位)client
- pub/sub、ブロッキング、tx 接続を行うときに使用するRedisClient
LettuceConnection
public LettuceConnection(@Nullable io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, long timeout, @Nullable io.lettuce.core.AbstractRedisClient client, int defaultDbIndex) 新しいLettuceConnection
を作成します。- パラメーター:
sharedConnection
- 他のLettuceConnection
と共有されるネイティブ接続。トランザクションまたはブロック操作には使用しないでください。timeout
- 接続タイムアウト (ミリ秒単位)client
- pub/ サブ接続を行うときに使用するRedisClient
。defaultDbIndex
- 専用接続を確立するときにRedisClient
とともに使用する db インデックス。- 導入:
- 1.7
LettuceConnection
public LettuceConnection(@Nullable io.lettuce.core.api.StatefulRedisConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, long timeout, int defaultDbIndex) 新しいLettuceConnection
を作成します。- パラメーター:
sharedConnection
- 他のLettuceConnection
と共有されるネイティブ接続。トランザクションまたはブロック操作には使用しないでください。connectionProvider
- ネイティブ接続を取得および解放するための接続プロバイダー。timeout
- 接続タイムアウト (ミリ秒単位)defaultDbIndex
- 専用接続を確立するときにRedisClient
とともに使用する db インデックス。- 導入:
- 2.0
メソッドの詳細
commands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisCommands
を取得します。- 戻り値:
- 決して null にはなりません。
geoCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisGeoCommands
を取得します。- 戻り値:
- 決して null にはなりません。
hashCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisHashCommands
を取得します。- 戻り値:
- 決して null にはなりません。
hyperLogLogCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisHyperLogLogCommands
を取得します。- 戻り値:
- 決して null にはなりません。
keyCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisKeyCommands
を取得します。- 戻り値:
- 決して null にはなりません。
listCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisListCommands
を取得します。- 戻り値:
- 決して null にはなりません。
scriptingCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisScriptingCommands
を取得します。- 戻り値:
- 決して null にはなりません。
setCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisSetCommands
を取得します。- 戻り値:
- 決して null にはなりません。
serverCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisServerCommands
を取得します。- 戻り値:
- 決して null にはなりません。
streamCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisStreamCommands
を取得します。- 戻り値:
- 決して null にはなりません。
stringCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisStringCommands
を取得します。- 戻り値:
- 決して null にはなりません。
zSetCommands
インターフェースからコピーされた説明:RedisCommandsProvider
RedisZSetCommands
を取得します。- 戻り値:
- 決して null にはなりません。
convertLettuceAccessException
execute
インターフェースからコピーされた説明:RedisCommands
指定された Redis コマンドと指定された引数のネイティブまたは生の実行。コマンドは、できる限り解釈を少なくしてそのまま実行されます。引数や結果の処理は呼び出し側の責任になります。
- パラメーター:
command
- Rediscommand
SE を実行します。null であってはなりません。args
- オプションのコマンド引数の配列。空の場合もあります。- 戻り値:
- 実行結果。null の場合もあります。
execute
@Nullable public ObjectSE execute(StringSE command, @Nullable io.lettuce.core.output.CommandOutput commandOutputTypeHint, byte[]... args) 指定された引数と一緒に指定されたコマンドの「ネイティブ」または「生」の実行。- パラメーター:
command
- 実行するコマンドcommandOutputTypeHint
- 使用する出力の型は、(null の場合があります)の場合があります。args
- 可能なコマンド引数 (null の可能性があります)- 戻り値:
- 実行結果。
- 関連事項:
close
public void close()インターフェースからコピーされた説明:RedisConnection
接続を閉じるか終了します。- 次で指定:
- インターフェース
AutoCloseableSE
のclose
- 次で指定:
- インターフェース
RedisConnection
のclose
- オーバーライド:
- クラス
AbstractRedisConnection
のclose
isClosed
public boolean isClosed()インターフェースからコピーされた説明:RedisConnection
基になる接続が閉じているかどうかを示します。- 戻り値:
- 接続が閉じている場合は true、それ以外の場合は false。
getNativeConnection
public io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands<byte[],byte[]> getNativeConnection()インターフェースからコピーされた説明:RedisConnection
ネイティブ接続(基になるライブラリ / ドライバオブジェクト)を返します。- 戻り値:
- 基になるネイティブオブジェクト
isQueueing
public boolean isQueueing()インターフェースからコピーされた説明:RedisConnection
接続が「キュー」(または「マルチ」)モードであるかどうかを示します。キューイングする場合、EXEC または DISCARD コマンドが発行されるまで、すべてのコマンドが延期されます。キューイングでは結果が返されないため、接続はデータと対話するすべての操作で NULL を返します。- 戻り値:
- 接続がキュー / マルチモードの場合は true、それ以外の場合は false
isPipelined
public boolean isPipelined()インターフェースからコピーされた説明:RedisConnection
接続が現在パイプライン化されているかどうかを示します。- 戻り値:
- 接続がパイプライン化されている場合は true、それ以外の場合は false
- 関連事項:
openPipeline
public void openPipeline()インターフェースからコピーされた説明:RedisConnection
この接続のパイプラインモードをアクティブにします。パイプライン化されると、すべてのコマンドは null を返します(レスポンスはRedisConnection.closePipeline()
を介して最後に読み取られます。接続がすでにパイプライン化されているときにこのメソッドを呼び出しても効果はありません。パイプライン化は、レスポンスをすぐにリクエストせずにコマンドを発行するために使用されます。バッチ。MULTI にいくらか似ていますが、パイプラインはアトミック性を保証しません。多くのコマンドを発行するとき(バッチシナリオなど)にのみパフォーマンスを向上させようとします。注:
多くの場合、パフォーマンスのメリットは最小限ですが、使用への影響は少ないため、この機能を使用する前にパフォーマンステストを行うことを検討してください。closePipeline
インターフェースからコピーされた説明:RedisConnection
パイプラインでコマンドを実行し、その結果を返します。接続がパイプライン化されていない場合、空のコレクションが返されます。- 戻り値:
- 実行されたコマンドの結果。
echo
public byte[] echo(byte[] message) インターフェースからコピーされた説明:RedisConnectionCommands
サーバーラウンドトリップを介してmessage
を返します。- パラメーター:
message
- エコーするメッセージ。- 戻り値:
- メッセージまたはパイプライン / トランザクションで使用される場合は null。
- 関連事項:
ping
インターフェースからコピーされた説明:RedisConnectionCommands
接続のテスト。- 戻り値:
- サーバーレスポンスメッセージ - 通常は PONG。パイプライン / トランザクションで使用される場合は null。
- 関連事項:
discard
public void discard()インターフェースからコピーされた説明:RedisTxCommands
RedisTxCommands.multi()
の後に発行されたすべてのコマンドを破棄します。exec
インターフェースからコピーされた説明:RedisTxCommands
RedisTxCommands.multi()
で開始されたトランザクションでキューに入れられたすべてのコマンドを実行します。
RedisTxCommands.watch(byte[]...)
と一緒に使用する場合、監視対象のキーのいずれかが変更されていると、操作は失敗します。- 戻り値:
- 実行された各コマンドに対する応答のリスト。
- 関連事項:
multi
public void multi()インターフェースからコピーされた説明:RedisTxCommands
トランザクションブロックの開始をマークします。
コマンドはキューに入れられ、RedisTxCommands.exec()
を呼び出すことによって実行するか、RedisTxCommands.discard()
を使用してロールバックすることができます。- 関連事項:
select
public void select(int dbIndex) インターフェースからコピーされた説明:RedisConnectionCommands
正のdbIndex
が指定された DB を選択します。- パラメーター:
dbIndex
- データベースインデックス。- 関連事項:
unwatch
public void unwatch()インターフェースからコピーされた説明:RedisTxCommands
以前のすべてのRedisTxCommands.watch(byte[]...)
キーをフラッシュします。watch
public void watch(byte[]... keys) インターフェースからコピーされた説明:RedisTxCommands
RedisTxCommands.multi()
で開始されたトランザクション中の変更について、指定されたkeys
を監視します。- パラメーター:
keys
- null であってはなりません。- 関連事項:
publish
インターフェースからコピーされた説明:RedisPubSubCommands
指定されたメッセージを指定されたチャネルに公開します。- パラメーター:
channel
- 公開するチャネル。null であってはなりません。message
- 公開するメッセージ。null であってはなりません。- 戻り値:
- メッセージを受信したクライアントの数、またはパイプライン / トランザクションで使用されたときに null。
- 関連事項:
getSubscription
インターフェースからコピーされた説明:RedisPubSubCommands
この接続の現在のサブスクリプションを返します。接続がサブスクライブされていない場合は null を返します。- 戻り値:
- 現在のサブスクリプション。使用可能なサブスクリプションがない場合は null。
isSubscribed
public boolean isSubscribed()インターフェースからコピーされた説明:RedisPubSubCommands
現在の接続が(少なくとも 1 つのチャネルに)サブスクライブされているかどうかを示します。- 戻り値:
- 接続がサブスクライブされている場合は true、それ以外の場合は false
pSubscribe
インターフェースからコピーされた説明:RedisPubSubCommands
指定されたパターンに一致するすべてのチャネルへの接続をサブスクライブします。サブスクライブすると、接続はリスニングモードになり、他のチャネルにサブスクライブするか、サブスクライブを解除することしかできません。接続がサブスクライブ解除されるまで、他のコマンドは受け入れられません。この操作はブロックされており、現在のスレッドはすぐに新しいメッセージの待機を開始することに注意してください。
- パラメーター:
listener
- メッセージリスナー。null であってはなりません。patterns
- チャネル名パターン。null であってはなりません。- 関連事項:
subscribe
インターフェースからコピーされた説明:RedisPubSubCommands
指定されたチャネルへの接続をサブスクライブします。サブスクライブすると、接続はリスニングモードになり、他のチャネルにサブスクライブするか、サブスクライブを解除することしかできません。接続がサブスクライブ解除されるまで、他のコマンドは受け入れられません。この操作はブロックされており、現在のスレッドはすぐに新しいメッセージの待機を開始することに注意してください。
- パラメーター:
listener
- メッセージリスナー。null であってはなりません。channels
- チャネル名は null であってはなりません。- 関連事項:
setConvertPipelineAndTxResults
public void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults) パイプライン化されたトランザクション結果を期待されるデータ型に変換する必要があるかどうかを指定します。false の場合、closePipeline()
およびexec()
の結果は、Lettuce ドライバーによって返される型になります。- パラメーター:
convertPipelineAndTxResults
- パイプラインと tx の結果を変換するかどうか
setPipeliningFlushPolicy
パイプラインを使用する場合のフラッシュポリシーを構成します。- パラメーター:
pipeliningFlushPolicy
- コマンドが Redis 接続に書き込まれるタイミングを制御するためのフラッシュポリシー。- 導入:
- 2.3
- 関連事項:
LettuceConnection.PipeliningFlushPolicy.flushEachCommand()
openPipeline()
StatefulConnection.flushCommands()
switchToPubSub
protected io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[],byte[]> switchToPubSub()現在の接続をclose()
し、Redis サーバーへの新しい pub/ サブ接続を開きます。- 戻り値:
- 決して null にはなりません。
doCreateSubscription
protected LettuceSubscription doCreateSubscription(MessageListener listener, io.lettuce.core.pubsub.StatefulRedisPubSubConnection<byte[], byte[]> connection, LettuceConnectionProvider connectionProvider) LettuceSubscription
を作成するためのカスタマイズフック。- パラメーター:
listener
- 通知するMessageListener
。connection
- Pub/ サブ接続。connectionProvider
- 接続解放用のLettuceConnectionProvider
。- 戻り値:
LettuceSubscription
。- 導入:
- 2.2
getConnection
protected io.lettuce.core.cluster.api.sync.RedisClusterCommands<byte[],byte[]> getConnection()getAsyncDedicatedConnection
protected io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands<byte[],byte[]> getAsyncDedicatedConnection()doGetAsyncDedicatedConnection
protected io.lettuce.core.api.StatefulConnection<byte[],byte[]> doGetAsyncDedicatedConnection()isActive
クラスからコピーされた説明:AbstractRedisConnection
ping を送信して、ノードがアクティブかどうかを確認します。- オーバーライド:
- クラス
AbstractRedisConnection
のisActive
- 戻り値:
getSentinelConnection
クラスからコピーされた説明:AbstractRedisConnection
RedisSentinelCommands
を特定のノードに接続します。- オーバーライド:
- クラス
AbstractRedisConnection
のgetSentinelConnection
- 戻り値: