-
Notifications
You must be signed in to change notification settings - Fork 963
Skip update entryLogMetaMap if not modified #2964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip update entryLogMetaMap if not modified #2964
Conversation
|
rerun failure checks |
|
@rdhabalia @eolivelli @zymap Please help take a look, thanks. |
|
rerun failure checks |
rdhabalia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment. LGTM
|
|
||
| private void removeIfLedgerNotExists(EntryLogMetadata meta) throws EntryLogMetadataMapException { | ||
| private boolean removeIfLedgerNotExists(EntryLogMetadata meta) throws EntryLogMetadataMapException { | ||
| AtomicBoolean modified = new AtomicBoolean(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use light weight MutableBoolean instead AtomicBoolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
### Motivation After we support RocksDB backend entryMetaMap, we should avoid updating the entryMetaMap if unnecessary. In `doGcEntryLogs` method, it iterate through the entryLogMetaMap and update the meta if ledgerNotExists. We should check whether the meta has been modified in `removeIfLedgerNotExists`. If not modified, we can avoid update the entryLogMetaMap. ### Modification 1. Add a flag to represent whether the meta has been modified in `removeIfLedgerNotExists` method. If not, skip update the entryLogMetaMap.
### Motivation After we support RocksDB backend entryMetaMap, we should avoid updating the entryMetaMap if unnecessary. In `doGcEntryLogs` method, it iterate through the entryLogMetaMap and update the meta if ledgerNotExists. We should check whether the meta has been modified in `removeIfLedgerNotExists`. If not modified, we can avoid update the entryLogMetaMap. ### Modification 1. Add a flag to represent whether the meta has been modified in `removeIfLedgerNotExists` method. If not, skip update the entryLogMetaMap.
Motivation
After we support RocksDB backend entryMetaMap, we should avoid updating the entryMetaMap if unnecessary.
In
doGcEntryLogsmethod, it iterate through the entryLogMetaMap and update the meta if ledgerNotExists. We should check whether the meta has been modified inremoveIfLedgerNotExists. If not modified, we can avoid update the entryLogMetaMap.Modification
removeIfLedgerNotExistsmethod. If not, skip update the entryLogMetaMap.