Skip to content
Merged
Changes from 1 commit
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,13 +161,17 @@ 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.
Expand All @@ -177,7 +181,7 @@ public void reinitialize(Table<String, Long> sequenceIdTable)
lock.lock();
try {
LOG.info("reinitialize SequenceIdGenerator.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move the log statement out of the lock.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

invalidateBatch();
invalidateBatchInternal();
stateManager.reinitialize(sequenceIdTable);
} finally {
lock.unlock();
Expand Down