本文整理汇总了Java中org.elasticsearch.transport.ReceiveTimeoutTransportException类的典型用法代码示例。如果您正苦于以下问题:Java ReceiveTimeoutTransportException类的具体用法?Java ReceiveTimeoutTransportException怎么用?Java ReceiveTimeoutTransportException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReceiveTimeoutTransportException类属于org.elasticsearch.transport包,在下文中一共展示了ReceiveTimeoutTransportException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: waitForTimeoutTestCase
import org.elasticsearch.transport.ReceiveTimeoutTransportException; //导入依赖的package包/类
/**
* Test waiting for a task that times out.
* @param wait wait for the running task and return all the failures you accumulated waiting for it
*/
private void waitForTimeoutTestCase(Function<TaskId, ? extends Iterable<? extends Throwable>> wait) throws Exception {
// Start blocking test task
ListenableActionFuture<TestTaskPlugin.NodesResponse> future = TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client())
.execute();
try {
TaskId taskId = waitForTestTaskStartOnAllNodes();
// Wait for the task to start
assertBusy(() -> client().admin().cluster().prepareGetTask(taskId).get());
// Spin up a request that should wait for those tasks to finish
// It will timeout because we haven't unblocked the tasks
Iterable<? extends Throwable> failures = wait.apply(taskId);
for (Throwable failure : failures) {
assertNotNull(
ExceptionsHelper.unwrap(failure, ElasticsearchTimeoutException.class, ReceiveTimeoutTransportException.class));
}
} finally {
// Now we can unblock those requests
TestTaskPlugin.UnblockTestTasksAction.INSTANCE.newRequestBuilder(client()).get();
}
future.get();
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:TasksIT.java
注:本文中的org.elasticsearch.transport.ReceiveTimeoutTransportException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论