You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

IDIEP-51
Author
Sponsor
Created

  

Status
DRAFT


Motivation

Current Java Thin Client API is synchronous (blocking). Blocking APIs do not scale well.

Underlying protocol and Java implementation are inherently asynchronous, so any thin client API can have an async equivalent.

Description

APIs

Provide async equivalents for all Java Thin Client APIs where possible:

  • IgniteClient
  • ClientCache
  • ClientCluster, ClientClusterGroup
  • ClientCompute (already has executeAsync, but may need improvement - see below)
  • ClientTransaction, ClientTransactions

Futures

Async APIs should return IgniteFuture for consistency with other Ignite APIs.

ClientCompute#executeAsync returns plain j.u.c.Future, which does not provide completion callbacks or chaining, this should be changed (deprecate old method and create a new one).

Future Completion Thread

Thin client responses are processed by a dedicated thin-client-channel thread (see TcpClientChannel#RECEIVER_THREAD_PREFIX usages). This thread calls GridFutureAdapter#onDone for the corresponding ClientRequestFuture when an operation completes. With a naïve implementation, we would wrap ClientRequestFuture in IgniteFutureImpl and return the result to the user code. However, if the user code calls IgniteFuture#listen, listeners will be executed by the same thin-client-channel thread, potentially capturing that thread forever, so no more client responses can be processed.

Risks and Assumptions

// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.

Discussion Links

// Links to discussions on the devlist, if applicable.

Reference Links

// Links to various reference documents, if applicable.

Tickets

Unable to render Jira issues macro, execution error.

  • No labels