本文整理汇总了Java中com.datastax.driver.core.exceptions.ReadTimeoutException类的典型用法代码示例。如果您正苦于以下问题:Java ReadTimeoutException类的具体用法?Java ReadTimeoutException怎么用?Java ReadTimeoutException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReadTimeoutException类属于com.datastax.driver.core.exceptions包,在下文中一共展示了ReadTimeoutException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkCassandraException
import com.datastax.driver.core.exceptions.ReadTimeoutException; //导入依赖的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
示例2: testShouldReturnReadTimeout
import com.datastax.driver.core.exceptions.ReadTimeoutException; //导入依赖的package包/类
@Test
public void testShouldReturnReadTimeout() throws Exception {
server.prime(when(query).then(readTimeout(ConsistencyLevel.TWO, 1, 2, false)));
thrown.expect(ReadTimeoutException.class);
thrown.expect(
match(
(ReadTimeoutException rte) ->
rte.getRequiredAcknowledgements() == 2
&& rte.getReceivedAcknowledgements() == 1
&& !rte.wasDataRetrieved()
&& rte.getConsistencyLevel() == com.datastax.driver.core.ConsistencyLevel.TWO));
query();
}
开发者ID:datastax,项目名称:simulacron,代码行数:15,代码来源:ErrorResultIntegrationTest.java
示例3: isHostsAvailabilityError
import com.datastax.driver.core.exceptions.ReadTimeoutException; //导入依赖的package包/类
/**
* Checks if Cassandra host availability error occur, thus host became unavailable.
*
* @param e Exception to check.
* @return {@code true} in case of host not available error.
*/
public static boolean isHostsAvailabilityError(Throwable e) {
while (e != null) {
if (e instanceof NoHostAvailableException ||
e instanceof ReadTimeoutException)
return true;
e = e.getCause();
}
return false;
}
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:CassandraHelper.java
示例4: retrievePeople
import com.datastax.driver.core.exceptions.ReadTimeoutException; //导入依赖的package包/类
@Override
public List<Person> retrievePeople() {
ResultSet result;
try {
Statement statement = new SimpleStatement("select * from person");
statement.setConsistencyLevel(ConsistencyLevel.QUORUM);
result = session.execute(statement);
} catch (ReadTimeoutException e) {
throw new UnableToRetrievePeopleException();
}
return result.all().stream().map(
row -> new Person(row.getString("first_name"), row.getString("last_name"), row.getInt("age"), row.getSet("interesting_dates", Date.class))
).collect(Collectors.toList());
}
开发者ID:chbatey,项目名称:scassandra-example-java,代码行数:16,代码来源:PersonDaoCassandra.java
注:本文中的com.datastax.driver.core.exceptions.ReadTimeoutException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论