diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java index 91a5465f6a764..1c7475379bb87 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java @@ -32,13 +32,16 @@ import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.network.NetworkService; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.http.HttpServerTransport; +import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.http.NullDispatcher; import org.elasticsearch.http.netty4.pipelining.HttpPipelinedRequest; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; @@ -110,6 +113,8 @@ public void testThatHttpPipeliningWorksWhenEnabled() throws Exception { assertThat(responseBodies, contains(requests.toArray())); } } + + assertSettingDeprecationsAndWarnings(new Setting[] {HttpTransportSettings.SETTING_PIPELINING}); } public void testThatHttpPipeliningCanBeDisabled() throws Exception { @@ -152,6 +157,8 @@ public void testThatHttpPipeliningCanBeDisabled() throws Exception { assertThat(slowIds, equalTo(ids)); } } + + assertSettingDeprecationsAndWarnings(new Setting[] {HttpTransportSettings.SETTING_PIPELINING}); } class CustomNettyHttpServerTransport extends Netty4HttpServerTransport { diff --git a/server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java b/server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java index ce305872d222d..fbf596445982c 100644 --- a/server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java +++ b/server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java @@ -49,8 +49,9 @@ public final class HttpTransportSettings { new Setting<>("http.cors.allow-headers", "X-Requested-With,Content-Type,Content-Length", (value) -> value, Property.NodeScope); public static final Setting SETTING_CORS_ALLOW_CREDENTIALS = Setting.boolSetting("http.cors.allow-credentials", false, Property.NodeScope); + // In 7.0 pipelining support will always be enabled and this setting will be removed. public static final Setting SETTING_PIPELINING = - Setting.boolSetting("http.pipelining", true, Property.NodeScope); + Setting.boolSetting("http.pipelining", true, Property.NodeScope, Property.Deprecated); public static final Setting SETTING_PIPELINING_MAX_EVENTS = Setting.intSetting("http.pipelining.max_events", 10000, Property.NodeScope); public static final Setting SETTING_HTTP_COMPRESSION = diff --git a/test/framework/src/test/java/org/elasticsearch/node/MockNodeTests.java b/test/framework/src/test/java/org/elasticsearch/node/MockNodeTests.java index a0cdb8c3168f4..5eb437d14d608 100644 --- a/test/framework/src/test/java/org/elasticsearch/node/MockNodeTests.java +++ b/test/framework/src/test/java/org/elasticsearch/node/MockNodeTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.env.Environment; +import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.MockSearchService; import org.elasticsearch.search.SearchService; @@ -69,6 +70,6 @@ public void testComponentsMockedByMarkerPlugins() throws IOException { assertSame(searchService.getClass(), SearchService.class); } } - assertSettingDeprecationsAndWarnings(new Setting[] { NetworkModule.HTTP_ENABLED }); + assertSettingDeprecationsAndWarnings(new Setting[] {NetworkModule.HTTP_ENABLED}); } } diff --git a/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java index e2c8a99cf8b79..cca7cf70df657 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java @@ -31,6 +31,7 @@ import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.env.NodeEnvironment; +import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.InternalTestCluster; @@ -72,6 +73,8 @@ @LuceneTestCase.SuppressFileSystems("ExtrasFS") // doesn't work with potential multi data path from test cluster yet public class InternalTestClusterTests extends ESTestCase { + private static final Setting[] DEPRECATED_SETTINGS = {NetworkModule.HTTP_ENABLED, HttpTransportSettings.SETTING_PIPELINING}; + public void testInitializiationIsConsistent() { long clusterSeed = randomLong(); boolean masterNodes = randomBoolean(); @@ -233,7 +236,7 @@ public Settings transportClientSettings() { assertArrayEquals(cluster0.getNodeNames(), cluster1.getNodeNames()); if (cluster0.getNodeNames().length > 0) { shouldAssertSettingsDeprecationsAndWarnings = true; - assertSettingDeprecationsAndWarnings(new Setting[]{NetworkModule.HTTP_ENABLED}); + assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS); } Iterator iterator1 = cluster1.getClients().iterator(); for (Client client : cluster0.getClients()) { @@ -248,7 +251,7 @@ public Settings transportClientSettings() { } finally { IOUtils.close(cluster0, cluster1); if (shouldAssertSettingsDeprecationsAndWarnings) { - assertSettingDeprecationsAndWarnings(new Setting[]{NetworkModule.HTTP_ENABLED}); + assertSettingDeprecationsAndWarnings(new Setting[] {NetworkModule.HTTP_ENABLED}); } } } @@ -355,7 +358,7 @@ public Settings transportClientSettings() { } finally { cluster.close(); } - assertSettingDeprecationsAndWarnings(new Setting[] { NetworkModule.HTTP_ENABLED }); + assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS); } private Path[] getNodePaths(InternalTestCluster cluster, String name) { @@ -456,7 +459,7 @@ public Settings transportClientSettings() { } finally { cluster.close(); } - assertSettingDeprecationsAndWarnings(new Setting[] { NetworkModule.HTTP_ENABLED }); + assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS); } public void testTwoNodeCluster() throws Exception { @@ -518,7 +521,7 @@ public Settings onNodeStopped(String nodeName) throws Exception { } finally { cluster.close(); } - assertSettingDeprecationsAndWarnings(new Setting[] { NetworkModule.HTTP_ENABLED }); + assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS); } /**