Rename static DiscoveryNode#localNode(Settings) to DiscoveryNode#isLocalNode(Settings)

This commit is contained in:
javanna 2016-03-30 15:00:03 +02:00 committed by Luca Cavanna
parent 7751b45f0f
commit 2dbba45f2c
5 changed files with 5 additions and 6 deletions

View File

@ -47,7 +47,7 @@ import static org.elasticsearch.common.transport.TransportAddressSerializers.add
*/
public class DiscoveryNode implements Writeable<DiscoveryNode>, ToXContent {
public static boolean localNode(Settings settings) {
public static boolean isLocalNode(Settings settings) {
if (Node.NODE_LOCAL_SETTING.exists(settings)) {
return Node.NODE_LOCAL_SETTING.get(settings);
}

View File

@ -387,7 +387,7 @@ public class NetworkModule extends AbstractModule {
bind(NamedWriteableRegistry.class).toInstance(namedWriteableRegistry);
transportServiceTypes.bindType(binder(), settings, TRANSPORT_SERVICE_TYPE_KEY, NETTY_TRANSPORT);
String defaultTransport = DiscoveryNode.localNode(settings) ? LOCAL_TRANSPORT : NETTY_TRANSPORT;
String defaultTransport = DiscoveryNode.isLocalNode(settings) ? LOCAL_TRANSPORT : NETTY_TRANSPORT;
transportTypes.bindType(binder(), settings, TRANSPORT_TYPE_KEY, defaultTransport);
if (transportClient) {

View File

@ -47,7 +47,7 @@ import java.util.function.Function;
public class DiscoveryModule extends AbstractModule {
public static final Setting<String> DISCOVERY_TYPE_SETTING =
new Setting<>("discovery.type", settings -> DiscoveryNode.localNode(settings) ? "local" : "zen", Function.identity(),
new Setting<>("discovery.type", settings -> DiscoveryNode.isLocalNode(settings) ? "local" : "zen", Function.identity(),
Property.NodeScope);
public static final Setting<String> ZEN_MASTER_SERVICE_TYPE_SETTING =
new Setting<>("discovery.zen.masterservice.type", "zen", Function.identity(), Property.NodeScope);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder;
import org.elasticsearch.cache.recycler.PageCacheRecycler;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.Requests;
@ -191,7 +190,7 @@ public abstract class ESSingleNodeTestCase extends ESTestCase {
.build();
Node build = new MockNode(settings, getVersion(), getPlugins());
build.start();
assertThat(DiscoveryNode.localNode(build.settings()), is(true));
assertThat(DiscoveryNode.isLocalNode(build.settings()), is(true));
return build;
}

View File

@ -329,7 +329,7 @@ public final class InternalTestCluster extends TestCluster {
if (Strings.hasLength(System.getProperty("es.node.local"))) {
builder.put(Node.NODE_LOCAL_SETTING.getKey(), System.getProperty("es.node.local"));
}
if (DiscoveryNode.localNode(builder.build())) {
if (DiscoveryNode.isLocalNode(builder.build())) {
return "local";
} else {
return "network";