Search in sources :

Example 1 with CqlPrepareAsyncProcessor

use of com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor 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));
}
Also used : RequestProcessorRegistry(com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry) Statement(com.datastax.oss.driver.api.core.cql.Statement) CqlPrepareSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor) CqlRequestSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor) CqlPrepareAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor) CqlRequestAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor) PrepareRequest(com.datastax.oss.driver.api.core.cql.PrepareRequest)

Example 2 with CqlPrepareAsyncProcessor

use of com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor 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));
}
Also used : RequestProcessorRegistry(com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry) Statement(com.datastax.oss.driver.api.core.cql.Statement) CqlPrepareSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor) CqlRequestSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor) CqlPrepareAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor) CqlRequestAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor) PrepareRequest(com.datastax.oss.driver.api.core.cql.PrepareRequest)

Example 3 with CqlPrepareAsyncProcessor

use of com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor in project java-driver by datastax.

the class BuiltInRequestProcessors method addBasicProcessors.

public static void addBasicProcessors(List<RequestProcessor<?, ?>> processors) {
    // regular requests (sync and async)
    CqlRequestAsyncProcessor cqlRequestAsyncProcessor = new CqlRequestAsyncProcessor();
    CqlRequestSyncProcessor cqlRequestSyncProcessor = new CqlRequestSyncProcessor(cqlRequestAsyncProcessor);
    processors.add(cqlRequestAsyncProcessor);
    processors.add(cqlRequestSyncProcessor);
    // prepare requests (sync and async)
    CqlPrepareAsyncProcessor cqlPrepareAsyncProcessor = new CqlPrepareAsyncProcessor();
    CqlPrepareSyncProcessor cqlPrepareSyncProcessor = new CqlPrepareSyncProcessor(cqlPrepareAsyncProcessor);
    processors.add(cqlPrepareAsyncProcessor);
    processors.add(cqlPrepareSyncProcessor);
    // continuous requests (sync and async)
    ContinuousCqlRequestAsyncProcessor continuousCqlRequestAsyncProcessor = new ContinuousCqlRequestAsyncProcessor();
    ContinuousCqlRequestSyncProcessor continuousCqlRequestSyncProcessor = new ContinuousCqlRequestSyncProcessor(continuousCqlRequestAsyncProcessor);
    processors.add(continuousCqlRequestAsyncProcessor);
    processors.add(continuousCqlRequestSyncProcessor);
}
Also used : ContinuousCqlRequestSyncProcessor(com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestSyncProcessor) ContinuousCqlRequestAsyncProcessor(com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestAsyncProcessor) CqlPrepareSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor) CqlRequestSyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor) ContinuousCqlRequestSyncProcessor(com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestSyncProcessor) CqlPrepareAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor) CqlRequestAsyncProcessor(com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor) ContinuousCqlRequestAsyncProcessor(com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestAsyncProcessor)

Aggregations

CqlPrepareAsyncProcessor (com.datastax.oss.driver.internal.core.cql.CqlPrepareAsyncProcessor)3 CqlPrepareSyncProcessor (com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor)3 CqlRequestAsyncProcessor (com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor)3 CqlRequestSyncProcessor (com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor)3 PrepareRequest (com.datastax.oss.driver.api.core.cql.PrepareRequest)2 Statement (com.datastax.oss.driver.api.core.cql.Statement)2 RequestProcessorRegistry (com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry)2 ContinuousCqlRequestAsyncProcessor (com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestAsyncProcessor)1 ContinuousCqlRequestSyncProcessor (com.datastax.dse.driver.internal.core.cql.continuous.ContinuousCqlRequestSyncProcessor)1