GitHub user ijuma opened a pull request:
https://github.com/apache/kafka/pull/74
KAFKA-1595; Remove deprecated and slower scala JSON parser
A thin wrapper over Jackson's Tree Model API is used as the replacement.
This wrapper
increases safety while providing a simple, but powerful API through the
usage of the
`DecodeJson` type class. Even though this has a maintenance cost, it makes
the API
much more convenient from Scala. A number of tests were added to verify the
behaviour of this wrapper.
The Scala module for Jackson doesn't provide any help for our current
usage, so we don't
depend on it.
An attempt has been made to maintain the existing behaviour regarding when
exceptions
are thrown. There are a number of cases where `JsonMappingException` will
be thrown
instead of `ClassCastException`, however. It is expected that users would
not try to catch
`ClassCastException`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ijuma/kafka
kafka-1595-remove-deprecated-json-parser-jackson
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/74.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #74
----
commit 61f20cc04a89200c28eb77137671235516c81847
Author: Ismael Juma <[email protected]>
Date: 2015-04-20T20:53:54Z
Introduce `testJsonParse`
Simple test that shows existing behaviour.
commit 4ca0f1111eb37e8be2d388b60efacc19bc6788b6
Author: Ismael Juma <[email protected]>
Date: 2015-04-21T00:15:02Z
KAFKA-1595; Remove deprecated and slower scala JSON parser from
kafka.consumer.TopicCount
A thin wrapper over Jackson's Tree Model API is used as the replacement.
This wrapper
increases safety while providing a simple, but powerful API through the
usage of the
`DecodeJson` type class. Even though this has a maintenance cost, it makes
the API
much more convenient from Scala. A number of tests were added to verify the
behaviour of this wrapper.
The Scala module for Jackson doesn't provide any help for our current
usage, so we don't
depend on it.
An attempt has been made to maintain the existing behaviour regarding when
exceptions
are thrown. There are a number of cases where `JsonMappingException` will
be thrown
instead of `ClassCastException`, however. It is expected that users would
not try to catch
`ClassCastException`.
commit f401990f13bddbd3d97e05756cf2f1abf367677e
Author: Ismael Juma <[email protected]>
Date: 2015-04-21T00:23:39Z
Minor clean-ups in `Json.encode`
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---