Created
December 29, 2017 16:50
-
-
Save nik9000/84320047e828c773ec381eb433d64573 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testArchivedSetting() throws IOException { | |
if (runningAgainstOldCluster) { | |
String updateSettingsRequestBody = "{\"persistent\": {\"cluster.routing.allocation.disk.watermark.high\": 0.99}}"; | |
client().performRequest("PUT", "/_cluster/settings", emptyMap(), | |
new StringEntity(updateSettingsRequestBody, ContentType.APPLICATION_JSON)); | |
} | |
Map<?, ?> r = toMap(client().performRequest("GET", "/_cluster/settings", singletonMap("flat_settings", "true"))); | |
r = (Map<?, ?>) r.get("persistent"); | |
// The restart will have moved the setting to "archived" | |
assertEquals("0.99", r.get((runningAgainstOldCluster ? "" : "archived.") + "cluster.routing.allocation.disk.watermark.high")); | |
if (false == runningAgainstOldCluster) { | |
// We should be able to update another setting | |
String updateSettingsRequestBody = "{\"persistent\": {\"cluster.routing.allocation.enable\": \"all\"}}"; | |
client().performRequest("PUT", "/_cluster/settings", emptyMap(), | |
new StringEntity(updateSettingsRequestBody, ContentType.APPLICATION_JSON)); | |
// And lets read it back just for good measure | |
r = toMap(client().performRequest("GET", "/_cluster/settings", singletonMap("flat_settings", "true"))); | |
r = (Map<?, ?>) r.get("transient"); | |
assertEquals("all", r.get("cluster.routing.allocation.enable")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment