public static final class Accumulator.SeqAccumulator extends Accumulator
allocate()
method
generates a new, unique long value. The transaction records this value as
a candidate for maximum value of the Accumulator. On recovery, the
highest such value ever allocated by a committed transaction is
recovered, and so after recovery the next allocated ID value will be
larger than any previously consumed.Accumulator.MaxAccumulator, Accumulator.MinAccumulator, Accumulator.SeqAccumulator, Accumulator.SumAccumulator, Accumulator.Type
_tree
Modifier and Type | Method and Description |
---|---|
long |
allocate()
Allocate a sequence number.
|
getLiveValue, getSnapshotValue, toString
public long allocate()
Allocate a sequence number. The value returned is guaranteed to be unique for the lifetime of the database. Values are usually assigned as consecutive integers, but in some cases there may be gaps in the sequence.
The value returned is equal to the live
value the instant it is updated. However, note that the following
code is not guaranteed to generate a unique value:
while the following is:
seqAccumulator.allocate();
long id = seqAccumulator.getLiveValue();
long id = seqAccumulator.allocate();
Copyright © 2025 Open Identity Platform Community. All rights reserved.