• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DriverInternalError类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.datastax.driver.core.exceptions.DriverInternalError的典型用法代码示例。如果您正苦于以下问题:Java DriverInternalError类的具体用法?Java DriverInternalError怎么用?Java DriverInternalError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DriverInternalError类属于com.datastax.driver.core.exceptions包,在下文中一共展示了DriverInternalError类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: propagateCause

import com.datastax.driver.core.exceptions.DriverInternalError; //导入依赖的package包/类
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);
}
 
开发者ID:papyrusglobal,项目名称:state-channels,代码行数:17,代码来源:CassandraUtil.java


示例2: checkCassandraException

import com.datastax.driver.core.exceptions.DriverInternalError; //导入依赖的package包/类
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);
    }
}
 
开发者ID:hpcc-systems,项目名称:storm-cassandra-cql,代码行数:26,代码来源:CassandraCqlMapState.java


示例3: stopWithDriverInternalException

import com.datastax.driver.core.exceptions.DriverInternalError; //导入依赖的package包/类
@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);
}
 
开发者ID:Stratio,项目名称:ingestion,代码行数:23,代码来源:TestCassandraSink.java


示例4: executeAsync

import com.datastax.driver.core.exceptions.DriverInternalError; //导入依赖的package包/类
/**
 * @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);
    }
}
 
开发者ID:1and1,项目名称:Troilus,代码行数:14,代码来源:DBSession.java


示例5: fromProtocolId

import com.datastax.driver.core.exceptions.DriverInternalError; //导入依赖的package包/类
static Name fromProtocolId(int id) {
    Name name = nameToIds[id];
    if (name == null)
        throw new DriverInternalError("Unknown data type protocol id: " + id);
    return name;
}
 
开发者ID:Taulukko,项目名称:taulukko-commons-ceu,代码行数:7,代码来源:DataType.java



注:本文中的com.datastax.driver.core.exceptions.DriverInternalError类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Extension类代码示例发布时间:2022-05-22
下一篇:
Java ViburDBCPDataSource类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap