Class PersistableLongIdSequence
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.PersistableLongIdSequence
-
- All Implemented Interfaces:
IdSequence<Long>,NumericIdSequence<Long>
public class PersistableLongIdSequence extends Object implements NumericIdSequence<Long>
Sequence implementation which is safety for using in multi-node setup and uses database for synchronization- Since:
- 2019.2
-
-
Constructor Summary
Constructors Constructor Description PersistableLongIdSequence(SQLRunnerEx dbFunctionsProvider, String domainName, int idsCountToReserve, long lastValueFromDomainTables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LonglastOne()Checks the last used identifier.LongnextOne()Produces the new identifier.Interval<Long>nextRange(int count)Produces and returns a range of identifiers.
-
-
-
Constructor Detail
-
PersistableLongIdSequence
public PersistableLongIdSequence(@NotNull SQLRunnerEx dbFunctionsProvider, @NotNull String domainName, int idsCountToReserve, long lastValueFromDomainTables)
-
-
Method Detail
-
nextOne
@NotNull public Long nextOne()
Description copied from interface:NumericIdSequenceProduces the new identifier.- Specified by:
nextOnein interfaceIdSequence<Long>- Specified by:
nextOnein interfaceNumericIdSequence<Long>- Returns:
- the new identifier.
-
nextRange
@NotNull public Interval<Long> nextRange(int count)
Description copied from interface:NumericIdSequenceProduces and returns a range of identifiers.- Specified by:
nextRangein interfaceNumericIdSequence<Long>- Parameters:
count- how many identifiers to produce.- Returns:
- a range of new identifiers.
-
lastOne
@NotNull public Long lastOne()
Description copied from interface:NumericIdSequenceChecks the last used identifier.- Specified by:
lastOnein interfaceNumericIdSequence<Long>- Returns:
- the last used value.
-
-