Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,27 @@ public long getNextId(String sequenceIdName) throws SCMException {
public void invalidateBatch() {
lock.lock();
try {
sequenceIdToBatchMap.forEach(
(sequenceId, batch) -> batch.nextId = batch.lastId + 1);
invalidateBatchInternal();
} finally {
lock.unlock();
}
}

private void invalidateBatchInternal() {
sequenceIdToBatchMap
.forEach((sequenceId, batch) -> batch.nextId = batch.lastId + 1);
}

/**
* Reinitialize the SequenceIdGenerator with the latest sequenceIdTable
* during SCM reload.
*/
public void reinitialize(Table<String, Long> sequenceIdTable)
throws IOException {
LOG.info("reinitialize SequenceIdGenerator.");
lock.lock();
try {
LOG.info("reinitialize SequenceIdGenerator.");
invalidateBatch();
invalidateBatchInternal();
stateManager.reinitialize(sequenceIdTable);
} finally {
lock.unlock();
Expand Down