|
19 | 19 |
|
20 | 20 | import org.apache.ignite.IgniteCheckedException;
|
21 | 21 | import org.apache.ignite.IgniteLogger;
|
| 22 | +import org.apache.ignite.binary.BinaryRawReader; |
22 | 23 | import org.apache.ignite.internal.IgniteInternalFuture;
|
23 | 24 | import org.apache.ignite.internal.binary.BinaryRawReaderEx;
|
24 | 25 | import org.apache.ignite.internal.binary.BinaryRawWriterEx;
|
25 | 26 | import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
|
26 | 27 | import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
|
27 | 28 | import org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils;
|
28 | 29 | import org.apache.ignite.internal.processors.platform.utils.PlatformListenable;
|
| 30 | +import org.apache.ignite.lang.IgniteFuture; |
29 | 31 | import org.jetbrains.annotations.Nullable;
|
30 | 32 |
|
31 | 33 | /**
|
@@ -244,23 +246,12 @@ public PlatformContext platformContext() {
|
244 | 246 |
|
245 | 247 | /** {@inheritDoc} */
|
246 | 248 | @Override public void listenFuture(final long futId, int typ) throws Exception {
|
247 |
| - listenFutureAndGet(futId, typ); |
| 249 | + PlatformFutureUtils.listen(platformCtx, currentFuture(), futId, typ, null, this); |
248 | 250 | }
|
249 | 251 |
|
250 | 252 | /** {@inheritDoc} */
|
251 | 253 | @Override public void listenFutureForOperation(final long futId, int typ, int opId) throws Exception {
|
252 |
| - listenFutureForOperationAndGet(futId, typ, opId); |
253 |
| - } |
254 |
| - |
255 |
| - /** {@inheritDoc} */ |
256 |
| - @Override public PlatformListenable listenFutureAndGet(final long futId, int typ) throws Exception { |
257 |
| - return PlatformFutureUtils.listen(platformCtx, currentFuture(), futId, typ, null, this); |
258 |
| - } |
259 |
| - |
260 |
| - /** {@inheritDoc} */ |
261 |
| - @Override public PlatformListenable listenFutureForOperationAndGet(final long futId, int typ, int opId) |
262 |
| - throws Exception { |
263 |
| - return PlatformFutureUtils.listen(platformCtx, currentFuture(), futId, typ, futureWriter(opId), this); |
| 254 | + PlatformFutureUtils.listen(platformCtx, currentFuture(), futId, typ, futureWriter(opId), this); |
264 | 255 | }
|
265 | 256 |
|
266 | 257 | /**
|
@@ -413,4 +404,74 @@ protected Object processOutObject(int type) throws IgniteCheckedException {
|
413 | 404 | protected <T> T throwUnsupported(int type) throws IgniteCheckedException {
|
414 | 405 | throw new IgniteCheckedException("Unsupported operation type: " + type);
|
415 | 406 | }
|
| 407 | + |
| 408 | + /** |
| 409 | + * Reads future information and listens. |
| 410 | + * |
| 411 | + * @param reader Reader. |
| 412 | + * @param fut Future. |
| 413 | + * @param writer Writer. |
| 414 | + * @throws IgniteCheckedException In case of error. |
| 415 | + */ |
| 416 | + protected PlatformListenable readAndListenFuture(BinaryRawReader reader, IgniteInternalFuture fut, |
| 417 | + PlatformFutureUtils.Writer writer) |
| 418 | + throws IgniteCheckedException { |
| 419 | + long futId = reader.readLong(); |
| 420 | + int futTyp = reader.readInt(); |
| 421 | + |
| 422 | + return PlatformFutureUtils.listen(platformCtx, fut, futId, futTyp, writer, this); |
| 423 | + } |
| 424 | + |
| 425 | + /** |
| 426 | + * Reads future information and listens. |
| 427 | + * |
| 428 | + * @param reader Reader. |
| 429 | + * @param fut Future. |
| 430 | + * @param writer Writer. |
| 431 | + * @throws IgniteCheckedException In case of error. |
| 432 | + */ |
| 433 | + protected PlatformListenable readAndListenFuture(BinaryRawReader reader, IgniteFuture fut, |
| 434 | + PlatformFutureUtils.Writer writer) |
| 435 | + throws IgniteCheckedException { |
| 436 | + long futId = reader.readLong(); |
| 437 | + int futTyp = reader.readInt(); |
| 438 | + |
| 439 | + return PlatformFutureUtils.listen(platformCtx, fut, futId, futTyp, writer, this); |
| 440 | + } |
| 441 | + |
| 442 | + /** |
| 443 | + * Reads future information and listens. |
| 444 | + * |
| 445 | + * @param reader Reader. |
| 446 | + * @param fut Future. |
| 447 | + * @throws IgniteCheckedException In case of error. |
| 448 | + */ |
| 449 | + protected PlatformListenable readAndListenFuture(BinaryRawReader reader, IgniteInternalFuture fut) |
| 450 | + throws IgniteCheckedException { |
| 451 | + return readAndListenFuture(reader, fut, null); |
| 452 | + } |
| 453 | + |
| 454 | + /** |
| 455 | + * Reads future information and listens. |
| 456 | + * |
| 457 | + * @param reader Reader. |
| 458 | + * @param fut Future. |
| 459 | + * @throws IgniteCheckedException In case of error. |
| 460 | + */ |
| 461 | + protected PlatformListenable readAndListenFuture(BinaryRawReader reader, IgniteFuture fut) |
| 462 | + throws IgniteCheckedException { |
| 463 | + return readAndListenFuture(reader, fut, null); |
| 464 | + } |
| 465 | + |
| 466 | + /** |
| 467 | + * Reads future information and listens. |
| 468 | + * |
| 469 | + * @param reader Reader. |
| 470 | + * @throws IgniteCheckedException In case of error. |
| 471 | + */ |
| 472 | + protected long readAndListenFuture(BinaryRawReader reader) throws IgniteCheckedException { |
| 473 | + readAndListenFuture(reader, currentFuture(), null); |
| 474 | + |
| 475 | + return TRUE; |
| 476 | + } |
416 | 477 | }
|
0 commit comments