Java 类com.datastax.driver.core.exceptions.DriverInternalError 实例源码

项目:state-channels    文件:CassandraUtil.java   
static RuntimeException propagateCause(ExecutionException e) {
    Throwable cause = e.getCause();

    if (cause instanceof Error)
        throw ((Error) cause);

    // We could just rethrow e.getCause(). However, the cause of the ExecutionException has likely been
    // created on the I/O thread receiving the response. Which means that the stacktrace associated
    // with said cause will make no mention of the current thread. This is painful for say, finding
    // out which execute() statement actually raised the exception. So instead, we re-create the
    // exception.
    if (cause instanceof DriverException)
        throw ((DriverException) cause).copy();
    else
        throw new DriverInternalError("Unexpected exception thrown", cause);
}
项目:storm-cassandra-cql    文件:CassandraCqlMapState.java   
protected void checkCassandraException(Exception e) {
    _mexceptions.incr();
    if (e instanceof AlreadyExistsException ||
            e instanceof AuthenticationException ||
            e instanceof DriverException ||
            e instanceof DriverInternalError ||
            e instanceof InvalidConfigurationInQueryException ||
            e instanceof InvalidQueryException ||
            e instanceof InvalidTypeException ||
            e instanceof QueryExecutionException ||
            e instanceof QueryTimeoutException ||
            e instanceof QueryValidationException ||
            e instanceof ReadTimeoutException ||
            e instanceof SyntaxError ||
            e instanceof TraceRetrievalException ||
            e instanceof TruncateException ||
            e instanceof UnauthorizedException ||
            e instanceof UnavailableException ||
            e instanceof ReadTimeoutException ||
            e instanceof WriteTimeoutException) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }
}
项目:ingestion    文件:TestCassandraSink.java   
@Test
public void stopWithDriverInternalException() {
  final CassandraSink sink = new CassandraSink();
  final Channel channel = mock(Channel.class);
  final Session session = mock(Session.class);
  final Cluster cluster = mock(Cluster.class);
  final Context ctx = new Context();
  ctx.put("tables", "keyspace.table");
  sink.configure(ctx);
  sink.setChannel(channel);
  sink.session = session;
  sink.cluster = cluster;
  doThrow(DriverInternalError.class).when(session).close();
  doThrow(DriverInternalError.class).when(cluster).close();
  sink.stop();
  verify(session).isClosed();
  verify(session).close();
  verifyNoMoreInteractions(session);
  verify(cluster).isClosed();
  verify(cluster).close();
  verifyNoMoreInteractions(cluster);
}
项目:Troilus    文件:DBSession.java   
/**
 * @param statement  te statement to execute in an async manner
 * @return the resultset future
 */
public ListenableFuture<ResultSet> executeAsync(Statement statement) {
    try {
        return getSession().executeAsync(statement);
    } catch (InvalidQueryException | DriverInternalError e) {
        cleanUp();
        LOG.warn("could not execute statement", e);
        return Futures.immediateFailedFuture(e);
    }
}
项目:taulukko-commons-ceu    文件:DataType.java   
static Name fromProtocolId(int id) {
    Name name = nameToIds[id];
    if (name == null)
        throw new DriverInternalError("Unknown data type protocol id: " + id);
    return name;
}