This is an automated email from the ASF dual-hosted git repository. jiajunwang pushed a commit to branch helix-0.9.x in repository https://gitbox.apache.org/repos/asf/helix.git
commit 3a113138a3323432dcb9010c0a0f5f3aa778fde1 Author: zhangmeng916 <[email protected]> AuthorDate: Tue Mar 10 11:10:39 2020 -0700 Add construction of domain in Helix participant logic (#876) Add the construction of domain field in Azure cloud instance information processor. It will read the topology from AzureConstants, and construct the domain based on the format of the topology. --- .../helix/cloud/azure/AzureCloudInstanceInformationProcessor.java | 7 ++++++- .../main/java/org/apache/helix/manager/zk/ParticipantManager.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/helix-core/src/main/java/org/apache/helix/cloud/azure/AzureCloudInstanceInformationProcessor.java b/helix-core/src/main/java/org/apache/helix/cloud/azure/AzureCloudInstanceInformationProcessor.java index 85e2bb5..464ff55 100644 --- a/helix-core/src/main/java/org/apache/helix/cloud/azure/AzureCloudInstanceInformationProcessor.java +++ b/helix-core/src/main/java/org/apache/helix/cloud/azure/AzureCloudInstanceInformationProcessor.java @@ -142,8 +142,13 @@ public class AzureCloudInstanceInformationProcessor String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); + String azureTopology = AzureConstants.AZURE_TOPOLOGY; + String[] parts = azureTopology.trim().split("/"); + //The hostname will be filled in by each participant + String domain = parts[0] + "=" + platformFaultDomain + "," + parts[1] + "="; + AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); - builder.setInstanceName(vmName).setFaultDomain(platformFaultDomain) + builder.setInstanceName(vmName).setFaultDomain(domain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java index 7ae62b8..7063c20 100644 --- a/helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java +++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java @@ -178,7 +178,7 @@ public class ParticipantManager { LOG.info(_instanceName + " is auto-registering cluster: " + _clusterName); CloudInstanceInformation cloudInstanceInformation = getCloudInstanceInformation(); String domain = cloudInstanceInformation - .get(CloudInstanceInformation.CloudInstanceField.FAULT_DOMAIN.name()); + .get(CloudInstanceInformation.CloudInstanceField.FAULT_DOMAIN.name()) + _instanceName; // Disable the verification for now /*String cloudIdInRemote = cloudInstanceInformation
