You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vyacheslav Koptilin (Jira)" <ji...@apache.org> on 2023/05/18 15:40:00 UTC
[jira] [Updated] (IGNITE-17883) Remove the invoke method from KeyValurView and RecordView interfaces
[ https://issues.apache.org/jira/browse/IGNITE-17883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vyacheslav Koptilin updated IGNITE-17883:
-----------------------------------------
Ignite Flags: (was: Docs Required,Release Notes Required)
> Remove the invoke method from KeyValurView and RecordView interfaces
> --------------------------------------------------------------------
>
> Key: IGNITE-17883
> URL: https://issues.apache.org/jira/browse/IGNITE-17883
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 3.0.0-beta1
> Reporter: Vyacheslav Koptilin
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> _KeyValueView_ and _RecordView_ provide the following methods:
> {code:java}
> /**
> * Executes invoke processor code against the value associated with the provided key.
> *
> * @param tx The transaction or {@code null} to auto commit.
> * @param key A key associated with the value that invoke processor will be applied to. The key cannot be {@code null}.
> * @param proc An invocation processor.
> * @param args Optional invoke processor arguments.
> * @param <R> Invoke processor result type.
> * @return Result of the processing.
> * @see InvokeProcessor
> */
> <R extends Serializable> R invoke(@Nullable Transaction tx, @NotNull K key, InvokeProcessor<K, V, R> proc, Serializable... args);
> /**
> * Asynchronously executes invoke processor code against the value associated with the provided key.
> *
> * @param tx The transaction or {@code null} to auto commit.
> * @param key A key associated with the value that invoke processor will be applied to. The key cannot be {@code null}.
> * @param proc An invocation processor.
> * @param args Optional invoke processor arguments.
> * @param <R> Invoke processor result type.
> * @return Future representing pending completion of the operation.
> * @see InvokeProcessor
> */
> @NotNull <R extends Serializable> CompletableFuture<R> invokeAsync(
> @Nullable Transaction tx,
> @NotNull K key,
> InvokeProcessor<K, V, R> proc,
> Serializable... args);
> /**
> * Executes invoke processor code against values associated with the provided keys.
> *
> * @param tx The transaction or {@code null} to auto commit.
> * @param <R> Invoke processor result type.
> * @param keys Ordered collection of keys which values associated with should be processed. The keys cannot be {@code null}.
> * @param proc An invocation processor.
> * @param args Optional invoke processor arguments.
> * @return Results of the processing.
> * @see InvokeProcessor
> */
> <R extends Serializable> Map<K, R> invokeAll(
> @Nullable Transaction tx,
> @NotNull Collection<K> keys,
> InvokeProcessor<K, V, R> proc,
> Serializable... args);
> /**
> * Asynchronously executes invoke processor code against values associated with the provided keys.
> *
> * @param tx The transaction or {@code null} to auto commit.
> * @param <R> Invoke processor result type.
> * @param keys Ordered collection of keys which values associated with should be processed. The keys cannot be {@code null}.
> * @param proc An invocation processor.
> * @param args Optional invoke processor arguments.
> * @return Future representing pending completion of the operation.
> * @see InvokeProcessor
> */
> @NotNull <R extends Serializable> CompletableFuture<Map<K, R>> invokeAllAsync(
> @Nullable Transaction tx,
> @NotNull Collection<K> keys,
> InvokeProcessor<K, V, R> proc,
> Serializable... args);
> {code}
> The main problem with these methods assume that the user defined closure - _InvokeProcessor_ must be idempotent. This is a consequence of the limitations of the replication protocol. However, the implementation does not have the right way to check this requirement. For example, a simple closure that increments a value for a key could lead to data inconsistency under some circumstances.
> For now, _IgniteCompute.executeColocated_ can be used in order to handle these needs.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)