Skip to content

Commit

Permalink
Deprecate public variale TimeRequest.DEFAULT_MASTER_NODE_TIMEOUT
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng committed Jul 19, 2022
1 parent 4364983 commit e9b6385
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@
public abstract class TimedRequest implements Validatable {

public static final TimeValue DEFAULT_ACK_TIMEOUT = timeValueSeconds(30);
public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30);
public static final TimeValue DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30);

/** @deprecated As of 2.2, because supporting inclusive language, replaced by {@link #DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT} */
@Deprecated
public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT;

private TimeValue timeout = DEFAULT_ACK_TIMEOUT;
private TimeValue clusterManagerTimeout = DEFAULT_MASTER_NODE_TIMEOUT;
private TimeValue clusterManagerTimeout = DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT;

/**
* Sets the timeout to wait for the all the nodes to acknowledge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class GetComponentTemplatesRequest implements Validatable {

private final String name;

private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT;
private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT;
private boolean local = false;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class GetComposableIndexTemplateRequest implements Validatable {

private final String name;

private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT;
private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT;
private boolean local = false;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class GetIndexTemplatesRequest implements Validatable {

private final List<String> names;

private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT;
private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT;
private boolean local = false;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void testDefaults() {
TimedRequest timedRequest = new TimedRequest() {
};
assertEquals(timedRequest.timeout(), TimedRequest.DEFAULT_ACK_TIMEOUT);
assertEquals(timedRequest.masterNodeTimeout(), TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT);
assertEquals(timedRequest.masterNodeTimeout(), TimedRequest.DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT);
}

public void testNonDefaults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testWaitForActiveShards() {
public void testTimeout() {
final CloseIndexRequest request = new CloseIndexRequest("index");
assertEquals(request.timeout(), TimedRequest.DEFAULT_ACK_TIMEOUT);
assertEquals(request.masterNodeTimeout(), TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT);
assertEquals(request.masterNodeTimeout(), TimedRequest.DEFAULT_CLUSTER_MANAGER_NODE_TIMEOUT);

final TimeValue timeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000));
request.setTimeout(timeout);
Expand Down

0 comments on commit e9b6385

Please sign in to comment.