You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "lyl2008dsg (via GitHub)" <gi...@apache.org> on 2024/08/03 10:53:21 UTC
[PR] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
lyl2008dsg opened a new pull request, #6728:
URL: https://github.com/apache/incubator-seata/pull/6728
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
### Ⅰ. Describe what this PR did
This pull request introduces support for serialization and deserialization of the dm.jdbc.driver.DmdbTimestamp class. The changes ensure that environments lacking the DM JDBC driver do not encounter errors or unnecessary logging.
Changes Made
1. Conditional Registration of Serializers and Deserializers:
* Added logic to register serializers and deserializers for dm.jdbc.driver.DmdbTimestamp only if the class is present in the classpath.
* This avoids issues in environments where the DM JDBC driver is not available.
2. Error Handling:
* No error logs are recorded if the dm.jdbc.driver.DmdbTimestamp class is not found.
* This is to prevent confusion for users who do not have the DM JDBC driver installed.
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
fix https://github.com/apache/incubator-seata/issues/6701
### Ⅲ. 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] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
Posted by "lyl2008dsg (via GitHub)" <gi...@apache.org>.
lyl2008dsg commented on code in PR #6728:
URL: https://github.com/apache/incubator-seata/pull/6728#discussion_r1702803676
##########
rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/parser/JacksonUndoLogParserTest.java:
##########
@@ -99,6 +106,48 @@ public void encode() throws NoSuchFieldException, IllegalAccessException, IOExce
bytes = mapper.writeValueAsBytes(field);
sameField = mapper.readValue(bytes, Field.class);
Assertions.assertTrue(DataCompareUtils.isFieldEquals(field, sameField).getResult());
+
+ }
+
+ @Test
+ public void testSerializeAndDeserializeDmdbTimestamp() throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IOException {
+ Assumptions.assumeTrue(checkClassExists("dm.jdbc.driver.DmdbTimestamp"), "DmdbTimestamp class not found, skipping tests.");
Review Comment:
done
--
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] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #6728:
URL: https://github.com/apache/incubator-seata/pull/6728
--
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] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
Posted by "lyl2008dsg (via GitHub)" <gi...@apache.org>.
lyl2008dsg commented on PR #6728:
URL: https://github.com/apache/incubator-seata/pull/6728#issuecomment-2266741047
> 我认为你应该需要在rm-datasource中引入以下依赖 I think you should need to introduce the following dependencies in rm-datasource
>
> ```
> <dependency>
> <groupId>com.dameng</groupId>
> <artifactId>DmJdbcDriver18</artifactId>
> <scope>test</scope>
> </dependency>
> ```
done.
Yes, I think so too. It can improve unit test coverage.
--
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] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6728:
URL: https://github.com/apache/incubator-seata/pull/6728#discussion_r1702803373
##########
rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/parser/JacksonUndoLogParserTest.java:
##########
@@ -99,6 +106,48 @@ public void encode() throws NoSuchFieldException, IllegalAccessException, IOExce
bytes = mapper.writeValueAsBytes(field);
sameField = mapper.readValue(bytes, Field.class);
Assertions.assertTrue(DataCompareUtils.isFieldEquals(field, sameField).getResult());
+
+ }
+
+ @Test
+ public void testSerializeAndDeserializeDmdbTimestamp() throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IOException {
+ Assumptions.assumeTrue(checkClassExists("dm.jdbc.driver.DmdbTimestamp"), "DmdbTimestamp class not found, skipping tests.");
Review Comment:
```suggestion
```
--
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] bugfix: Support serialization for dm.jdbc.driver.DmdbTimestamp (#6701) [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #6728:
URL: https://github.com/apache/incubator-seata/pull/6728#issuecomment-2266745495
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `76.36364%` with `13 lines` in your changes missing coverage. Please review.
> Project coverage is 50.78%. Comparing base [(`d0f8c6f`)](https://app.codecov.io/gh/apache/incubator-seata/commit/d0f8c6f394b85beda77daa63c232ca4412e0a8f7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`a424d13`)](https://app.codecov.io/gh/apache/incubator-seata/commit/a424d13ab9ed9dd1252cd4cc025e8f38019109d7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
| [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...m/datasource/undo/parser/JacksonUndoLogParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fundo%2Fparser%2FJacksonUndoLogParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS91bmRvL3BhcnNlci9KYWNrc29uVW5kb0xvZ1BhcnNlci5qYXZh) | 76.36% | [12 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?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 #6728 +/- ##
============================================
+ Coverage 50.24% 50.78% +0.53%
- Complexity 5854 5908 +54
============================================
Files 1058 1058
Lines 36707 36762 +55
Branches 4364 4370 +6
============================================
+ Hits 18442 18668 +226
+ Misses 16431 16201 -230
- Partials 1834 1893 +59
```
| [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...m/datasource/undo/parser/JacksonUndoLogParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6728?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fundo%2Fparser%2FJacksonUndoLogParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS91bmRvL3BhcnNlci9KYWNrc29uVW5kb0xvZ1BhcnNlci5qYXZh) | `71.06% <76.36%> (+2.05%)` | :arrow_up: |
... and [41 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6728/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