bschuchardt commented on a change in pull request #6013:
URL: https://github.com/apache/geode/pull/6013#discussion_r574604072
##########
File path:
geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
##########
@@ -108,11 +109,15 @@ public void locatorJoined(final int distributedSystemId,
final DistributionLocat
final DistributionLocatorId sourceLocator) {
// DistributionLocatorId for local locator.
DistributionLocatorId localLocatorId;
+
+ InternalDistributedSystem system =
InternalDistributedSystem.getConnectedInstance();
Review comment:
this line to get an InternalDistributedSystem is no longer needed
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
##########
@@ -104,6 +126,32 @@ public DistributionLocatorId(InetAddress host, int port,
String bindAddress, SSL
* two.
*/
public DistributionLocatorId(String marshalled) {
+ this(marshalled, DistributionConfig.DEFAULT_NAME);
+ }
+
+ /**
+ * 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) {
+ if (membername == null) {
+ membername = DistributionConfig.DEFAULT_NAME;
+ }
+ this.membername = membername;
Review comment:
You need an "else" here
##########
File path:
geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
##########
@@ -100,6 +129,14 @@ public static boolean addExchangedLocators(Map<Integer,
Set<DistributionLocatorI
if (!localLocators.equals(entry.getValue())) {
entry.getValue().removeAll(localLocators);
for (DistributionLocatorId locator : entry.getValue()) {
+ if
(!locator.getMemberName().equals(DistributionConfig.DEFAULT_NAME)
Review comment:
would you please add a comment here as to why it's okay to ignore the
other map's locator ID when the membername matches one that's already in the
local map?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]