Skip to content

Add construction of domain in Helix participant logic#876

Merged
junkaixue merged 3 commits intoapache:helix-cloudfrom
zhangmeng916:helix-domain
Mar 10, 2020
Merged

Add construction of domain in Helix participant logic#876
junkaixue merged 3 commits intoapache:helix-cloudfrom
zhangmeng916:helix-domain

Conversation

@zhangmeng916
Copy link
Contributor

@zhangmeng916 zhangmeng916 commented Mar 6, 2020

Issues

  • [X ] My PR addresses the following Helix issues and references them in the PR description:

(#875 )

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Helix has a topology defined in cluster config, e.g., "TOPOLOGY": "/zone/host", and it will be used to construct the "domain" field in participant config, e.g. ""DOMAIN": "zone=0,host=host1". In Azure, Helix will provide a default topology value for the cluster, and the format is /faultDomain/hostName. In this pR, we add the construction function in Participant manager to construct the domain field based on this topology.

Tests

  • The following is the result of the "mvn test" command on the appropriate module:

Commits

  • [X ] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • [X ] My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

}

private String ConstructDomainField(String faultDomain) {
Boolean topologyEnabled = _configAccessor.getClusterConfig(_clusterName).isTopologyAwareEnabled();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? If we know the environment is Azure, then we can directly get the topology from AzureConstants instead of reading from ClusterConfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this logic, we do not parse the cloud provider directly. That logic is in the processor. I was thinking that if we read from clusterConfig, it'll be generic, and independent of cloud provider. thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. We'll move the logic to cloud instance information processor and not to depend on cluster config.

@zhangmeng916 zhangmeng916 changed the title Helix domain Add construction of domain in Helix participant logic Mar 6, 2020
Copy link

@alirezazamani alirezazamani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangmeng916
Copy link
Contributor Author

This PR is ready to merge, approved by @dasahcc
Final commit message:
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.

@junkaixue junkaixue merged commit 89c60fe into apache:helix-cloud Mar 10, 2020
zhangmeng916 added a commit to zhangmeng916/helix that referenced this pull request Apr 6, 2020
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.
junkaixue pushed a commit that referenced this pull request Apr 7, 2020
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.
junkaixue pushed a commit that referenced this pull request Apr 14, 2020
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.
huizhilu pushed a commit to huizhilu/helix that referenced this pull request Aug 16, 2020
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.
zhangmeng916 added a commit to zhangmeng916/helix that referenced this pull request Aug 25, 2020
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.
zhangmeng916 added a commit to zhangmeng916/helix that referenced this pull request Nov 12, 2020
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.
zhangmeng916 added a commit to zhangmeng916/helix that referenced this pull request Nov 18, 2020
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.
jiajunwang pushed a commit that referenced this pull request Nov 18, 2020
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.
jiajunwang pushed a commit that referenced this pull request Nov 19, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants