You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/11/04 04:25:11 UTC
[GitHub] [pulsar] coderzc opened a new pull request, #18334: [fix][client] Support LocalDateTime Conversion
coderzc opened a new pull request, #18334:
URL: https://github.com/apache/pulsar/pull/18334
Fixes #18329
### Motivation
Due to missing LocalDateTime ConVersion, the decode `java.time.LocalDateTime` failure.
### Modifications
Add `LocalTimestampMicrosConversion` and `LocalTimestampMillisConversion` for AvroSchema.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
testLocalDateTime
### Does this pull request potentially affect one of the following parts:
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [x] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository:
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014626644
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -128,8 +130,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
} catch (ClassNotFoundException e) {
// Skip if have not provide joda-time dependency.
}
- reflectData.addLogicalTypeConversion(new TimeConversions.TimestampMicrosConversion());
Review Comment:
Should move it 134 lines, otherwise we will not be able to parse `timestamp-micros` type when `jsr310ConversionEnabled == true`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari merged pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
lhotari merged PR #18334:
URL: https://github.com/apache/pulsar/pull/18334
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014626644
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -128,8 +130,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
} catch (ClassNotFoundException e) {
// Skip if have not provide joda-time dependency.
}
- reflectData.addLogicalTypeConversion(new TimeConversions.TimestampMicrosConversion());
Review Comment:
Should move it 134 lines, otherwise we will not be able to parse `timestamp - micros` type when `jsr310ConversionEnabled == true`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#issuecomment-1305285006
/pulsarbot run-failure-checks
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014624560
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -118,6 +118,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
reflectData.addLogicalTypeConversion(new TimeConversions.DateConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMillisConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMillisConversion());
Review Comment:
Because there is no Joda time conversion of `local-timestamp-millis` and `local-timestamp-micros`, I think don't need to judge `jsr310ConversionEnabled`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codecov-commenter commented on pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#issuecomment-1303193169
# [Codecov](https://codecov.io/gh/apache/pulsar/pull/18334?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#18334](https://codecov.io/gh/apache/pulsar/pull/18334?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5f845ec) into [master](https://codecov.io/gh/apache/pulsar/commit/fe1963988fc6883f52826069a781b91aba0405bf?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fe19639) will **increase** coverage by `9.65%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/pulsar/pull/18334?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #18334 +/- ##
============================================
+ Coverage 39.98% 49.63% +9.65%
+ Complexity 8590 7065 -1525
============================================
Files 685 400 -285
Lines 67335 43683 -23652
Branches 7216 4483 -2733
============================================
- Hits 26924 21684 -5240
+ Misses 37392 19571 -17821
+ Partials 3019 2428 -591
```
| Flag | Coverage Δ | |
|---|---|---|
| unittests | `49.63% <ø> (+9.65%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/18334?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...g/apache/pulsar/client/impl/RawBatchConverter.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1Jhd0JhdGNoQ29udmVydGVyLmphdmE=) | `3.12% <0.00%> (-89.07%)` | :arrow_down: |
| [.../transaction/buffer/metadata/AbortTxnMetadata.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci90cmFuc2FjdGlvbi9idWZmZXIvbWV0YWRhdGEvQWJvcnRUeG5NZXRhZGF0YS5qYXZh) | `28.57% <0.00%> (-57.15%)` | :arrow_down: |
| [...lsar/broker/service/StickyKeyConsumerSelector.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1N0aWNreUtleUNvbnN1bWVyU2VsZWN0b3IuamF2YQ==) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
| [...apache/pulsar/broker/service/TopicListService.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1RvcGljTGlzdFNlcnZpY2UuamF2YQ==) | `10.65% <0.00%> (-44.27%)` | :arrow_down: |
| [...ion/buffer/metadata/TransactionBufferSnapshot.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci90cmFuc2FjdGlvbi9idWZmZXIvbWV0YWRhdGEvVHJhbnNhY3Rpb25CdWZmZXJTbmFwc2hvdC5qYXZh) | `42.85% <0.00%> (-42.86%)` | :arrow_down: |
| [...e/HashRangeExclusiveStickyKeyConsumerSelector.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0hhc2hSYW5nZUV4Y2x1c2l2ZVN0aWNreUtleUNvbnN1bWVyU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (-36.93%)` | :arrow_down: |
| [...saction/timeout/TransactionTimeoutTrackerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci90cmFuc2FjdGlvbi90aW1lb3V0L1RyYW5zYWN0aW9uVGltZW91dFRyYWNrZXJJbXBsLmphdmE=) | `50.87% <0.00%> (-36.85%)` | :arrow_down: |
| [...lsar/broker/loadbalance/impl/ThresholdShedder.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9pbXBsL1RocmVzaG9sZFNoZWRkZXIuamF2YQ==) | `3.26% <0.00%> (-30.07%)` | :arrow_down: |
| [...er/impl/SingleSnapshotAbortedTxnProcessorImpl.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci90cmFuc2FjdGlvbi9idWZmZXIvaW1wbC9TaW5nbGVTbmFwc2hvdEFib3J0ZWRUeG5Qcm9jZXNzb3JJbXBsLmphdmE=) | `51.19% <0.00%> (-29.77%)` | :arrow_down: |
| [...ulsar/broker/service/PulsarChannelInitializer.java](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1B1bHNhckNoYW5uZWxJbml0aWFsaXplci5qYXZh) | `68.42% <0.00%> (-21.06%)` | :arrow_down: |
| ... and [347 more](https://codecov.io/gh/apache/pulsar/pull/18334/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014624560
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -118,6 +118,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
reflectData.addLogicalTypeConversion(new TimeConversions.DateConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMillisConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMillisConversion());
Review Comment:
Because there is no Joda time conversion of `local-timestamp-millis` and` local-timestamp-micros'.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
lhotari commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1013801001
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -118,6 +118,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
reflectData.addLogicalTypeConversion(new TimeConversions.DateConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMillisConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMillisConversion());
Review Comment:
why weren't these put under the if statement `if (jsr310ConversionEnabled) {` ?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#issuecomment-1306606920
@lhotari please take a look again.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014626644
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -128,8 +130,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
} catch (ClassNotFoundException e) {
// Skip if have not provide joda-time dependency.
}
- reflectData.addLogicalTypeConversion(new TimeConversions.TimestampMicrosConversion());
Review Comment:
Should be able to move to line 134, otherwise we will not be able to parse `timestamp-micros` type when `jsr310ConversionEnabled == true`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on a diff in pull request #18334: [fix][client] Support LocalDateTime Conversion
Posted by GitBox <gi...@apache.org>.
coderzc commented on code in PR #18334:
URL: https://github.com/apache/pulsar/pull/18334#discussion_r1014624560
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AvroSchema.java:
##########
@@ -118,6 +118,8 @@ public static void addLogicalTypeConversions(ReflectData reflectData, boolean js
reflectData.addLogicalTypeConversion(new TimeConversions.DateConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMillisConversion());
reflectData.addLogicalTypeConversion(new TimeConversions.TimeMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMicrosConversion());
+ reflectData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMillisConversion());
Review Comment:
Because there is no Joda time conversion of `local-timestamp-millis` and `local-timestamp-micros`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org