alex-plekhanov commented on code in PR #12873:
URL: https://github.com/apache/ignite/pull/12873#discussion_r2923058723
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/BPlusTree.java:
##########
@@ -1609,10 +1616,11 @@ private void doFind(Get g) throws
IgniteCheckedException {
* @param pageId Page ID.
* @param fwdId Expected forward page ID.
* @param lvl Level.
+ * @param foundLsnr Found row listener. If not {@code null}, is called
when a row is found under a page-read-lock.
* @return Result code.
* @throws IgniteCheckedException If failed.
*/
- private Result findDown(final Get g, final long pageId, final long fwdId,
final int lvl)
+ private Result findDown(Get g, long pageId, long fwdId, int lvl, @Nullable
BiConsumer<Long, L> foundLsnr)
Review Comment:
Looks like you reinventing the `invoke` method. But I'm not sure if `invoke`
can be executed without page write lock (when op == NOOP).
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java:
##########
@@ -1783,24 +1783,18 @@ private void clearPendingEntries(GridCacheContext cctx,
CacheDataRow oldRow)
int cacheId = grp.sharedGroup() ? cctx.cacheId() :
CU.UNDEFINED_CACHE_ID;
- CacheDataRow row = dataTree.findOne(new SearchRow(cacheId, key),
CacheDataRowAdapter.RowData.NO_KEY);
-
- afterRowFound(row, key);
-
- return row;
- }
-
- /**
- * @param row Row.
- * @param key Key.
- * @throws IgniteCheckedException If failed.
- */
- private void afterRowFound(@Nullable CacheDataRow row, KeyCacheObject
key) throws IgniteCheckedException {
- if (row != null) {
- row.key(key);
-
- grp.dataRegion().evictionTracker().touchPage(row.link());
- }
+ return dataTree.findOne(
+ new SearchRow(cacheId, key),
+ null,
+ CacheDataRowAdapter.RowData.NO_KEY,
+ (pageId, row) -> {
Review Comment:
`pageId` is not required by the listener, but it forces `pageId` to be boxed
on each invocation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]