Skip to content

Commit

Permalink
fix npe (apache#11966)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeimingZ authored Jan 24, 2024
1 parent 7f7285c commit 092fcb5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,14 @@ public void run() {
private void updateEffectiveInfoRationAndUpdateMetric() {
// calculate effective information ratio
long costOfActiveMemTables = checkpointManager.getTotalCostOfActiveMemTables();
MemTableInfo oldestUnpinnedMemTableInfo = checkpointManager.getOldestUnpinnedMemTableInfo();
long totalCost =
(getCurrentWALFileVersion()
- checkpointManager.getOldestUnpinnedMemTableInfo().getFirstFileVersionId()
+ 1)
* config.getWalFileSizeThresholdInByte();
oldestUnpinnedMemTableInfo == null
? costOfActiveMemTables
: (getCurrentWALFileVersion()
- oldestUnpinnedMemTableInfo.getFirstFileVersionId()
+ 1)
* config.getWalFileSizeThresholdInByte();
if (totalCost == 0) {
return;
}
Expand Down

0 comments on commit 092fcb5

Please sign in to comment.