Interface Updater<R>
- All Superinterfaces:
AutoCloseable
,Closeable
,Scanner<R>
,Spliterator<R>
Update operations only affect columns which have a modified state, and the rest of the
columns remain the same as what was served by the updater. Columns which have an unmodified
state, regardless of the column value, aren't updated. Consider the case in which a row key
is changed, the row is loaded, and then one column is modified. Although all columns are
effectively different than what was served by the updater, only one column is updated
against the original row. For debugging, call the row's toString
method to identify
which columns are modified. The name of a modified column is prefixed with an asterisk.
Updater instances can only be safely used by one thread at a time, and they must be closed when no longer needed. Instances can be exchanged by threads, as long as a happens-before relationship is established. Without proper exclusion, multiple threads interacting with a Updater instance may cause database corruption.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Method Summary
Methods inherited from interface org.cojen.tupl.Scanner
close, forEachRemaining, row, step, step, tryAdvance, trySplit
Methods inherited from interface java.util.Spliterator
characteristics, estimateSize, getComparator, getExactSizeIfKnown, hasCharacteristics
-
Method Details
-
update
Update the current row and then step to the next row.- Returns:
- the next row or null if no more rows remain and scanner has been closed
- Throws:
IllegalStateException
- if no current rowUniqueConstraintException
- if update creates a conflicting primary or alternate keyIOException
-
update
Update the current row and then step to the next row.- Parameters:
row
- use this for the next row instead of creating a new one; if null is passed in, a new instance will be created if necessary- Returns:
- the next row or null if no more rows remain and scanner has been closed
- Throws:
IllegalStateException
- if no current rowUniqueConstraintException
- if update creates a conflicting primary or alternate keyIOException
-
delete
Delete the current row and then step to the next row.- Returns:
- the next row or null if no more rows remain and scanner has been closed
- Throws:
IllegalStateException
- if no current rowIOException
-
delete
Delete the current row and then step to the next row.- Parameters:
row
- use this for the next row instead of creating a new one; if null is passed in, a new instance will be created if necessary- Returns:
- the next row or null if no more rows remain and scanner has been closed
- Throws:
IllegalStateException
- if no current rowIOException
-