when setting timeout on cluster health, automatically set the master node timeout as well if it was not explicitly set

This commit is contained in:
Shay Banon 2012-01-05 20:49:42 +02:00
parent d3b2a2cf66
commit 759d948335
2 changed files with 4 additions and 1 deletions

View File

@ -70,6 +70,9 @@ public class ClusterHealthRequest extends MasterNodeOperationRequest {
public ClusterHealthRequest timeout(TimeValue timeout) {
this.timeout = timeout;
if (masterNodeTimeout == DEFAULT_MASTER_NODE_TIMEOUT) {
masterNodeTimeout = timeout;
}
return this;
}

View File

@ -33,7 +33,7 @@ public abstract class MasterNodeOperationRequest implements ActionRequest {
public static TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30);
private TimeValue masterNodeTimeout = DEFAULT_MASTER_NODE_TIMEOUT;
protected TimeValue masterNodeTimeout = DEFAULT_MASTER_NODE_TIMEOUT;
@Override
public boolean listenerThreaded() {