...
Proposed notification format:
Notification | |
long | Resource ID (task ID, continuous query ID, etc) |
short | Message flags. Bitwise OR operation of following options: 0x0001 Error flag 0x0004 Notification flag (should always be set for notifications) |
short | Notification operation code |
int | Error code (if error flag is set) |
string | Error message (if error flag is set) |
... | Notification payload (if error flag isn't set) |
New request type should be added to start a new task:
...
Code Block | ||||
---|---|---|---|---|
| ||||
public interface ClientCompute {
public ClientClusterGroup clusterGroup();
// Sync and async task execution methods.
public <T, R> R execute(String taskName, @Nullable T arg) throws ClientException, InterruptedException;
public <T, R> ClientFuture<R> executeAsync(String taskName, @Nullable T arg) throws ClientException;
// Sync and async affinity execution methods, task will be routed to affinity node if partition awareness is enabled.
public <T, R> R affinityExecute(String cacheName, Object affKey, String taskName, @Nullable T arg)
throws ClientException, InterruptedException;
public <T, R> ClientFuture<R> affinityExecuteAsync(String cacheName, Object affKey, String taskName, @Nullable T arg)
throws ClientException;
// ClientCompute modificators.
public ClientCompute withTimeout(long timeout);
public ClientCompute withNoFailover();
public ClientCompute withNoResultCache();
} |
...
Code Block | ||||
---|---|---|---|---|
| ||||
public interface ClientFuture<R> { public R get() throws ClientException, CancellationException, InterruptedException; public R get(long timeout, TimeUnit unit) throws ClientException, TimeoutException, InterruptedException; public boolean isDone(); public boolean cancel() throws ClientException; public boolean isCancelled(); } |
...
If blocking IO is used (as in java thin client, for example) it's impossible to implement async operations without dedicated for each channel thread to process incoming messages. So, the count of threads on the client-side will be increased and can be raised dramatically if partition awareness functionality with a lot of server connections is used.
http://apache-ignite-developers.2346864.n4.nabble.com/Thin-client-compute-support-td44405.html
...