You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2020/04/14 02:20:59 UTC
[helix] 08/10: Add construction of domain in Helix participant
logic (#876)
This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch helix-cloud
in repository https://gitbox.apache.org/repos/asf/helix.git
commit 2f6faa9651ce7f6ce6cf1134e1d6d10eb8818ada
Author: zhangmeng916 <56...@users.noreply.github.com>
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 32e0575..7b75c7a 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