You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2021/02/08 23:31:29 UTC
[geode] 01/01: Revert "Feature/geode 8768 (#5843)"
This is an automated email from the ASF dual-hosted git repository.
zhouxj pushed a commit to branch feature/GEODE-8928
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 526dcbb3e15559d634f381dd09b9d9ff7dd64d03
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Mon Feb 8 15:24:23 2021 -0800
Revert "Feature/geode 8768 (#5843)"
This reverts commit 48a733a576e7db8d558280cfc4491f079c7eefe3.
---
.../admin/remote/DistributionLocatorId.java | 104 +---------------
.../sanctioned-geode-core-serializables.txt | 2 +-
.../cache/wan/misc/WanAutoDiscoveryDUnitTest.java | 24 +---
.../wan/misc/WanLocatorDiscoveryDUnitTest.java | 131 ---------------------
.../client/internal/locator/wan/LocatorHelper.java | 33 ------
.../locator/wan/LocatorMembershipListenerImpl.java | 12 +-
.../locator/wan/WanLocatorDiscovererImpl.java | 24 +---
7 files changed, 17 insertions(+), 313 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
index b69d6c4..3af2017 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
@@ -20,7 +20,6 @@ import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
@@ -34,9 +33,7 @@ import org.apache.geode.internal.net.SocketCreator;
/**
* Identifies the host, port, and bindAddress a distribution locator is listening on.
- * Also identifies member name of the distribution locator. This is used to improve
- * locator discovery logic.
- * If member name is set to null, then design base logic will be used.
+ *
*
*/
public class DistributionLocatorId implements java.io.Serializable {
@@ -52,14 +49,9 @@ public class DistributionLocatorId implements java.io.Serializable {
private boolean serverLocator = true;
private String hostnameForClients;
private String hostname;
- // added due to improvement for cloud native environment
- private final String membername;
-
/**
* Constructs a DistributionLocatorId with the given host and port.
- * This constructor is used for design base behavior.
- *
*/
public DistributionLocatorId(InetAddress host, int port, String bindAddress,
SSLConfig sslConfig) {
@@ -67,24 +59,16 @@ public class DistributionLocatorId implements java.io.Serializable {
this.port = port;
this.bindAddress = validateBindAddress(bindAddress);
this.sslConfig = validateSSLConfig(sslConfig);
- this.membername = null;
}
+ /**
+ * Constructs a DistributionLocatorId with the given port. The host will be set to the local host.
+ */
public DistributionLocatorId(int port, String bindAddress) {
this(port, bindAddress, null);
}
public DistributionLocatorId(int port, String bindAddress, String hostnameForClients) {
- this(port, bindAddress, hostnameForClients, null);
- }
-
- /**
- * Constructs a DistributionLocatorId with the given port and member name.
- * The host will be set to the local host.
- *
- */
- public DistributionLocatorId(int port, String bindAddress, String hostnameForClients,
- String membername) {
try {
this.host = LocalHostUtil.getLocalHost();
} catch (UnknownHostException ex) {
@@ -95,7 +79,6 @@ public class DistributionLocatorId implements java.io.Serializable {
this.bindAddress = validateBindAddress(bindAddress);
this.sslConfig = validateSSLConfig(null);
this.hostnameForClients = hostnameForClients;
- this.membername = membername;
}
public DistributionLocatorId(InetAddress host, int port, String bindAddress, SSLConfig sslConfig,
@@ -105,10 +88,8 @@ public class DistributionLocatorId implements java.io.Serializable {
this.bindAddress = validateBindAddress(bindAddress);
this.sslConfig = validateSSLConfig(sslConfig);
this.hostnameForClients = hostnameForClients;
- this.membername = null;
}
-
/**
* Constructs a DistributionLocatorId with a String of the form: hostname[port] or
* hostname:bindaddress[port] or hostname@bindaddress[port]
@@ -123,29 +104,6 @@ public class DistributionLocatorId implements java.io.Serializable {
* two.
*/
public DistributionLocatorId(String marshalled) {
- this(marshalled, null);
- }
-
- /**
- * Constructs a DistributionLocatorId with a String of the form: hostname[port] or
- * hostname:bindaddress[port] or hostname@bindaddress[port]
- * and membername
- * <p>
- * The :bindaddress portion is optional. hostname[port] is the more common form.
- * <p>
- * Example: merry.gemstone.com[7056]<br>
- * Example w/ bind address: merry.gemstone.com:81.240.0.1[7056], or
- * merry.gemstone.com@fdf0:76cf:a0ed:9449::16[7056]
- * <p>
- * Use bindaddress[port] or hostname[port]. This object doesn't need to differentiate between the
- * two.
- * <p>
- * Membername example: locator1 or locator-ny1.
- * <p>
- */
- public DistributionLocatorId(String marshalled, String membername) {
- this.membername = membername;
-
final int portStartIdx = marshalled.indexOf('[');
final int portEndIdx = marshalled.indexOf(']');
@@ -300,10 +258,6 @@ public class DistributionLocatorId implements java.io.Serializable {
return this.hostnameForClients;
}
- public String getMemberName() {
- return this.membername;
- }
-
// private String hostNameToString() {
// if (this.host.isMulticastAddress()) {
// return this.host.getHostAddress();
@@ -351,11 +305,7 @@ public class DistributionLocatorId implements java.io.Serializable {
* Indicates whether some other object is "equal to" this one.
*
* @param other the reference object with which to compare.
- *
- * If member name is defined in both objects, and both objects have same member name,
- * or if member name is not defined, and all other parameters are the same;
- *
- * false otherwise.
+ * @return true if this object is the same as the obj argument; false otherwise.
*/
@Override
public boolean equals(Object other) {
@@ -367,44 +317,7 @@ public class DistributionLocatorId implements java.io.Serializable {
return false;
final DistributionLocatorId that = (DistributionLocatorId) other;
- if (this.membername != null && that.membername != null) {
- if (this.membername.equals(that.membername))
- return true;
-
- return false;
- }
-
- if (!StringUtils.equals(this.hostnameForClients, that.hostnameForClients))
- return false;
- if (!Objects.equals(this.host, that.host))
- return false;
- if (this.port != that.port)
- return false;
- if (!StringUtils.equals(this.bindAddress, that.bindAddress))
- return false;
-
- return true;
- }
-
- /**
- *
- * In case both objects have same member name, it will compare all other parameters
- *
- * @param other the reference object with which to compare.
- * @return true if this object is the same as the obj argument; false otherwise.
- */
- public boolean detailCompare(Object other) {
- if (other == this)
- return true;
- if (other == null)
- return false;
- if (!(other instanceof DistributionLocatorId))
- return false;
- final DistributionLocatorId that = (DistributionLocatorId) other;
-
- if (!StringUtils.equals(this.hostnameForClients, that.hostnameForClients))
- return false;
- if (!Objects.equals(this.host, that.host))
+ if (this.host != that.host && !(this.host != null && this.host.equals(that.host)))
return false;
if (this.port != that.port)
return false;
@@ -425,11 +338,6 @@ public class DistributionLocatorId implements java.io.Serializable {
int result = 17;
final int mult = 37;
- if (this.membername != null) {
- result = mult * result + this.membername.hashCode();
- return result;
- }
-
result = mult * result + (this.host == null ? 0 : this.host.hashCode());
result = mult * result + this.port;
result = mult * result + (this.bindAddress == null ? 0 : this.bindAddress.hashCode());
diff --git a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
index b8eb3f7..652d1b2 100644
--- a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
+++ b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
@@ -268,7 +268,7 @@ org/apache/geode/internal/SystemAdmin$CombinedResources,false
org/apache/geode/internal/admin/CompoundEntrySnapshot,true,5776382582897895718,allUserAttributes:java/util/Set,allValues:java/util/Set,hitRatio:float,hitRatioSum:double,hitResponders:long,lastAccessTime:long,lastModifiedTime:long,name:java/lang/Object,numHits:long,numMisses:long
org/apache/geode/internal/admin/CompoundRegionSnapshot,true,6295026394298398004,allCacheLoaders:java/util/Set,allCacheWriters:java/util/Set,allCapControllers:java/util/Set,allConcLevels:java/util/Set,allCustomIdle:java/util/HashSet,allCustomTtl:java/util/HashSet,allDataPolicies:java/util/Set,allEntryIdleTimeout:java/util/Set,allEntryTtl:java/util/Set,allInitialCaps:java/util/Set,allKeyConstraints:java/util/Set,allListeners:java/util/Set,allLoadFactors:java/util/Set,allRegionIdleTimeout:j [...]
org/apache/geode/internal/admin/StatAlert,true,5725457607122449170,definitionId:int,time:java/util/Date,values:java/lang/Number[]
-org/apache/geode/internal/admin/remote/DistributionLocatorId,true,6587390186971937865,bindAddress:java/lang/String,host:java/net/InetAddress,hostname:java/lang/String,hostnameForClients:java/lang/String,membername:java/lang/String,peerLocator:boolean,port:int,serverLocator:boolean
+org/apache/geode/internal/admin/remote/DistributionLocatorId,true,6587390186971937865,bindAddress:java/lang/String,host:java/net/InetAddress,hostname:java/lang/String,hostnameForClients:java/lang/String,peerLocator:boolean,port:int,serverLocator:boolean
org/apache/geode/internal/admin/remote/EntryValueNodeImpl,false,fields:org/apache/geode/internal/admin/remote/EntryValueNodeImpl[],name:java/lang/String,primitive:boolean,primitiveVal:java/lang/Object,type:java/lang/String
org/apache/geode/internal/cache/BucketAdvisor$SetFromMap,true,2454657854757543876,m:java/util/Map
org/apache/geode/internal/cache/BucketNotFoundException,true,2898657229184289911
diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
index 6efb8f7..1842dde 100644
--- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
+++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
@@ -344,38 +344,22 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(4);
final Set<String> site1LocatorsPort = new HashSet<String>();
- final Set<String> site11LocatorsPort = new HashSet<String>();
-
site1LocatorsPort.add("localhost[" + ports[0] + "]");
- site11LocatorsPort
- .add("localhost[" + ports[0] + "],server=true,peer=true,hostname-for-clients=localhost");
final Set<String> site2LocatorsPort = new HashSet<String>();
- final Set<String> site22LocatorsPort = new HashSet<String>();
-
site2LocatorsPort.add("localhost[" + ports[1] + "]");
- site22LocatorsPort
- .add("localhost[" + ports[1] + "],server=true,peer=true,hostname-for-clients=localhost");
final Set<String> site3LocatorsPort = new HashSet<String>();
- final Set<String> site33LocatorsPort = new HashSet<String>();
-
site3LocatorsPort.add("localhost[" + ports[2] + "]");
- site33LocatorsPort
- .add("localhost[" + ports[2] + "],server=true,peer=true,hostname-for-clients=localhost");
final Set<String> site4LocatorsPort = new HashSet<String>();
- final Set<String> site44LocatorsPort = new HashSet<String>();
-
site4LocatorsPort.add("localhost[" + ports[3] + "]");
- site44LocatorsPort
- .add("localhost[" + ports[3] + "],server=true,peer=true,hostname-for-clients=localhost");
Map<Integer, Set<String>> dsVsPort = new HashMap<Integer, Set<String>>();
- dsVsPort.put(1, site11LocatorsPort);
- dsVsPort.put(2, site22LocatorsPort);
- dsVsPort.put(3, site33LocatorsPort);
- dsVsPort.put(4, site44LocatorsPort);
+ dsVsPort.put(1, site1LocatorsPort);
+ dsVsPort.put(2, site2LocatorsPort);
+ dsVsPort.put(3, site3LocatorsPort);
+ dsVsPort.put(4, site4LocatorsPort);
int AsyncInvocationArrSize = 9;
AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];
diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanLocatorDiscoveryDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanLocatorDiscoveryDUnitTest.java
deleted file mode 100644
index f9117bb..0000000
--- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanLocatorDiscoveryDUnitTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.internal.cache.wan.misc;
-
-import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
-import static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.geode.cache.client.internal.locator.wan.LocatorMembershipListener;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.admin.remote.DistributionLocatorId;
-import org.apache.geode.test.awaitility.GeodeAwaitility;
-import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.rules.ClusterStartupRule;
-import org.apache.geode.test.dunit.rules.MemberVM;
-import org.apache.geode.test.version.VersionManager;
-
-public class WanLocatorDiscoveryDUnitTest {
-
- private static MemberVM locator_ln1;
- private static MemberVM locator_ln2;
-
- private static MemberVM locator_ny1;
- private static MemberVM locator_ny2;
- private int[] ports;
-
- @Rule
- public ClusterStartupRule cluster = new ClusterStartupRule();
-
- @Before
- public void setupCluster() throws Exception {
- IgnoredException.addIgnoredException("Connection reset");
- IgnoredException.addIgnoredException("Broken pipe");
- IgnoredException.addIgnoredException("Connection refused");
- IgnoredException.addIgnoredException("could not get remote locator information");
- IgnoredException.addIgnoredException("Unexpected IOException");
- }
-
- private void setupWanSites() throws IOException {
- ports = AvailablePortHelper.getRandomAvailableTCPPorts(5);
- int site1Port =
- setupWanSite1();
- setupWanSite2(site1Port);
- }
-
- private int setupWanSite1() throws IOException {
- locator_ln1 = cluster.startLocatorVM(0, ports[0], VersionManager.CURRENT_VERSION,
- i -> i.withProperty(DISTRIBUTED_SYSTEM_ID, "1"));
-
- int locator_ln1_port = locator_ln1.getPort();
-
- locator_ln2 = cluster.startLocatorVM(1, ports[1], VersionManager.CURRENT_VERSION,
- i -> i.withProperty(DISTRIBUTED_SYSTEM_ID, "1")
- .withConnectionToLocator(locator_ln1_port));
-
- return locator_ln1_port;
- }
-
- private void setupWanSite2(int site1Port) throws IOException {
- locator_ny1 = cluster.startLocatorVM(2, ports[2], VersionManager.CURRENT_VERSION,
- i -> i.withProperty(DISTRIBUTED_SYSTEM_ID, "2")
- .withProperty(REMOTE_LOCATORS, "localhost[" + site1Port + "]"));
-
- int locator_ny1_port = locator_ny1.getPort();
-
- locator_ny2 = cluster.startLocatorVM(3, ports[3], VersionManager.CURRENT_VERSION,
- i -> i.withProperty(DISTRIBUTED_SYSTEM_ID, "2")
- .withProperty(REMOTE_LOCATORS, "localhost[" + site1Port + "]")
- .withConnectionToLocator(locator_ny1_port));
- }
-
- @Test
- public void testLocatorList() throws Exception {
- setupWanSites();
- locator_ny1.invoke(() -> {
- LocatorMembershipListener listener =
- ClusterStartupRule.getLocator().getLocatorMembershipListener();
- GeodeAwaitility.await()
- .untilAsserted(() -> assertThat(listener.getAllLocatorsInfo().size()).isEqualTo(2));
- for (Map.Entry<Integer, Set<DistributionLocatorId>> entry : listener.getAllLocatorsInfo()
- .entrySet()) {
- GeodeAwaitility.await()
- .untilAsserted(() -> assertThat(entry.getValue().size()).isEqualTo(2));
- }
-
- });
-
- locator_ln2.stop();
-
- int locator_ln1_port = locator_ln1.getPort();
-
- locator_ln2 = cluster.startLocatorVM(1, ports[4], VersionManager.CURRENT_VERSION,
- i -> i.withProperty(DISTRIBUTED_SYSTEM_ID, "1")
- .withConnectionToLocator(locator_ln1_port));
-
- locator_ny2.invoke(() -> {
- LocatorMembershipListener listener =
- ClusterStartupRule.getLocator().getLocatorMembershipListener();
- GeodeAwaitility.await()
- .untilAsserted(() -> assertThat(listener.getAllLocatorsInfo().size()).isEqualTo(2));
-
- for (Map.Entry<Integer, Set<DistributionLocatorId>> entry : listener.getAllLocatorsInfo()
- .entrySet()) {
- GeodeAwaitility.await()
- .untilAsserted(() -> assertThat(entry.getValue().size()).isEqualTo(2));
- }
-
- });
- }
-
-}
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
index e9ad79a..17f9c47 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
@@ -50,28 +50,6 @@ public class LocatorHelper {
existingValue.add(locator);
addServerLocator(distributedSystemId, locatorListener, locator);
locatorListener.locatorJoined(distributedSystemId, locator, sourceLocator);
- } else if (locator.getMemberName() != null) {
- DistributionLocatorId tempLocator = null;
- for (DistributionLocatorId locElement : existingValue) {
- if (locator.equals(locElement) && locElement.getMemberName() != null) {
- tempLocator = locElement;
- break;
- }
- }
- if (tempLocator != null) {
- if (!locator.detailCompare(tempLocator)) {
- existingValue.remove(tempLocator);
- ConcurrentHashMap<Integer, Set<String>> allServerLocatorsInfo =
- (ConcurrentHashMap<Integer, Set<String>>) locatorListener
- .getAllServerLocatorsInfo();
- Set<String> alllocators = allServerLocatorsInfo.get(distributedSystemId);
- alllocators.remove(tempLocator.toString());
- addServerLocator(distributedSystemId, locatorListener, locator);
- locatorListener.locatorJoined(distributedSystemId, locator, sourceLocator);
- return true;
- }
- }
- return false;
} else {
return false;
}
@@ -122,17 +100,6 @@ public class LocatorHelper {
if (!localLocators.equals(entry.getValue())) {
entry.getValue().removeAll(localLocators);
for (DistributionLocatorId locator : entry.getValue()) {
- if (locator.getMemberName() == null && !localLocators.isEmpty()) {
- boolean locatorExist = false;
- for (DistributionLocatorId locId : localLocators) {
- if (locId.equals(locator)) {
- locatorExist = true;
- break;
- }
- }
- if (locatorExist)
- continue;
- }
localLocators.add(locator);
addServerLocator(entry.getKey(), locatorListener, locator);
locatorListener.locatorJoined(entry.getKey(), locator, null);
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
index 9c8ebee..253f6dc 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
@@ -29,7 +29,6 @@ import java.util.concurrent.ThreadFactory;
import org.apache.logging.log4j.Logger;
import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.distributed.internal.tcpserver.TcpClient;
import org.apache.geode.distributed.internal.tcpserver.TcpSocketFactory;
import org.apache.geode.internal.CopyOnWriteHashSet;
@@ -109,18 +108,11 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
final DistributionLocatorId sourceLocator) {
// DistributionLocatorId for local locator.
DistributionLocatorId localLocatorId;
-
- InternalDistributedSystem system = InternalDistributedSystem.getConnectedInstance();
- String memberName = null;
- if (system != null) {
- memberName = system.getDistributedMember().getName();
- }
String localLocator = config.getStartLocator();
if (localLocator.equals(DistributionConfig.DEFAULT_START_LOCATOR)) {
- localLocatorId =
- new DistributionLocatorId(port, config.getBindAddress(), null, memberName);
+ localLocatorId = new DistributionLocatorId(port, config.getBindAddress());
} else {
- localLocatorId = new DistributionLocatorId(localLocator, memberName);
+ localLocatorId = new DistributionLocatorId(localLocator);
}
// Make a local copy of the current list of known locators.
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WanLocatorDiscovererImpl.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WanLocatorDiscovererImpl.java
index 36ab5ab..984d148 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WanLocatorDiscovererImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WanLocatorDiscovererImpl.java
@@ -21,7 +21,6 @@ import org.apache.logging.log4j.Logger;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.distributed.internal.DistributionConfigImpl;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.distributed.internal.WanLocatorDiscoverer;
import org.apache.geode.internal.admin.remote.DistributionLocatorId;
import org.apache.geode.logging.internal.executors.LoggingExecutors;
@@ -66,19 +65,11 @@ public class WanLocatorDiscovererImpl implements WanLocatorDiscoverer {
LocatorMembershipListener locatorListener, final String hostnameForClients) {
String localLocator = config.getStartLocator();
DistributionLocatorId locatorId = null;
-
- InternalDistributedSystem system = InternalDistributedSystem.getConnectedInstance();
- String memberName = null;
- if (system != null) {
- memberName = system.getDistributedMember().getName();
- }
if (localLocator.equals(DistributionConfig.DEFAULT_START_LOCATOR)) {
- locatorId = new DistributionLocatorId(port, config.getBindAddress(), hostnameForClients,
- memberName);
+ locatorId = new DistributionLocatorId(port, config.getBindAddress(), hostnameForClients);
} else {
- locatorId = new DistributionLocatorId(localLocator, memberName);
+ locatorId = new DistributionLocatorId(localLocator);
}
-
LocatorHelper.addLocator(config.getDistributedSystemId(), locatorId, locatorListener, null);
RemoteLocatorJoinRequest request = buildRemoteDSJoinRequest(port, config, hostnameForClients);
@@ -122,17 +113,10 @@ public class WanLocatorDiscovererImpl implements WanLocatorDiscoverer {
final String hostnameForClients) {
String localLocator = config.getStartLocator();
DistributionLocatorId locatorId = null;
-
- InternalDistributedSystem system = InternalDistributedSystem.getConnectedInstance();
- String memberName = null;
- if (system != null) {
- memberName = system.getDistributedMember().getName();
- }
if (localLocator.equals(DistributionConfig.DEFAULT_START_LOCATOR)) {
- locatorId = new DistributionLocatorId(port, config.getBindAddress(), hostnameForClients,
- memberName);
+ locatorId = new DistributionLocatorId(port, config.getBindAddress(), hostnameForClients);
} else {
- locatorId = new DistributionLocatorId(localLocator, memberName);
+ locatorId = new DistributionLocatorId(localLocator);
}
RemoteLocatorJoinRequest request =
new RemoteLocatorJoinRequest(config.getDistributedSystemId(), locatorId, "");