You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "xingfudeshi (via GitHub)" <gi...@apache.org> on 2024/01/30 06:16:36 UTC
[PR] optimize:compatible with lower versions of SPI [incubator-seata]
xingfudeshi opened a new pull request, #6315:
URL: https://github.com/apache/incubator-seata/pull/6315
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
### Ⅰ. Describe what this PR did
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
fixes #6307
### Ⅲ. Why don't you add test cases (unit test/integration test)?
### Ⅳ. Describe how to verify it
### Ⅴ. Special notes for reviews
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi commented on PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#issuecomment-1948372428
> I suggest changing the SPI loading priority here.
>
> 1. Load the Apache Seata SPI first. Because Apache Seata is the final state of the future.
> 2. If the Apache seata SPI cannot be found, output a warn log and try to load the io.seata SPI.
> 3. If the io.seata SPI also fails to be loaded, handle the exception according to the logic in the original SPI.
Ok
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#issuecomment-1916160174
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/6315?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`74785d2`)](https://app.codecov.io/gh/apache/incubator-seata/commit/74785d2214438b155d8a5dd69dd5c05d329ff232?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 51.95% compared to head [(`ef9c2b6`)](https://app.codecov.io/gh/apache/incubator-seata/pull/6315?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 52.30%.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/incubator-seata/pull/6315?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 2.x #6315 +/- ##
============================================
+ Coverage 51.95% 52.30% +0.34%
- Complexity 5171 5172 +1
============================================
Files 918 917 -1
Lines 32039 31828 -211
Branches 3866 3829 -37
============================================
+ Hits 16647 16648 +1
+ Misses 13768 13556 -212
Partials 1624 1624
```
[see 5 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6315/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi commented on PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#issuecomment-1948457817
Done. @slievrly
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477879201
##########
compatible/src/main/java/io/seata/core/compressor/Compressor.java:
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.seata.core.compressor;
+
+/**
+ * The type Compressor
+ *
+ */
+@Deprecated
Review Comment:
Compatible modules do not need @Deprecated, all are deprecated.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477872003
##########
common/src/main/java/org/apache/seata/common/loader/EnhancedServiceLoader.java:
##########
@@ -43,13 +43,25 @@
*
*/
public class EnhancedServiceLoader {
+ private static final String APACHE_SEATA_PACKAGE_NAME = "org.apache.seata";
+ private static final String IO_SEATA_PACKAGE_NAME = "io.seata";
/**
* Class->InnerEnhancedServiceLoader map
*/
private static final ConcurrentMap<Class<?>, InnerEnhancedServiceLoader<?>> SERVICE_LOADERS =
new ConcurrentHashMap<>();
+ private static <S> Class<S> getCompatibleService(Class<S> originService) {
+ String apacheSeataName = originService.getName();
+ String ioSeataName = apacheSeataName.replace(APACHE_SEATA_PACKAGE_NAME, IO_SEATA_PACKAGE_NAME);
Review Comment:
Explicitly identify the Apache Seata SPI using sartwith or other methods.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477875738
##########
common/src/main/java/org/apache/seata/common/loader/EnhancedServiceLoader.java:
##########
@@ -43,13 +43,25 @@
*
*/
public class EnhancedServiceLoader {
+ private static final String APACHE_SEATA_PACKAGE_NAME = "org.apache.seata";
+ private static final String IO_SEATA_PACKAGE_NAME = "io.seata";
/**
* Class->InnerEnhancedServiceLoader map
*/
private static final ConcurrentMap<Class<?>, InnerEnhancedServiceLoader<?>> SERVICE_LOADERS =
new ConcurrentHashMap<>();
+ private static <S> Class<S> getCompatibleService(Class<S> originService) {
+ String apacheSeataName = originService.getName();
+ String ioSeataName = apacheSeataName.replace(APACHE_SEATA_PACKAGE_NAME, IO_SEATA_PACKAGE_NAME);
Review Comment:
If both exist, what is the priority?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477889859
##########
compatible/pom.xml:
##########
@@ -20,33 +20,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <groupId>io.seata</groupId>
- <version>2.1.0-SNAPSHOT</version>
+ <parent>
+ <groupId>org.apache.seata</groupId>
+ <artifactId>seata-parent</artifactId>
+ <version>${revision}</version>
Review Comment:
Ok
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477881157
##########
compatible/src/main/java/io/seata/core/compressor/Compressor.java:
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.seata.core.compressor;
+
+/**
+ * The type Compressor
+ *
+ */
+@Deprecated
Review Comment:
Ok
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: compatible with lower versions of SPI [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly merged PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1479143407
##########
common/src/main/java/org/apache/seata/common/loader/EnhancedServiceLoader.java:
##########
@@ -43,13 +43,25 @@
*
*/
public class EnhancedServiceLoader {
+ private static final String APACHE_SEATA_PACKAGE_NAME = "org.apache.seata";
+ private static final String IO_SEATA_PACKAGE_NAME = "io.seata";
/**
* Class->InnerEnhancedServiceLoader map
*/
private static final ConcurrentMap<Class<?>, InnerEnhancedServiceLoader<?>> SERVICE_LOADERS =
new ConcurrentHashMap<>();
+ private static <S> Class<S> getCompatibleService(Class<S> originService) {
+ String apacheSeataName = originService.getName();
+ String ioSeataName = apacheSeataName.replace(APACHE_SEATA_PACKAGE_NAME, IO_SEATA_PACKAGE_NAME);
Review Comment:
If both package names exist, the current one is based on io. seata, and the package for org. apache. seata will only be loaded if it cannot be loaded. In addition, I believe that there should not be two types of package names at the same time, as compatibility itself is to provide users with a transitional solution, not a persistent compatibility solution. If users need to customize a new SPI implementation, they should switch to the package name of Apache seata as soon as possible.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize:compatible with lower versions of SPI [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #6315:
URL: https://github.com/apache/incubator-seata/pull/6315#discussion_r1477868903
##########
compatible/pom.xml:
##########
@@ -20,33 +20,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <groupId>io.seata</groupId>
- <version>2.1.0-SNAPSHOT</version>
+ <parent>
+ <groupId>org.apache.seata</groupId>
+ <artifactId>seata-parent</artifactId>
+ <version>${revision}</version>
Review Comment:
This place can't be changed to any other package name.The original used by data is required to be retained.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org