Class SequenceService
java.lang.Object
org.jumpmind.symmetric.service.impl.AbstractService
org.jumpmind.symmetric.service.impl.SequenceService
- All Implemented Interfaces:
ISequenceService
,IService
-
Field Summary
Fields inherited from class org.jumpmind.symmetric.service.impl.AbstractService
log, parameterService, platform, sqlTemplate, sqlTemplateDirty, symmetricDialect, tablePrefix
-
Constructor Summary
ConstructorsConstructorDescriptionSequenceService
(IParameterService parameterService, ISymmetricDialect symmetricDialect) -
Method Summary
Modifier and TypeMethodDescriptionvoid
long
long
currVal
(ISqlTransaction transaction, String name) protected Sequence
get
(ISqlTransaction transaction, String name) getAll()
protected Sequence
getSequenceDefinition
(String name) protected Sequence
getSequenceDefinition
(ISqlTransaction transaction, String name) void
init()
long
long
nextRange
(ISqlTransaction transaction, String name, long size) Obtain a contiguous range of sequence numbers.long
long
nextVal
(ISqlTransaction transaction, String name) protected long
nextValFromCache
(ISqlTransaction transaction, String name) protected long
nextValFromDatabase
(String name, long size) protected long
nextValFromDatabase
(ISqlTransaction transaction, String name, long size) protected long
tryToGetNextVal
(ISqlTransaction transaction, String name, long size) Methods inherited from class org.jumpmind.symmetric.service.impl.AbstractService
assertNotNull, buildBatchOrderBy, buildBatchParams, buildBatchWhere, buildBatchWhereFromFilter, close, createSqlReplacementTokens, getJdbcTemplate, getParameterService, getSql, getSymmetricDialect, getTablePrefix, getTargetDialect, getTargetPlatform, getTargetPlatform, isCalledFromSymmetricAdminTool, isSet, isStreamClosedByClient, isSymmetricTable, logOnce, maxDate, readAcks, sendAck, setSqlMap, synchronize, toNodeIds, toNodeIds
-
Constructor Details
-
SequenceService
-
-
Method Details
-
init
public void init()- Specified by:
init
in interfaceISequenceService
-
nextVal
- Specified by:
nextVal
in interfaceISequenceService
-
nextVal
- Specified by:
nextVal
in interfaceISequenceService
-
nextValFromCache
-
nextValFromDatabase
-
nextValFromDatabase
-
tryToGetNextVal
-
nextRange
Obtain a contiguous range of sequence numbers. The initial load extract in background needs an uninterrupted range of batch numbers. As a bonus, it's more efficient to request the entire range in one call.- Specified by:
nextRange
in interfaceISequenceService
- Parameters:
name
- Sequence name to usesize
- Number of sequence numbers to obtain- Returns:
- Starting sequence number for the entire range that was obtained
-
nextRange
- Specified by:
nextRange
in interfaceISequenceService
-
getSequenceDefinition
-
getSequenceDefinition
-
currVal
- Specified by:
currVal
in interfaceISequenceService
-
currVal
- Specified by:
currVal
in interfaceISequenceService
-
create
- Specified by:
create
in interfaceISequenceService
-
get
-
getAll
-