Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sofa registry #793

Merged
merged 22 commits into from
Apr 23, 2019
Merged

Support sofa registry #793

merged 22 commits into from
Apr 23, 2019

Conversation

leizhiyuan
Copy link
Contributor

Ⅰ. Describe what this PR did

Support SOFARegistry as a kind of seata-discover, not seata-config

Ⅱ. Does this pull request fix one issue?

fixes #792

Ⅲ. Why don't you add test cases (unit test/integration test)?

I add a test case to verify it

Ⅳ. Describe how to verify it

the test case will success

Ⅴ. Special notes for reviews

I have read the implements of the other discover extensions and study from them, but there may have some errors in my code. please review it, thanks.

@codecov-io
Copy link

codecov-io commented Apr 15, 2019

Codecov Report

Merging #793 into develop will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #793      +/-   ##
============================================
+ Coverage      38.28%   38.3%   +0.02%     
  Complexity      1013    1013              
============================================
  Files            220     220              
  Lines           8504    8507       +3     
  Branches        1023    1024       +1     
============================================
+ Hits            3256    3259       +3     
- Misses          4861    4863       +2     
+ Partials         387     385       -2
Impacted Files Coverage Δ Complexity Δ
...java/io/seata/discovery/registry/RegistryType.java 39.13% <50%> (-0.87%) 2 <0> (ø)
...eata/server/store/FileTransactionStoreManager.java 54% <0%> (+1%) 15% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b31b824...00c19dc. Read the comment docs.

@xingfudeshi xingfudeshi self-requested a review April 16, 2019 01:06
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

thanks.There are other things you may have forgotten.
1.add Sofa to the RegistryType
2.add fescar-discovery-sofa in the pom.xml of fescar-discovery-all.

@leizhiyuan
Copy link
Contributor Author

Fix cr

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@zhangthen zhangthen added this to the 0.6.0 milestone Apr 16, 2019
@zhangthen
Copy link
Contributor

Well done, we will merge it between 0.5.0 and 0.6.0.

Copy link
Contributor

@zhangthen zhangthen left a comment

Choose a reason for hiding this comment

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

+1

validAddress(address);
String clusterName = registryProps.getProperty(PRO_CLUSTER_KEY);
PublisherRegistration publisherRegistration;
publisherRegistration = new PublisherRegistration(clusterName);
Copy link
Member

Choose a reason for hiding this comment

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

why split in two lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


private static Properties getNamingProperties() {
Properties properties = new Properties();
if (null != System.getProperty(PRO_SERVER_ADDR_KEY)) {
Copy link
Member

Choose a reason for hiding this comment

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

I think Missing prefix like -Dregistry.serverAddr but not -DserverAddr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

public void close() throws Exception {
}

private void validAddress(InetSocketAddress address) {
Copy link
Member

Choose a reason for hiding this comment

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

use NetUtil#validAddress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

newAddressList.addAll(tranformData);
CLUSTER_ADDRESS_MAP.put(clusterName, newAddressList);
}
respondRegistries.countDown();
Copy link
Member

Choose a reason for hiding this comment

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

I think respondRegistries should be local variable,how to support multi-cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,changed

<name>seata-discovery-sofa ${project.version}</name>

<properties>
<sofa.registry.version>5.2.0</sofa.registry.version>
Copy link
Member

Choose a reason for hiding this comment

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

why not declare in root pom?

region = "DEFAULT_ZONE"
datacenter = "DefaultDataCenter"
cluster = "default"
group = "SEATA"
Copy link
Member

Choose a reason for hiding this comment

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

SEATA_GROUP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, It is a label for sofa registry server, it will store this service in group "SEATA",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, It is a label for sofa registry server, it will store this service in group "SEATA",

Ok, I will change it

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly merged commit a13de66 into apache:develop Apr 23, 2019
@leizhiyuan leizhiyuan deleted the support_sofa_registry branch April 23, 2019 09:55
nick-tan pushed a commit to nick-tan/seata that referenced this pull request Jul 12, 2019
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.

Support SOFARegistry as a kind of seata-discovery
5 participants