Skip to content

Commit 6b845ba

Browse files
committed
Javadoc
1 parent f68ef2e commit 6b845ba

File tree

1 file changed

+16
-0
lines changed
  • x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector

1 file changed

+16
-0
lines changed

x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/TimeoutUtils.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@
2020
import java.util.HashSet;
2121
import java.util.concurrent.TimeoutException;
2222

23+
/**
24+
* Utilities for identifying timeouts in responses to collection requests, since we prefer to fail the whole collection attempt if any of
25+
* the involved nodes times out.
26+
*/
2327
public final class TimeoutUtils {
2428
private TimeoutUtils() {
2529
}
2630

31+
/**
32+
* @throws ElasticsearchTimeoutException iff the {@code response} contains any node-level timeout. The exception message identifies the
33+
* nodes that timed out and mentions {@code collectionTimeout}.
34+
*/
2735
public static <T extends BaseNodeResponse> void ensureNoTimeouts(TimeValue collectionTimeout, BaseNodesResponse<T> response) {
2836
HashSet<String> timedOutNodeIds = null;
2937
for (FailedNodeException failedNodeException : response.failures()) {
@@ -37,6 +45,10 @@ public static <T extends BaseNodeResponse> void ensureNoTimeouts(TimeValue colle
3745
ensureNoTimeouts(collectionTimeout, timedOutNodeIds);
3846
}
3947

48+
/**
49+
* @throws ElasticsearchTimeoutException iff the {@code response} contains any node-level timeout. The exception message identifies the
50+
* nodes that timed out and mentions {@code collectionTimeout}.
51+
*/
4052
public static void ensureNoTimeouts(TimeValue collectionTimeout, BaseTasksResponse response) {
4153
HashSet<String> timedOutNodeIds = null;
4254
for (ElasticsearchException nodeFailure : response.getNodeFailures()) {
@@ -53,6 +65,10 @@ public static void ensureNoTimeouts(TimeValue collectionTimeout, BaseTasksRespon
5365
ensureNoTimeouts(collectionTimeout, timedOutNodeIds);
5466
}
5567

68+
/**
69+
* @throws ElasticsearchTimeoutException iff the {@code response} contains any node-level timeout. The exception message identifies the
70+
* nodes that timed out and mentions {@code collectionTimeout}.
71+
*/
5672
public static void ensureNoTimeouts(TimeValue collectionTimeout, BroadcastResponse response) {
5773
HashSet<String> timedOutNodeIds = null;
5874
for (DefaultShardOperationFailedException shardFailure : response.getShardFailures()) {

0 commit comments

Comments
 (0)