Networking: Deprecate http.enabled setting (#29591)
This commit deprecates the http.enabled, in preparation for removing the feature in 7.0. relates #12792
This commit is contained in:
parent
0c9baebe15
commit
98d776edaf
|
@ -71,7 +71,8 @@ public final class NetworkModule {
|
|||
Property.NodeScope);
|
||||
public static final Setting<String> HTTP_DEFAULT_TYPE_SETTING = Setting.simpleString(HTTP_TYPE_DEFAULT_KEY, Property.NodeScope);
|
||||
public static final Setting<String> HTTP_TYPE_SETTING = Setting.simpleString(HTTP_TYPE_KEY, Property.NodeScope);
|
||||
public static final Setting<Boolean> HTTP_ENABLED = Setting.boolSetting("http.enabled", true, Property.NodeScope);
|
||||
public static final Setting<Boolean> HTTP_ENABLED = Setting.boolSetting("http.enabled", true,
|
||||
Property.NodeScope, Property.Deprecated);
|
||||
public static final Setting<String> TRANSPORT_TYPE_SETTING = Setting.simpleString(TRANSPORT_TYPE_KEY, Property.NodeScope);
|
||||
|
||||
private final Settings settings;
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.elasticsearch.common.Table;
|
|||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||
import org.elasticsearch.common.inject.ModuleTestCase;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
|
@ -151,6 +152,7 @@ public class NetworkModuleTests extends ModuleTestCase {
|
|||
assertSame(custom, module.getTransportSupplier());
|
||||
assertTrue(module.isTransportClient());
|
||||
assertFalse(module.isHttpEnabled());
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public void testRegisterHttpTransport() {
|
||||
|
@ -181,6 +183,7 @@ public class NetworkModuleTests extends ModuleTestCase {
|
|||
assertFalse(newModule.isTransportClient());
|
||||
assertFalse(newModule.isHttpEnabled());
|
||||
expectThrows(IllegalStateException.class, () -> newModule.getHttpServerTransportSupplier());
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public void testOverrideDefault() {
|
||||
|
@ -306,7 +309,7 @@ public class NetworkModuleTests extends ModuleTestCase {
|
|||
});
|
||||
});
|
||||
assertEquals("interceptor must not be null", nullPointerException.getMessage());
|
||||
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
private NetworkModule newNetworkModule(Settings settings, boolean transportClient, NetworkPlugin... plugins) {
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.elasticsearch.bootstrap.BootstrapCheck;
|
|||
import org.elasticsearch.bootstrap.BootstrapContext;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||
import org.elasticsearch.env.Environment;
|
||||
|
@ -62,6 +63,7 @@ public class NodeTests extends ESTestCase {
|
|||
assertThat(Node.NODE_NAME_SETTING.get(nodeSettings), equalTo(name));
|
||||
}
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public static class CheckPlugin extends Plugin {
|
||||
|
@ -93,6 +95,7 @@ public class NodeTests extends ESTestCase {
|
|||
expectThrows(NodeValidationException.class, () -> node.start());
|
||||
assertTrue(executed.get());
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public void testWarnIfPreRelease() {
|
||||
|
@ -144,6 +147,7 @@ public class NodeTests extends ESTestCase {
|
|||
} catch (IllegalArgumentException e) {
|
||||
assertEquals("node.attr.test_attr cannot have leading or trailing whitespace [trailing ]", e.getMessage());
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
private static Settings.Builder baseSettings() {
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
package org.elasticsearch.node;
|
||||
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
import org.elasticsearch.common.util.MockBigArrays;
|
||||
|
@ -67,5 +69,6 @@ public class MockNodeTests extends ESTestCase {
|
|||
assertSame(searchService.getClass(), SearchService.class);
|
||||
}
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package org.elasticsearch.test.test;
|
||||
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.elasticsearch.client.Client;
|
||||
|
@ -242,6 +243,7 @@ public class InternalTestClusterTests extends ESTestCase {
|
|||
} finally {
|
||||
IOUtils.close(cluster0, cluster1);
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public void testDataFolderAssignmentAndCleaning() throws IOException, InterruptedException {
|
||||
|
@ -346,6 +348,7 @@ public class InternalTestClusterTests extends ESTestCase {
|
|||
} finally {
|
||||
cluster.close();
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
private Path[] getNodePaths(InternalTestCluster cluster, String name) {
|
||||
|
@ -446,6 +449,7 @@ public class InternalTestClusterTests extends ESTestCase {
|
|||
} finally {
|
||||
cluster.close();
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
|
||||
public void testTwoNodeCluster() throws Exception {
|
||||
|
@ -505,5 +509,6 @@ public class InternalTestClusterTests extends ESTestCase {
|
|||
} finally {
|
||||
cluster.close();
|
||||
}
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue