Package org.microspace.table
Class Isolator<T>
- java.lang.Object
-
- org.microspace.table.SimpleUnsafeTable<T>
-
- org.microspace.table.Isolator<T>
-
- All Implemented Interfaces:
Table<T>
public class Isolator<T> extends SimpleUnsafeTable<T>
A front map that can be used as a transaction map.- Author:
- Gaspar Sinai - gaspar.sinai@microspace.org
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Isolator.State
-
Field Summary
Fields Modifier and Type Field Description protected IndexedMap<Object,BigInteger>
backUpdateCount
protected IndexedSet<Object>
updates
-
Fields inherited from class org.microspace.table.SimpleUnsafeTable
currentTimeProvider, entries, indexedColumns, updateCounter
-
-
Constructor Summary
Constructors Constructor Description Isolator(Class<T> clazz, CurrentTimeProvider currentTimeProvider)
Isolator(Accessor<T> accessor, CurrentTimeProvider currentTimeProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
BigInteger
getBackUpdateCount(Object o)
Isolator.State
getState()
IndexedSet<Object>
getUpdatedKeys()
IndexedSet<Object>
keySet()
protected void
remove(Entry<T> container)
Removes are marke only.void
setEntry(Entry<T> container)
The updateCounter at the end of the operation will show our update count.void
setFirstEntry(Entry<T> container)
Set the first entry without update count modification.void
setState(Isolator.State state)
-
Methods inherited from class org.microspace.table.SimpleUnsafeTable
autoTimestamp, getAccessor, getCurrentTimeProvider, move, read, readById, readMultiple, remove, size, take, takeMultiple, write
-
-
-
-
Field Detail
-
backUpdateCount
protected final IndexedMap<Object,BigInteger> backUpdateCount
-
updates
protected final IndexedSet<Object> updates
-
-
Constructor Detail
-
Isolator
public Isolator(Class<T> clazz, CurrentTimeProvider currentTimeProvider)
-
Isolator
public Isolator(Accessor<T> accessor, CurrentTimeProvider currentTimeProvider)
-
-
Method Detail
-
keySet
public IndexedSet<Object> keySet()
- Overrides:
keySet
in classSimpleUnsafeTable<T>
-
setFirstEntry
public void setFirstEntry(Entry<T> container)
Description copied from class:SimpleUnsafeTable
Set the first entry without update count modification.- Overrides:
setFirstEntry
in classSimpleUnsafeTable<T>
- Parameters:
container
- will be moved or removed
-
getBackUpdateCount
public BigInteger getBackUpdateCount(Object o)
-
getUpdatedKeys
public IndexedSet<Object> getUpdatedKeys()
-
getState
public Isolator.State getState()
-
setState
public void setState(Isolator.State state)
-
remove
protected void remove(Entry<T> container)
Removes are marke only.- Overrides:
remove
in classSimpleUnsafeTable<T>
- Parameters:
container
- is the container.
-
setEntry
public void setEntry(Entry<T> container)
Description copied from class:SimpleUnsafeTable
The updateCounter at the end of the operation will show our update count. Container will be owned by this object.- Overrides:
setEntry
in classSimpleUnsafeTable<T>
- Parameters:
container
- will be moved or removed
-
clear
public void clear()
- Overrides:
clear
in classSimpleUnsafeTable<T>
-
-