[
https://issues.apache.org/jira/browse/IGNITE-16679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladislav Pyatkov updated IGNITE-16679:
---------------------------------------
Description:
For coordinated work, components required to execute some logic before an event
completed (when the event producer have no result) and after (when the producer
already complete the event and behavior of the component changed) it.
In this task, need to change the interface of the listener:
{code:java}
/**
* Notifies the listener about an event.
*
* @param parameters Parameters provide a properties of the event. This
attribute cannot be {@code null}.
* @param exception Exception which is happened during the event produced or
{@code null}.
* @return A future which will complete when the listener handles the message.
* If the future returns {@code true} that the listener will be never invoked
more, if it is {@code false} the listener will stay listen next event.
*/
CompletableFuture<Boolean> notify(@NotNull P parameters, @Nullable Throwable
exception);
{code}
was:
The table is assumed ready just after the TableImpl object hits the internal
collection in TableManager, but the table event (CREATE) happen after.
It leads to bugs into SQL, because the component construct a Calcite schema by
the event:
{noformat}
class org.apache.ignite.lang.IgniteInternalException: Failed to validate query.
org.apache.calcite.runtime.CalciteContextException: From line 1, column 13 to
line 1, column 17: Object 'TEST1' not found
at
org.apache.ignite.internal.sql.engine.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:100)
at
org.apache.ignite.internal.sql.engine.SqlQueryProcessor.lambda$query0$6(SqlQueryProcessor.java:284)
at
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.apache.calcite.tools.ValidationException:
org.apache.calcite.runtime.CalciteContextException: From line 1, column 13 to
line 1, column 17: Object 'TEST1' not found
at
org.apache.ignite.internal.sql.engine.prepare.IgnitePlanner.validate(IgnitePlanner.java:164)
at
org.apache.ignite.internal.sql.engine.prepare.PrepareServiceImpl.prepareDml(PrepareServiceImpl.java:152)
at
org.apache.ignite.internal.sql.engine.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:89)
{noformat}
> Redesing local events in order to them contain a synchronous and asychronous
> parts
> ----------------------------------------------------------------------------------
>
> Key: IGNITE-16679
> URL: https://issues.apache.org/jira/browse/IGNITE-16679
> Project: Ignite
> Issue Type: Bug
> Reporter: Vladislav Pyatkov
> Priority: Blocker
> Labels: ignite-3
>
> For coordinated work, components required to execute some logic before an
> event completed (when the event producer have no result) and after (when the
> producer already complete the event and behavior of the component changed) it.
> In this task, need to change the interface of the listener:
> {code:java}
> /**
> * Notifies the listener about an event.
> *
> * @param parameters Parameters provide a properties of the event. This
> attribute cannot be {@code null}.
> * @param exception Exception which is happened during the event produced or
> {@code null}.
> * @return A future which will complete when the listener handles the
> message.
> * If the future returns {@code true} that the listener will be never invoked
> more, if it is {@code false} the listener will stay listen next event.
> */
> CompletableFuture<Boolean> notify(@NotNull P parameters, @Nullable Throwable
> exception);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)