This is an automated email from the ASF dual-hosted git repository. av pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push: new 39dc5a33ef8 IGNITE-20173 GridCacheCompoundIdentityFuture and it's ancestors initial cleanup (#10879) 39dc5a33ef8 is described below commit 39dc5a33ef83cfc6269808e25c26700590142d2c Author: Anton Vinogradov <a...@apache.org> AuthorDate: Wed Aug 9 12:59:38 2023 +0300 IGNITE-20173 GridCacheCompoundIdentityFuture and it's ancestors initial cleanup (#10879) --- .../ignite/internal/util/future/GridCompoundFuture.java | 11 +++-------- .../ignite/internal/util/future/GridFutureAdapter.java | 15 +++++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java index bca24ea0ca2..28e25449210 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java @@ -33,7 +33,6 @@ import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.processors.cache.distributed.near.consistency.IgniteConsistencyViolationException; import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException; import org.apache.ignite.internal.util.tostring.GridToStringInclude; -import org.apache.ignite.internal.util.typedef.C1; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; @@ -75,7 +74,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig private volatile int lsnrCalls; /** The lock responds for a consistency of compounds. */ - private ReentrantReadWriteLock compoundsLock = new ReentrantReadWriteLock(); + private final ReentrantReadWriteLock compoundsLock = new ReentrantReadWriteLock(); /** Count of compounds in the future. */ private volatile int size; @@ -386,7 +385,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig /** * Returns future at the specified position in this list. * - * @param idx - index index of the element to return + * @param idx - index of the element to return * @return Future. */ @SuppressWarnings("unchecked") @@ -423,11 +422,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig "cancelled", isCancelled(), "err", error(), "futs", - F.viewReadOnly(futures(), new C1<IgniteInternalFuture<T>, String>() { - @Override public String apply(IgniteInternalFuture<T> f) { - return Boolean.toString(f.isDone()); - } - }) + F.viewReadOnly(futures(), (IgniteInternalFuture<T> f) -> Boolean.toString(f.isDone())) ); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java index 4b3bf881738..89c806c8024 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java @@ -400,9 +400,8 @@ public class GridFutureAdapter<R> implements IgniteInternalFuture<R> { listen(fut -> { if (exec == null) applyChainComposeCallback(doneCb, fut, res); - else { + else exec.execute(() -> applyChainComposeCallback(doneCb, fut, res)); - } }); return res; @@ -414,13 +413,13 @@ public class GridFutureAdapter<R> implements IgniteInternalFuture<R> { * * @param doneCb Callback. * @param fut Future that should be passed to the callback as the argument. - * @param chainFuture Chained future. + * @param chainFut Chained future. * @param <T> Type parameter. */ private <T> void applyChainComposeCallback( IgniteClosure<? super IgniteInternalFuture<R>, IgniteInternalFuture<T>> doneCb, IgniteInternalFuture<R> fut, - GridFutureAdapter<T> chainFuture + GridFutureAdapter<T> chainFut ) { IgniteInternalFuture<T> doneCbFut; @@ -436,10 +435,10 @@ public class GridFutureAdapter<R> implements IgniteInternalFuture<R> { doneCbFut.listen(f -> { try { - chainFuture.onDone(f.get(), null); + chainFut.onDone(f.get(), null); } catch (Exception e) { - chainFuture.onDone(e); + chainFut.onDone(e); } }); } @@ -632,10 +631,10 @@ public class GridFutureAdapter<R> implements IgniteInternalFuture<R> { */ private static class ChainFuture<R, T> extends GridFutureAdapter<T> { /** */ - private GridFutureAdapter<R> fut; + private final GridFutureAdapter<R> fut; /** */ - private IgniteClosure<? super IgniteInternalFuture<R>, T> doneCb; + private final IgniteClosure<? super IgniteInternalFuture<R>, T> doneCb; /** * @param fut Future.