This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch ignite-20177
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 088b6c393fbc6d252a6e101a1549dd18e6f6f6eb
Author: Anton Vinogradov <a...@apache.org>
AuthorDate: Mon Aug 7 22:57:33 2023 +0300

    WIP
---
 .../cache/distributed/dht/GridDhtLockFuture.java   | 92 ++++++++++------------
 1 file changed, 42 insertions(+), 50 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 1b0874ceadc..89898ea4870 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -69,12 +69,10 @@ import 
org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.C1;
-import org.apache.ignite.internal.util.typedef.CI2;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.transactions.TransactionIsolation;
 import org.jetbrains.annotations.NotNull;
@@ -266,7 +264,7 @@ public final class GridDhtLockFuture extends 
GridCacheCompoundIdentityFuture<Boo
 
         if (tx != null) {
             while (true) {
-                IgniteInternalFuture fut = tx.lockFut;
+                IgniteInternalFuture<?> fut = tx.lockFut;
 
                 if (fut != null) {
                     if (fut == GridDhtTxLocalAdapter.ROLLBACK_FUT)
@@ -276,14 +274,12 @@ public final class GridDhtLockFuture extends 
GridCacheCompoundIdentityFuture<Boo
                         assert fut instanceof GridDhtColocatedLockFuture : fut;
 
                         // Terminate this future if parent(collocated) future 
is terminated by rollback.
-                        fut.listen(new IgniteInClosure<IgniteInternalFuture>() 
{
-                            @Override public void apply(IgniteInternalFuture 
fut) {
-                                try {
-                                    fut.get();
-                                }
-                                catch (IgniteCheckedException e) {
-                                    onError(e);
-                                }
+                        fut.listen((IgniteInternalFuture<?> fut0) -> {
+                            try {
+                                fut.get();
+                            }
+                            catch (IgniteCheckedException e) {
+                                onError(e);
                             }
                         });
                     }
@@ -1030,12 +1026,10 @@ public final class GridDhtLockFuture extends 
GridCacheCompoundIdentityFuture<Boo
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        Collection<String> futs = F.viewReadOnly(futures(), new 
C1<IgniteInternalFuture<?>, String>() {
-            @Override public String apply(IgniteInternalFuture<?> f) {
-                MiniFuture m = (MiniFuture)f;
+        Collection<String> futs = F.viewReadOnly(futures(), 
(IgniteInternalFuture<?> f) -> {
+            MiniFuture m = (MiniFuture)f;
 
-                return "[node=" + m.node().id() + ", loc=" + 
m.node().isLocal() + ", done=" + f.isDone() + "]";
-            }
+            return "[node=" + m.node().id() + ", loc=" + m.node().isLocal() + 
", done=" + f.isDone() + "]";
         });
 
         Collection<KeyCacheObject> locks;
@@ -1081,46 +1075,44 @@ public final class GridDhtLockFuture extends 
GridCacheCompoundIdentityFuture<Boo
                 cctx.store().loadAll(
                     null,
                     loadMap.keySet(),
-                    new CI2<KeyCacheObject, Object>() {
-                        @Override public void apply(KeyCacheObject key, Object 
val) {
-                            // No value loaded from store.
-                            if (val == null)
-                                return;
-
-                            GridDhtCacheEntry entry0 = loadMap.get(key);
+                    (KeyCacheObject key, Object val) -> {
+                        // No value loaded from store.
+                        if (val == null)
+                            return;
 
-                            try {
-                                CacheObject val0 = cctx.toCacheObject(val);
+                        GridDhtCacheEntry entry0 = loadMap.get(key);
 
-                                long ttl = createTtl;
-                                long expireTime;
+                        try {
+                            CacheObject val0 = cctx.toCacheObject(val);
 
-                                if (ttl == CU.TTL_ZERO)
-                                    expireTime = CU.expireTimeInPast();
-                                else {
-                                    if (ttl == CU.TTL_NOT_CHANGED)
-                                        ttl = CU.TTL_ETERNAL;
+                            long ttl = createTtl;
+                            long expireTime;
 
-                                    expireTime = CU.toExpireTime(ttl);
-                                }
+                            if (ttl == CU.TTL_ZERO)
+                                expireTime = CU.expireTimeInPast();
+                            else {
+                                if (ttl == CU.TTL_NOT_CHANGED)
+                                    ttl = CU.TTL_ETERNAL;
 
-                                entry0.initialValue(val0,
-                                    ver,
-                                    ttl,
-                                    expireTime,
-                                    false,
-                                    topVer,
-                                    GridDrType.DR_LOAD,
-                                    true,
-                                    false);
-                            }
-                            catch (GridCacheEntryRemovedException e) {
-                                assert false : "Should not get removed 
exception while holding lock on entry " +
-                                    "[entry=" + entry0 + ", e=" + e + ']';
-                            }
-                            catch (IgniteCheckedException e) {
-                                onDone(e);
+                                expireTime = CU.toExpireTime(ttl);
                             }
+
+                            entry0.initialValue(val0,
+                                ver,
+                                ttl,
+                                expireTime,
+                                false,
+                                topVer,
+                                GridDrType.DR_LOAD,
+                                true,
+                                false);
+                        }
+                        catch (GridCacheEntryRemovedException e) {
+                            assert false : "Should not get removed exception 
while holding lock on entry " +
+                                "[entry=" + entry0 + ", e=" + e + ']';
+                        }
+                        catch (IgniteCheckedException e) {
+                            onDone(e);
                         }
                     });
             }

Reply via email to