Skip to content

Commit

Permalink
DBZ-8399 Insert key with null when objectIdToTableId finds no matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros authored and jpechane committed Nov 13, 2024
1 parent a6fc585 commit e53aeeb
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public TableId getTableIdByObjectId(Long objectId, Long dataObjectId) {
return table.id();
}
}

// The computeIfAbsent function doesn't mutate the map if the computed value is null,
// which this branch of the code does. The null value must be inserted to avoid the
// expensive look-up across the table schemas in future calls, so explicitly insert
// null here.
objectIdToTableId.put(tableObjectId, null);

LOGGER.debug("Table lookup for object id {} did not find a match.", tableObjectId);
return null;
});
Expand Down

0 comments on commit e53aeeb

Please sign in to comment.