public class AsyncExecutor<T> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AsyncExecutor.MultiFailedException |
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
executorService |
protected AsyncResultHandler<T> |
handler |
protected com.datastax.driver.core.Session |
session |
Modifier | Constructor and Description |
---|---|
protected |
AsyncExecutor(com.datastax.driver.core.Session session,
AsyncResultHandler<T> handler)
Creates a new
AsyncExecutor instance. |
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.SettableFuture<List<T>> |
execAsync(List<com.datastax.driver.core.Statement> statements,
List<T> inputs,
Semaphore throttle,
AsyncResultSetHandler<T> handler)
Asynchronously executes the specified select statements.
|
List<com.google.common.util.concurrent.SettableFuture<T>> |
execAsync(List<com.datastax.driver.core.Statement> statements,
T input)
Asynchronously executes all statements associated to the specified input.
|
com.google.common.util.concurrent.SettableFuture<T> |
execAsync(com.datastax.driver.core.Statement statement,
T inputs)
Asynchronously executes the specified batch statement.
|
com.google.common.util.concurrent.SettableFuture<T> |
execAsync(com.datastax.driver.core.Statement statement,
T inputs,
AsyncResultHandler<T> handler)
Asynchronously executes the specified batch statement.
|
int |
getPendingTasksSize()
Returns the number of currently executed tasks which are not yet completed.
|
protected static ExecutorService |
newSingleThreadExecutor() |
void |
shutdown() |
protected com.datastax.driver.core.Session session
protected ExecutorService executorService
protected AsyncResultHandler<T> handler
protected AsyncExecutor(com.datastax.driver.core.Session session, AsyncResultHandler<T> handler)
AsyncExecutor
instance.protected static ExecutorService newSingleThreadExecutor()
public List<com.google.common.util.concurrent.SettableFuture<T>> execAsync(List<com.datastax.driver.core.Statement> statements, T input)
public com.google.common.util.concurrent.SettableFuture<T> execAsync(com.datastax.driver.core.Statement statement, T inputs)
handler
once query succeed or failed.public com.google.common.util.concurrent.SettableFuture<T> execAsync(com.datastax.driver.core.Statement statement, T inputs, AsyncResultHandler<T> handler)
handler
once query succeed or failed.public com.google.common.util.concurrent.SettableFuture<List<T>> execAsync(List<com.datastax.driver.core.Statement> statements, List<T> inputs, Semaphore throttle, AsyncResultSetHandler<T> handler)
AsyncResultSetHandler
once each query has succeed or failed.public int getPendingTasksSize()
public void shutdown()
Copyright © 2023 The Apache Software Foundation. All rights reserved.