fix compile after change to Client settings in core
Original commit: elastic/x-pack-elasticsearch@ab069484a6
This commit is contained in:
parent
d587ace5f1
commit
dcf9074c4f
|
@ -45,11 +45,11 @@ public class LicensePlugin extends Plugin {
|
||||||
public LicensePlugin(Settings settings) {
|
public LicensePlugin(Settings settings) {
|
||||||
if (DiscoveryNode.clientNode(settings)) {
|
if (DiscoveryNode.clientNode(settings)) {
|
||||||
// Enable plugin only on node clients
|
// Enable plugin only on node clients
|
||||||
this.isEnabled = "node".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
this.isEnabled = "node".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
} else {
|
} else {
|
||||||
this.isEnabled = true;
|
this.isEnabled = true;
|
||||||
}
|
}
|
||||||
transportClient = "transport".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
transportClient = "transport".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,7 +21,7 @@ public abstract class TestConsumerPluginBase extends Plugin {
|
||||||
public TestConsumerPluginBase(Settings settings) {
|
public TestConsumerPluginBase(Settings settings) {
|
||||||
if (DiscoveryNode.clientNode(settings)) {
|
if (DiscoveryNode.clientNode(settings)) {
|
||||||
// Enable plugin only on node clients
|
// Enable plugin only on node clients
|
||||||
this.isEnabled = "node".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
this.isEnabled = "node".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
} else {
|
} else {
|
||||||
this.isEnabled = true;
|
this.isEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class MarvelPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean marvelEnabled(Settings settings) {
|
public static boolean marvelEnabled(Settings settings) {
|
||||||
if (!"node".equals(settings.get(Client.CLIENT_TYPE_SETTING))) {
|
if (!"node".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()))) {
|
||||||
logger.trace("marvel cannot be started on a transport client");
|
logger.trace("marvel cannot be started on a transport client");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.is;
|
||||||
public class MarvelPluginClientTests extends ESTestCase {
|
public class MarvelPluginClientTests extends ESTestCase {
|
||||||
public void testModulesWithClientSettings() {
|
public void testModulesWithClientSettings() {
|
||||||
Settings settings = Settings.builder()
|
Settings settings = Settings.builder()
|
||||||
.put(Client.CLIENT_TYPE_SETTING, TransportClient.CLIENT_TYPE)
|
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), TransportClient.CLIENT_TYPE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
MarvelPlugin plugin = new MarvelPlugin(settings);
|
MarvelPlugin plugin = new MarvelPlugin(settings);
|
||||||
|
@ -30,7 +30,7 @@ public class MarvelPluginClientTests extends ESTestCase {
|
||||||
public void testModulesWithNodeSettings() {
|
public void testModulesWithNodeSettings() {
|
||||||
// these settings mimic what ES does when running as a node...
|
// these settings mimic what ES does when running as a node...
|
||||||
Settings settings = Settings.builder()
|
Settings settings = Settings.builder()
|
||||||
.put(Client.CLIENT_TYPE_SETTING, "node")
|
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "node")
|
||||||
.build();
|
.build();
|
||||||
MarvelPlugin plugin = new MarvelPlugin(settings);
|
MarvelPlugin plugin = new MarvelPlugin(settings);
|
||||||
assertThat(plugin.isEnabled(), is(true));
|
assertThat(plugin.isEnabled(), is(true));
|
||||||
|
|
|
@ -349,7 +349,7 @@ public class ShieldPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean clientMode(Settings settings) {
|
public static boolean clientMode(Settings settings) {
|
||||||
return !"node".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
return !"node".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shieldEnabled(Settings settings) {
|
public static boolean shieldEnabled(Settings settings) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ public abstract class AbstractShieldModule extends AbstractModule {
|
||||||
|
|
||||||
public AbstractShieldModule(Settings settings) {
|
public AbstractShieldModule(Settings settings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.clientMode = !"node".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
this.clientMode = !"node".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
this.shieldEnabled = ShieldPlugin.shieldEnabled(settings);
|
this.shieldEnabled = ShieldPlugin.shieldEnabled(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class WatcherPlugin extends Plugin {
|
||||||
|
|
||||||
public WatcherPlugin(Settings settings) {
|
public WatcherPlugin(Settings settings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
transportClient = "transport".equals(settings.get(Client.CLIENT_TYPE_SETTING));
|
transportClient = "transport".equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey()));
|
||||||
enabled = watcherEnabled(settings);
|
enabled = watcherEnabled(settings);
|
||||||
validAutoCreateIndex(settings);
|
validAutoCreateIndex(settings);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue