Revert "[TEST] Use deprecated form of rollup endpoint in mixed cluster (#36000)"

This reverts commit 85cdf4f913.
This commit is contained in:
Zachary Tong 2018-11-29 12:56:25 -05:00
parent f8636e58f9
commit 40c5445480
1 changed files with 3 additions and 5 deletions

View File

@ -474,9 +474,7 @@ public abstract class ESRestTestCase extends ESTestCase {
}
private void wipeRollupJobs() throws IOException, InterruptedException {
String rollupPrefix = nodeVersions.stream().anyMatch(node -> node.before(Version.V_7_0_0)) ? "/_xpack/rollup" : "/_rollup";
Response response = adminClient().performRequest(new Request("GET", rollupPrefix + "/job/_all"));
Response response = adminClient().performRequest(new Request("GET", "/_rollup/job/_all"));
Map<String, Object> jobs = entityAsMap(response);
@SuppressWarnings("unchecked")
List<Map<String, Object>> jobConfigs =
@ -489,7 +487,7 @@ public abstract class ESRestTestCase extends ESTestCase {
for (Map<String, Object> jobConfig : jobConfigs) {
@SuppressWarnings("unchecked")
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
Request request = new Request("POST", rollupPrefix + "/job/" + jobId + "/_stop");
Request request = new Request("POST", "/_rollup/job/" + jobId + "/_stop");
request.addParameter("ignore", "404");
request.addParameter("wait_for_completion", "true");
request.addParameter("timeout", "10s");
@ -500,7 +498,7 @@ public abstract class ESRestTestCase extends ESTestCase {
for (Map<String, Object> jobConfig : jobConfigs) {
@SuppressWarnings("unchecked")
String jobId = (String) ((Map<String, Object>) jobConfig.get("config")).get("id");
Request request = new Request("DELETE", rollupPrefix + "/job/" + jobId);
Request request = new Request("DELETE", "/_rollup/job/" + jobId);
request.addParameter("ignore", "404"); // Ignore 404s because they imply someone was racing us to delete this
logger.debug("deleting rollup job [{}]", jobId);
adminClient().performRequest(request);