Interface TransactionalRedisDataSource
- All Known Implementing Classes:
BlockingTransactionalRedisDataSourceImpl
MULTI
).
Note that the results of the enqueued commands are not available until the completion of the transaction.-
Method Summary
Modifier and TypeMethodDescriptiondefault TransactionalAutoSuggestCommands<String>
Gets the object to emit commands from theauto-suggest
group.autosuggest
(Class<K> redisKeyType) Gets the object to emit commands from theauto-suggest
group.default TransactionalBitMapCommands<String>
bitmap()
Gets the object to execute commands manipulating bitmap data structures.<K> TransactionalBitMapCommands<K>
Gets the object to execute commands manipulating bitmap data structures.<K,
V> TransactionalBloomCommands<K, V> Gets the object to manipulate Bloom filters.default <V> TransactionalBloomCommands<String,
V> Gets the object to manipulate Bloom filters.<K,
V> TransactionalCountMinCommands<K, V> Gets the object to manipulate Count-Min sketches.default <V> TransactionalCountMinCommands<String,
V> Gets the object to manipulate Count-Min sketches.<K,
V> TransactionalCuckooCommands<K, V> Gets the object to manipulate Cuckoo filters.default <V> TransactionalCuckooCommands<String,
V> Gets the object to manipulate Cuckoo filters.void
discard()
Discard the current transaction.boolean
Checks if the current transaction has been discarded by the uservoid
Executes a command.void
Executes a command.void
Executes a command.<K,
V> TransactionalGeoCommands<K, V> Gets the object to execute commands manipulating geo items (a.k.a.default <V> TransactionalGeoCommands<String,
V> Gets the object to execute commands manipulating geo items (a.k.a.default TransactionalGraphCommands<String>
graph()
Gets the object to manipulate graphs.<K> TransactionalGraphCommands<K>
Gets the object to manipulate graphs.<K,
F, V> TransactionalHashCommands<K, F, V> Gets the object to execute commands manipulating hashes (a.k.a.default <V> TransactionalHashCommands<String,
String, V> Gets the object to execute commands manipulating hashes (a.k.a.<K,
V> TransactionalHyperLogLogCommands<K, V> hyperloglog
(Class<K> redisKeyType, Class<V> memberType) Gets the object to execute commands manipulating hyperloglog data structures.default <V> TransactionalHyperLogLogCommands<String,
V> hyperloglog
(Class<V> memberType) Gets the object to execute commands manipulating hyperloglog data structures.default TransactionalJsonCommands<String>
json()
Gets the object to manipulate JSON values.<K> TransactionalJsonCommands<K>
Gets the object to manipulate JSON values.default TransactionalKeyCommands<String>
key()
Gets the object to execute commands manipulating keys and expiration times.<K> TransactionalKeyCommands<K>
Gets the object to execute commands manipulating keys and expiration times.<K,
V> TransactionalListCommands<K, V> Gets the object to execute commands manipulating lists.default <V> TransactionalListCommands<String,
V> Gets the object to execute commands manipulating lists.default TransactionalSearchCommands
search()
Gets the object to emit commands from thesearch
group.Gets the object to emit commands from thesearch
group.<K,
V> TransactionalSetCommands<K, V> Gets the object to execute commands manipulating sets.default <V> TransactionalSetCommands<String,
V> Gets the object to execute commands manipulating sets.<K,
V> TransactionalSortedSetCommands<K, V> Gets the object to execute commands manipulating sorted sets.default <V> TransactionalSortedSetCommands<String,
V> Gets the object to execute commands manipulating sorted sets.<K,
F, V> TransactionalStreamCommands<K, F, V> Gets the object to execute commands manipulating streams.default <V> TransactionalStreamCommands<String,
String, V> Gets the object to execute commands manipulating stream..<K,
V> TransactionalStringCommands<K, V> Deprecated.default <V> TransactionalStringCommands<String,
V> Deprecated.Usevalue(Class)
insteaddefault TransactionalTimeSeriesCommands<String>
Gets the object to emit commands from thetime series
group.timeseries
(Class<K> redisKeyType) Gets the object to emit commands from thetime series
group.<K,
V> TransactionalTopKCommands<K, V> Gets the object to manipulate Top-K list.default <V> TransactionalTopKCommands<String,
V> Gets the object to manipulate Top-K list.<K,
V> TransactionalValueCommands<K, V> Gets the object to execute commands manipulating stored strings.default <V> TransactionalValueCommands<String,
V> Gets the object to execute commands manipulating stored strings.
-
Method Details
-
discard
void discard()Discard the current transaction. -
discarded
boolean discarded()Checks if the current transaction has been discarded by the user- Returns:
- if the current transaction has been discarded by the user
-
hash
<K,F, TransactionalHashCommands<K,V> F, hashV> (Class<K> redisKeyType, Class<F> typeOfField, Class<V> typeOfValue) Gets the object to execute commands manipulating hashes (a.k.a.Map<F, V>
).If you want to use a hash of
<String -> Person>
stored using String identifier, you would use:hash(String.class, String.class, Person.class)
. If you want to use a hash of<String -> Person>
stored using UUID identifier, you would use:hash(UUID.class, String.class, Person.class)
.- Type Parameters:
K
- the type of the redis keyF
- the type of the fields (map's keys)V
- the type of the value- Parameters:
redisKeyType
- the class of the keystypeOfField
- the class of the fieldstypeOfValue
- the class of the values- Returns:
- the object to execute commands manipulating hashes (a.k.a.
Map<K, V>
).
-
hash
Gets the object to execute commands manipulating hashes (a.k.a.Map<String, V>
).This is a shortcut on
hash(String.class, String.class, V)
- Type Parameters:
V
- the type of the value- Parameters:
typeOfValue
- the class of the values- Returns:
- the object to execute commands manipulating hashes (a.k.a.
Map<String, V>
).
-
geo
Gets the object to execute commands manipulating geo items (a.k.a.{longitude, latitude, member}
).V
represents the type of the member, i.e. the localized thing.- Type Parameters:
K
- the type of the redis keyV
- the type of the member- Parameters:
redisKeyType
- the class of the keysmemberType
- the class of the members- Returns:
- the object to execute geo commands.
-
geo
Gets the object to execute commands manipulating geo items (a.k.a.{longitude, latitude, member}
).V
represents the type of the member, i.e. the localized thing.- Type Parameters:
V
- the type of the member- Parameters:
memberType
- the class of the members- Returns:
- the object to execute geo commands.
-
key
Gets the object to execute commands manipulating keys and expiration times.- Type Parameters:
K
- the type of the key- Parameters:
redisKeyType
- the type of the keys- Returns:
- the object to execute commands manipulating keys.
-
key
Gets the object to execute commands manipulating keys and expiration times.- Returns:
- the object to execute commands manipulating keys.
-
sortedSet
Gets the object to execute commands manipulating sorted sets.- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
redisKeyType
- the type of the keysvalueType
- the type of the value sorted in the sorted sets- Returns:
- the object to manipulate sorted sets.
-
sortedSet
Gets the object to execute commands manipulating sorted sets.- Type Parameters:
V
- the type of the value- Parameters:
valueType
- the type of the value sorted in the sorted sets- Returns:
- the object to manipulate sorted sets.
-
value
Gets the object to execute commands manipulating stored strings.NOTE: Instead of
string
, this group is namedvalue
to avoid the confusion with the Java String type. Indeed, Redis strings can be strings, numbers, byte arrays...- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
redisKeyType
- the type of the keysvalueType
- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
value
Gets the object to execute commands manipulating stored strings.NOTE: Instead of
string
, this group is namedvalue
to avoid the confusion with the Java String type. Indeed, Redis strings can be strings, numbers, byte arrays...- Type Parameters:
V
- the type of the value- Parameters:
valueType
- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
string
@Deprecated <K,V> TransactionalStringCommands<K,V> string(Class<K> redisKeyType, Class<V> valueType) Deprecated.Usevalue(Class, Class)
instead.Gets the object to execute commands manipulating stored strings.- Type Parameters:
K
- the type of the keyV
- the type of the value- Parameters:
redisKeyType
- the type of the keysvalueType
- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
string
Deprecated.Usevalue(Class)
insteadGets the object to execute commands manipulating stored strings.- Type Parameters:
V
- the type of the value- Parameters:
valueType
- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
set
Gets the object to execute commands manipulating sets.- Type Parameters:
K
- the type of the keyV
- the type of the member- Parameters:
redisKeyType
- the type of the keysmemberType
- the type of the member stored in each set- Returns:
- the object to manipulate sets.
-
set
Gets the object to execute commands manipulating sets.- Type Parameters:
V
- the type of the member- Parameters:
memberType
- the type of the member stored in each set- Returns:
- the object to manipulate sets.
-
list
Gets the object to execute commands manipulating lists.- Type Parameters:
K
- the type of the keyV
- the type of the member- Parameters:
redisKeyType
- the type of the keysmemberType
- the type of the member stored in each list- Returns:
- the object to manipulate sets.
-
list
Gets the object to execute commands manipulating lists.- Type Parameters:
V
- the type of the member- Parameters:
memberType
- the type of the member stored in each list- Returns:
- the object to manipulate sets.
-
hyperloglog
<K,V> TransactionalHyperLogLogCommands<K,V> hyperloglog(Class<K> redisKeyType, Class<V> memberType) Gets the object to execute commands manipulating hyperloglog data structures.- Type Parameters:
K
- the type of the keyV
- the type of the member- Parameters:
redisKeyType
- the type of the keysmemberType
- the type of the member stored in the data structure- Returns:
- the object to manipulate hyper log log data structures.
-
hyperloglog
Gets the object to execute commands manipulating hyperloglog data structures.- Type Parameters:
V
- the type of the member- Parameters:
memberType
- the type of the member stored in the data structure- Returns:
- the object to manipulate hyper log log data structures.
-
bitmap
Gets the object to execute commands manipulating bitmap data structures.- Type Parameters:
K
- the type of the key- Parameters:
redisKeyType
- the type of the keys- Returns:
- the object to manipulate bitmap data structures.
-
bitmap
Gets the object to execute commands manipulating bitmap data structures.- Returns:
- the object to manipulate bitmap data structures.
-
stream
<K,F, TransactionalStreamCommands<K,V> F, streamV> (Class<K> redisKeyType, Class<F> typeOfField, Class<V> typeOfValue) Gets the object to execute commands manipulating streams.- Type Parameters:
K
- the type of the redis keyF
- the type of the fields (map's keys)V
- the type of the value- Parameters:
redisKeyType
- the class of the keystypeOfField
- the class of the fieldstypeOfValue
- the class of the values- Returns:
- the object to execute commands manipulating streams.
-
stream
Gets the object to execute commands manipulating stream..This is a shortcut on
stream(String.class, String.class, V)
- Type Parameters:
V
- the type of the value- Parameters:
typeOfValue
- the class of the values- Returns:
- the object to execute commands manipulating streams.
-
json
Gets the object to manipulate JSON values. This group requires the RedisJSON module.- Returns:
- the object to manipulate JSON values.
-
json
Gets the object to manipulate JSON values. This group requires the RedisJSON module.- Type Parameters:
K
- the type of keys- Returns:
- the object to manipulate JSON values.
-
bloom
Gets the object to manipulate Bloom filters. This group requires the RedisBloom module.- Type Parameters:
V
- the type of value- Parameters:
valueType
- the type of value to store in the filters- Returns:
- the object to manipulate Bloom filters
-
bloom
Gets the object to manipulate Bloom filters. This group requires the RedisBloom module.- Type Parameters:
K
- the type of keyV
- the type of value- Parameters:
redisKeyType
- the type of the keyvalueType
- the type of value to store in the filters- Returns:
- the object to manipulate Bloom filters
-
cuckoo
Gets the object to manipulate Cuckoo filters. This group requires the RedisBloom module (including the Cuckoo filter support).- Type Parameters:
V
- the type of the values added into the Cuckoo filter- Returns:
- the object to manipulate Cuckoo values.
-
cuckoo
Gets the object to manipulate Cuckoo filters. This group requires the RedisBloom module (including the Cuckoo filter support).- Type Parameters:
K
- the type of keysV
- the type of the values added into the Cuckoo filter- Returns:
- the object to manipulate Cuckoo values.
-
countmin
Gets the object to manipulate Count-Min sketches. This group requires the RedisBloom module (including the count-min sketches support).- Type Parameters:
V
- the type of the values added into the count-min sketches- Returns:
- the object to manipulate count-min sketches.
-
countmin
Gets the object to manipulate Count-Min sketches. This group requires the RedisBloom module (including the count-min sketches support).- Type Parameters:
K
- the type of keysV
- the type of the values added into the count-min sketches- Returns:
- the object to manipulate count-min sketches.
-
topk
Gets the object to manipulate Top-K list. This group requires the RedisBloom module (including the top-k list support).- Type Parameters:
V
- the type of the values added into the top-k lists- Returns:
- the object to manipulate top-k lists.
-
topk
Gets the object to manipulate Top-K list. This group requires the RedisBloom module (including the top-k list support).- Type Parameters:
K
- the type of keysV
- the type of the values added into the top-k lists- Returns:
- the object to manipulate top-k lists.
-
graph
@Experimental("The Redis graph support is experimental") default TransactionalGraphCommands<String> graph()Gets the object to manipulate graphs. This group requires the RedisGraph module.- Returns:
- the object to manipulate graphs lists.
-
graph
@Experimental("The Redis graph support is experimental") <K> TransactionalGraphCommands<K> graph(Class<K> redisKeyType) Gets the object to manipulate graphs. This group requires the RedisGraph module.- Type Parameters:
K
- the type of keys- Returns:
- the object to manipulate graphs lists.
-
search
@Experimental("The Redis search support is experimental") <K> TransactionalSearchCommands search(Class<K> redisKeyType) Gets the object to emit commands from thesearch
group. This group requires the RedisSearch module.- Type Parameters:
K
- the type of keys- Returns:
- the object to search documents
-
search
@Experimental("The Redis Search support is experimental") default TransactionalSearchCommands search()Gets the object to emit commands from thesearch
group. This group requires the RedisSearch module.- Returns:
- the object to search documents
-
autosuggest
@Experimental("The Redis auto-suggest support is experimental") <K> TransactionalAutoSuggestCommands<K> autosuggest(Class<K> redisKeyType) Gets the object to emit commands from theauto-suggest
group. This group requires the RedisSearch module.- Type Parameters:
K
- the type of keys- Returns:
- the object to get suggestions
-
autosuggest
@Experimental("The Redis auto-suggest support is experimental") default TransactionalAutoSuggestCommands<String> autosuggest()Gets the object to emit commands from theauto-suggest
group. This group requires the RedisSearch module.- Returns:
- the object to get suggestions
-
timeseries
@Experimental("The Redis time series support is experimental") <K> TransactionalTimeSeriesCommands<K> timeseries(Class<K> redisKeyType) Gets the object to emit commands from thetime series
group. This group requires the Redis Time Series module.- Type Parameters:
K
- the type of keys- Returns:
- the object to manipulate time series
-
timeseries
@Experimental("The Redis time series support is experimental") default TransactionalTimeSeriesCommands<String> timeseries()Gets the object to emit commands from thetime series
group. This group requires the Redis Time Series module.- Returns:
- the object to manipulate time series
-
execute
Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command
- the command nameargs
- the parameters, encoded as String.
-
execute
Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command
- the commandargs
- the parameters, encoded as String.
-
execute
Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command
- the commandargs
- the parameters, encoded as String.
-
value(Class, Class)
instead.