Search in sources :

Example 1 with DefaultExecutionInfo

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

the class GraphRequestHandler method setFinalError.

private void setFinalError(GraphStatement<?> statement, Throwable error, Node node, int execution) {
    DriverExecutionProfile executionProfile = Conversions.resolveExecutionProfile(statement, context);
    if (error instanceof DriverException) {
        ((DriverException) error).setExecutionInfo(new DefaultExecutionInfo(statement, node, startedSpeculativeExecutionsCount.get(), execution, errors, null, null, true, session, context, executionProfile));
    }
    if (result.completeExceptionally(error)) {
        cancelScheduledTasks();
        if (!(requestTracker instanceof NoopRequestTracker)) {
            long latencyNanos = System.nanoTime() - startTimeNanos;
            requestTracker.onError(statement, error, latencyNanos, executionProfile, node, logPrefix);
        }
        if (error instanceof DriverTimeoutException) {
            throttler.signalTimeout(this);
            sessionMetricUpdater.incrementCounter(DseSessionMetric.GRAPH_CLIENT_TIMEOUTS, executionProfile.getName());
        } else if (!(error instanceof RequestThrottlingException)) {
            throttler.signalError(this, error);
        }
    }
}
Also used : DriverExecutionProfile(com.datastax.oss.driver.api.core.config.DriverExecutionProfile) NoopRequestTracker(com.datastax.oss.driver.internal.core.tracker.NoopRequestTracker) DriverTimeoutException(com.datastax.oss.driver.api.core.DriverTimeoutException) DefaultExecutionInfo(com.datastax.oss.driver.internal.core.cql.DefaultExecutionInfo) DriverException(com.datastax.oss.driver.api.core.DriverException) RequestThrottlingException(com.datastax.oss.driver.api.core.RequestThrottlingException)

Aggregations

DriverException (com.datastax.oss.driver.api.core.DriverException)1 DriverTimeoutException (com.datastax.oss.driver.api.core.DriverTimeoutException)1 RequestThrottlingException (com.datastax.oss.driver.api.core.RequestThrottlingException)1 DriverExecutionProfile (com.datastax.oss.driver.api.core.config.DriverExecutionProfile)1 DefaultExecutionInfo (com.datastax.oss.driver.internal.core.cql.DefaultExecutionInfo)1 NoopRequestTracker (com.datastax.oss.driver.internal.core.tracker.NoopRequestTracker)1