timoninmaxim commented on code in PR #10885:
URL: https://github.com/apache/ignite/pull/10885#discussion_r1291117996
##########
modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java:
##########
@@ -138,29 +147,37 @@ public GridFinishedFuture(Throwable err) {
}
}
+ /** {@inheritDoc} */
+ @Override public <R> IgniteInternalFuture<R> chain(final
IgniteOutClosure<R> doneCb) {
+ return chain(ignored -> doneCb.apply());
Review Comment:
`assert doneCb != null;` ?
##########
modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java:
##########
@@ -111,6 +113,14 @@ public interface IgniteInternalFuture<R> {
@Async.Schedule
public void listen(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr);
+ /**
+ * Registers listener closure to be asynchronously notified whenever
future completes.
+ *
+ * @param lsnr Listener closure to register. If not provided - this method
is no-op.
Review Comment:
Do we actually need no-op implementation? Using `null` looks strange, let's
enforce nonNull check inside the method.
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java:
##########
@@ -173,8 +173,8 @@ public class IsolatedDiscoverySpi extends IgniteSpiAdapter
implements IgniteDisc
msg,
null));
- // Acknowledge message must be send after initial message
processed.
- fut.listen((f) -> {
+ // Acknowledge message must be sent after initial message
processed.
+ fut.listen(ignored -> {
Review Comment:
ignored -> () ?
##########
modules/core/src/main/java/org/apache/ignite/internal/management/meta/MetadataRemoveTask.java:
##########
@@ -125,8 +125,8 @@ protected MetadataRemoveJob(@Nullable MetaRemoveCommandArg
arg, boolean debug) {
jobCtx.holdcc();
- future.listen((IgniteInClosure<IgniteInternalFuture<?>>)f
-> {
- if (f.isDone())
+ future.listen(() -> {
+ if (future.isDone())
Review Comment:
future -> f
##########
modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java:
##########
@@ -83,7 +81,7 @@ public void testGet() throws Exception {
try {
final ComputeTaskFuture<?> fut = executeAsync(ignite.compute(),
GridStopTestTask.class.getName(), null);
- fut.listen((CI1<IgniteFuture>)gridFut -> {
+ fut.listen(ignored -> {
Review Comment:
ignored -> () ?
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/AbstractIncrementalSnapshotBlockingTest.java:
##########
@@ -326,7 +326,7 @@ public void awaitSnpBlockedOrFinished(@Nullable
IgniteFuture<?> snpFut) {
if (latch == null)
return;
- snpFut.listen((f) -> latch.countDown());
+ snpFut.listen(ignored -> latch.countDown());
Review Comment:
ignored -> () ?
--
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]