use of com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry in project thingsboard by thingsboard.
the class GuavaDriverContext method buildRequestProcessorRegistry.
@Override
public RequestProcessorRegistry buildRequestProcessorRegistry() {
// Register the typical request processors, except instead of the normal async processors,
// use GuavaRequestAsyncProcessor to return ListenableFutures in async methods.
CqlRequestAsyncProcessor cqlRequestAsyncProcessor = new CqlRequestAsyncProcessor();
CqlPrepareAsyncProcessor cqlPrepareAsyncProcessor = new CqlPrepareAsyncProcessor();
CqlRequestSyncProcessor cqlRequestSyncProcessor = new CqlRequestSyncProcessor(cqlRequestAsyncProcessor);
return new RequestProcessorRegistry(getSessionName(), cqlRequestSyncProcessor, new CqlPrepareSyncProcessor(cqlPrepareAsyncProcessor), new GuavaRequestAsyncProcessor<>(cqlRequestAsyncProcessor, Statement.class, GuavaSession.ASYNC), new GuavaRequestAsyncProcessor<>(cqlPrepareAsyncProcessor, PrepareRequest.class, GuavaSession.ASYNC_PREPARED));
}
use of com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry in project java-driver by datastax.
the class GuavaDriverContext method buildRequestProcessorRegistry.
@Override
public RequestProcessorRegistry buildRequestProcessorRegistry() {
// Register the typical request processors, except instead of the normal async processors,
// use GuavaRequestAsyncProcessor to return ListenableFutures in async methods.
CqlRequestAsyncProcessor cqlRequestAsyncProcessor = new CqlRequestAsyncProcessor();
CqlPrepareAsyncProcessor cqlPrepareAsyncProcessor = new CqlPrepareAsyncProcessor();
CqlRequestSyncProcessor cqlRequestSyncProcessor = new CqlRequestSyncProcessor(cqlRequestAsyncProcessor);
return new RequestProcessorRegistry(getSessionName(), cqlRequestSyncProcessor, new CqlPrepareSyncProcessor(cqlPrepareAsyncProcessor), new GuavaRequestAsyncProcessor<>(cqlRequestAsyncProcessor, Statement.class, GuavaSession.ASYNC), new GuavaRequestAsyncProcessor<>(cqlPrepareAsyncProcessor, PrepareRequest.class, GuavaSession.ASYNC_PREPARED), // Register KeyRequestProcessor for handling KeyRequest and returning Integer.
new KeyRequestProcessor(cqlRequestAsyncProcessor));
}
Aggregations