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 Long
lastOne()
Checks the last used identifier.Long
nextOne()
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:NumericIdSequence
Produces the new identifier.- Specified by:
nextOne
in interfaceIdSequence<Long>
- Specified by:
nextOne
in interfaceNumericIdSequence<Long>
- Returns:
- the new identifier.
-
nextRange
@NotNull public Interval<Long> nextRange(int count)
Description copied from interface:NumericIdSequence
Produces and returns a range of identifiers.- Specified by:
nextRange
in interfaceNumericIdSequence<Long>
- Parameters:
count
- how many identifiers to produce.- Returns:
- a range of new identifiers.
-
lastOne
@NotNull public Long lastOne()
Description copied from interface:NumericIdSequence
Checks the last used identifier.- Specified by:
lastOne
in interfaceNumericIdSequence<Long>
- Returns:
- the last used value.
-
-