public class RedissonTransaction extends Object implements RTransaction
Constructor and Description |
---|
RedissonTransaction(CommandAsyncExecutor commandExecutor,
TransactionOptions options) |
RedissonTransaction(CommandAsyncExecutor commandExecutor,
TransactionOptions options,
List<TransactionalOperation> operations,
Set<String> localCaches) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkState() |
void |
commit()
Commits all changes made on this transaction.
|
void |
commit(Set<String> localCaches,
List<TransactionalOperation> operations) |
RFuture<Void> |
commitAsync()
Commits all changes made on this transaction in async mode.
|
protected static String |
generateId() |
<V> RBucket<V> |
getBucket(String name)
Returns transactional object holder instance by name.
|
<V> RBucket<V> |
getBucket(String name,
Codec codec)
Returns transactional object holder instance by name
using provided codec for object.
|
RBuckets |
getBuckets()
Returns transactional interface for mass operations with Bucket objects.
|
RBuckets |
getBuckets(Codec codec)
Returns transactional interface for mass operations with Bucket objects
using provided codec for object.
|
<K,V> RLocalCachedMap<K,V> |
getLocalCachedMap(RLocalCachedMap<K,V> fromInstance)
Returns transactional local cached map proxy for specified local cached map instance.
|
Set<String> |
getLocalCaches() |
<K,V> RMap<K,V> |
getMap(String name)
Returns transactional map instance by name.
|
<K,V> RMap<K,V> |
getMap(String name,
Codec codec)
Returns transactional map instance by name
using provided codec for both map keys and values.
|
<K,V> RMapCache<K,V> |
getMapCache(String name)
Returns transactional map-based cache instance by name.
|
<K,V> RMapCache<K,V> |
getMapCache(String name,
Codec codec)
Returns transactional map-based cache instance by
name
using provided codec for both cache keys and values. |
List<TransactionalOperation> |
getOperations() |
<V> RSet<V> |
getSet(String name)
Returns transactional set instance by name.
|
<V> RSet<V> |
getSet(String name,
Codec codec)
Returns transactional set instance by name
using provided codec for set objects.
|
<V> RSetCache<V> |
getSetCache(String name)
Returns transactional set-based cache instance by
name . |
<V> RSetCache<V> |
getSetCache(String name,
Codec codec)
Returns transactional set-based cache instance by
name . |
void |
rollback()
Rollback all changes made on this transaction.
|
void |
rollback(List<TransactionalOperation> operations) |
RFuture<Void> |
rollbackAsync()
Rollback all changes made on this transaction in async mode.
|
public RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options)
public RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options, List<TransactionalOperation> operations, Set<String> localCaches)
public <K,V> RLocalCachedMap<K,V> getLocalCachedMap(RLocalCachedMap<K,V> fromInstance)
RTransaction
getLocalCachedMap
in interface RTransaction
K
- type of keyV
- type of valuefromInstance
- - local cache map instancepublic <V> RBucket<V> getBucket(String name)
RTransaction
getBucket
in interface RTransaction
V
- type of valuename
- - name of objectpublic <V> RBucket<V> getBucket(String name, Codec codec)
RTransaction
getBucket
in interface RTransaction
V
- type of valuename
- - name of objectcodec
- - codec for valuespublic RBuckets getBuckets()
RTransaction
getBuckets
in interface RTransaction
public RBuckets getBuckets(Codec codec)
RTransaction
getBuckets
in interface RTransaction
codec
- - codec for bucket objectspublic <V> RSet<V> getSet(String name)
RTransaction
getSet
in interface RTransaction
V
- type of valuename
- - name of objectpublic <V> RSet<V> getSet(String name, Codec codec)
RTransaction
getSet
in interface RTransaction
V
- type of valuename
- - name of objectcodec
- - codec for valuespublic <V> RSetCache<V> getSetCache(String name)
RTransaction
name
.
Supports value eviction with a given TTL value.
If eviction is not required then it's better to use regular map RTransaction.getSet(String)
.
getSetCache
in interface RTransaction
V
- type of valuename
- - name of objectpublic <V> RSetCache<V> getSetCache(String name, Codec codec)
RTransaction
name
.
Supports value eviction with a given TTL value.
If eviction is not required then it's better to use regular map RTransaction.getSet(String, Codec)
.
getSetCache
in interface RTransaction
V
- type of valuename
- - name of objectcodec
- - codec for valuespublic <K,V> RMap<K,V> getMap(String name)
RTransaction
getMap
in interface RTransaction
K
- type of keyV
- type of valuename
- - name of objectpublic <K,V> RMap<K,V> getMap(String name, Codec codec)
RTransaction
getMap
in interface RTransaction
K
- type of keyV
- type of valuename
- - name of objectcodec
- - codec for keys and valuespublic <K,V> RMapCache<K,V> getMapCache(String name)
RTransaction
If eviction is not required then it's better to use regular map RTransaction.getMap(String)
.
getMapCache
in interface RTransaction
K
- type of keyV
- type of valuename
- - name of objectpublic <K,V> RMapCache<K,V> getMapCache(String name, Codec codec)
RTransaction
name
using provided codec
for both cache keys and values.
Supports entry eviction with a given MaxIdleTime and TTL settings.
If eviction is not required then it's better to use regular map RTransaction.getMap(String, Codec)
.
getMapCache
in interface RTransaction
K
- type of keyV
- type of valuename
- - object namecodec
- - codec for keys and valuespublic RFuture<Void> commitAsync()
RTransaction
commitAsync
in interface RTransaction
public void commit()
RTransaction
commit
in interface RTransaction
public void commit(Set<String> localCaches, List<TransactionalOperation> operations)
protected static String generateId()
public void rollback()
RTransaction
rollback
in interface RTransaction
public void rollback(List<TransactionalOperation> operations)
public RFuture<Void> rollbackAsync()
RTransaction
rollbackAsync
in interface RTransaction
public List<TransactionalOperation> getOperations()
protected void checkState()
Copyright © 2014–2021 Redisson. All rights reserved.