support lt(N), le(N), gt(N), ge(N) in wait for nodes (thanks Lukas)
This commit is contained in:
parent
65284ba2ba
commit
f251e2fd32
|
@ -101,21 +101,41 @@ public class TransportClusterHealthAction extends TransportMasterNodeOperationAc
|
|||
if (response.numberOfNodes() >= expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("ge(")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(3, request.waitForNodes().length() - 1));
|
||||
if (response.numberOfNodes() >= expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("<=")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(2));
|
||||
if (response.numberOfNodes() <= expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("le(")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(3, request.waitForNodes().length() - 1));
|
||||
if (response.numberOfNodes() <= expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith(">")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(1));
|
||||
if (response.numberOfNodes() > expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("gt(")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(3, request.waitForNodes().length() - 1));
|
||||
if (response.numberOfNodes() > expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("<")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(1));
|
||||
if (response.numberOfNodes() < expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else if (request.waitForNodes().startsWith("lt(")) {
|
||||
int expected = Integer.parseInt(request.waitForNodes().substring(3, request.waitForNodes().length() - 1));
|
||||
if (response.numberOfNodes() < expected) {
|
||||
waitForCounter++;
|
||||
}
|
||||
} else {
|
||||
int expected = Integer.parseInt(request.waitForNodes());
|
||||
if (response.numberOfNodes() == expected) {
|
||||
|
|
Loading…
Reference in New Issue