K
- Key type.V
- Value type.public interface StatefulRedisClusterConnection<K,V> extends StatefulConnection<K,V>
Modifier and Type | Method and Description |
---|---|
RedisAdvancedClusterAsyncCommands<K,V> |
async()
Returns the
RedisAdvancedClusterAsyncCommands API for the current connection. |
StatefulRedisConnection<K,V> |
getConnection(String nodeId)
Retrieve a connection to the specified cluster node using the nodeId.
|
StatefulRedisConnection<K,V> |
getConnection(String host,
int port)
Retrieve a connection to the specified cluster node using host and port.
|
Partitions |
getPartitions() |
ReadFrom |
getReadFrom()
Gets the
ReadFrom setting for this connection. |
RedisAdvancedClusterReactiveCommands<K,V> |
reactive()
Returns the
RedisAdvancedClusterReactiveCommands API for the current connection. |
void |
setReadFrom(ReadFrom readFrom)
Set from which nodes data is read.
|
RedisAdvancedClusterCommands<K,V> |
sync()
Returns the
RedisAdvancedClusterCommands API for the current connection. |
close, dispatch, flushCommands, getOptions, getTimeout, getTimeoutUnit, isOpen, reset, setAutoFlushCommands, setTimeout
RedisAdvancedClusterCommands<K,V> sync()
RedisAdvancedClusterCommands
API for the current connection. Does not create a new connection.RedisAdvancedClusterAsyncCommands<K,V> async()
RedisAdvancedClusterAsyncCommands
API for the current connection. Does not create a new connection.RedisAdvancedClusterReactiveCommands<K,V> reactive()
RedisAdvancedClusterReactiveCommands
API for the current connection. Does not create a new
connection.StatefulRedisConnection<K,V> getConnection(String nodeId)
nodeId
, that behavior can also lead to a closed connection once the node with the
specified nodeId
is no longer part of the cluster.
Do not close the connections. Otherwise, unpredictable behavior will occur. The nodeId must be part of the cluster and is
validated against the current topology view in Partitions
.
In contrast to the StatefulRedisClusterConnection
, node-connections do not route commands to other cluster nodes.nodeId
- the node IdRedisException
- if the requested node identified by nodeId
is not part of the clusterStatefulRedisConnection<K,V> getConnection(String host, int port)
host
and port
,
are no longer part of the cluster.
Do not close the connections. Otherwise, unpredictable behavior will occur. Host and port connections are verified by
default for cluster membership, see ClusterClientOptions.isValidateClusterNodeMembership()
.
In contrast to the StatefulRedisClusterConnection
, node-connections do not route commands to other cluster nodes.host
- the hostport
- the portRedisException
- if the requested node identified by host
and port
is not part of the clustervoid setReadFrom(ReadFrom readFrom)
ReadFrom
for more information.readFrom
- the read from setting, must not be nullReadFrom getReadFrom()
ReadFrom
setting for this connection. Defaults to ReadFrom.MASTER
if not set.Partitions getPartitions()
Copyright © 2018 lettuce.io. All rights reserved.