|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.mvstore.TransactionStore.TransactionMap<K,V>
K - the key typeV - the value typepublic static class TransactionStore.TransactionMap<K,V>
A map that supports transactions.
| Method Summary | |
|---|---|
V |
get(K key)
Get the value for the given key at the time when this map was opened. |
V |
get(K key,
MVMap<K,java.lang.Object[]> m)
Get the value for the given key. |
V |
getLatest(K key)
Get the most recent value for the given key. |
long |
getSize()
Get the size of the map as seen by this transaction. |
V |
put(K key,
V value)
Update the value for the given key. |
V |
remove(K key)
Remove an entry. |
boolean |
tryPut(K key,
V value)
Try to update the value for the given key. |
boolean |
tryRemove(K key)
Try to remove the value for the given key. |
boolean |
trySet(K key,
V value,
boolean onlyIfUnchanged)
Try to set or remove the value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public long getSize()
public V remove(K key)
If the row is locked, this method will retry until the row could be updated or until a lock timeout.
key - the key
java.lang.IllegalStateException - if a lock timeout occurs
public V put(K key,
V value)
If the row is locked, this method will retry until the row could be updated or until a lock timeout.
key - the keyvalue - the new value (not null)
java.lang.IllegalStateException - if a lock timeout occurspublic boolean tryRemove(K key)
This will fail if the row is locked by another transaction (that means, if another open transaction changed the row).
key - the key
public boolean tryPut(K key,
V value)
This will fail if the row is locked by another transaction (that means, if another open transaction changed the row).
key - the keyvalue - the new value
public boolean trySet(K key,
V value,
boolean onlyIfUnchanged)
key - the keyvalue - the new value (null to remove the value)onlyIfUnchanged - only set the value if it was not changed (by
this or another transaction) since the map was opened
public V get(K key)
key - the key
public V getLatest(K key)
key - the key
public V get(K key,
MVMap<K,java.lang.Object[]> m)
key - the keym - the map
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||