K - key typeV - value type.public class DefaultTransactionalMap<K,V> extends Object implements org.onosproject.store.service.TransactionalMap<K,V>, TransactionParticipant
| Constructor and Description |
|---|
DefaultTransactionalMap(String name,
org.onosproject.store.service.AsyncConsistentMap<K,V> backingMap,
org.onosproject.store.service.TransactionContext txContext,
org.onosproject.store.service.Serializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort()
Discards all changes made to this transactional map.
|
CompletableFuture<Void> |
commit()
Attempts to execute the commit phase for previously prepared transaction.
|
protected K |
dK(String key) |
V |
get(K key) |
boolean |
hasPendingUpdates()
Returns if this participant has updates that need to be committed.
|
CompletableFuture<Boolean> |
prepare()
Executes the prepare phase.
|
CompletableFuture<Boolean> |
prepareAndCommit()
Executes the prepare and commit steps in a single go.
|
V |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
V |
remove(K key) |
boolean |
remove(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
CompletableFuture<Void> |
rollback()
Attempts to execute the rollback phase for previously prepared transaction.
|
protected List<org.onosproject.store.primitives.MapUpdate<String,byte[]>> |
toMapUpdates() |
String |
toString() |
int |
totalUpdates()
Returns the number of updates that need to committed for this participant.
|
protected List<org.onosproject.store.primitives.MapUpdate<K,V>> |
updates() |
protected Stream<org.onosproject.store.primitives.MapUpdate<K,V>> |
updatesStream() |
public CompletableFuture<Boolean> prepare()
TransactionParticipantprepare in interface TransactionParticipanttrue is successful; false otherwisepublic CompletableFuture<Void> commit()
TransactionParticipantcommit in interface TransactionParticipantpublic CompletableFuture<Void> rollback()
TransactionParticipantrollback in interface TransactionParticipantpublic CompletableFuture<Boolean> prepareAndCommit()
TransactionParticipantprepareAndCommit in interface TransactionParticipanttrue is successful i.e updates are committed; false otherwisepublic int totalUpdates()
TransactionParticipanttotalUpdates in interface TransactionParticipantpublic boolean hasPendingUpdates()
TransactionParticipanthasPendingUpdates in interface TransactionParticipanttrue if yes; false otherwiseprotected List<org.onosproject.store.primitives.MapUpdate<String,byte[]>> toMapUpdates()
protected void abort()
Copyright © 2016. All rights reserved.