Comments (7)
You're right, currently there are no such serializers, only for joda DateTime and Interval. It shouldn't be hard to write serializers for LocalDate and LocalDateTime, pull requests are welcome :-) If you need help writing them just ask.
from kryo-serializers.
OK, "I'll try anything once" - despite having limited Java skills and almost zero GitHub skills.
Before me submitting a pull request, would you mind first taking a look at this: https://github.com/RenniePet/kryo-serializers/tree/additional-joda-time ?
It turned out to be more problematic than I expected. These two Joda-Time objects do have a millis fields burried inside them, but they are difficult to access (protected getters) and/or are not usable in the constructors.
I'm afraid there are no unit tests. I'm ashamed to admit that I've never written a unit test in my life. And even if I tried to fake it, I don't know how to run unit tests.
I've left your name and email address in the comments, partly because of the lack of unit tests. Would you prefer I inserted my own name?
Let me know what you think.
from kryo-serializers.
Sorry for responding that late, I'm just coming back from vacation.
Am 03.03.2015 15:55 schrieb "RenniePet" [email protected]:
OK, "I'll try anything once" - despite having limited Java skills and almost zero GitHub skills.
Before me submitting a pull request, would you mind first taking a look at this: https://github.com/RenniePet/kryo-serializers/tree/additional-joda-time ?
It turned out to be more problematic than I expected. These two Joda-time objects do have a millis fields burried inside them, but they are difficult to access (protected getters) and/or are not usable in the constructors.
Fine, I see the following potential improvements:
- use setInt(..., true) to save some bytes
- serialize localDateTime.getMillisOfDay instead of
hour/minute/second/millis to save bytes and calculate
hour/minute/second/millis on deserialization.
I'm afraid there are no unit tests. I'm ashamed to admit that I've never written a unit test in my life. And even if I tried to fake it, I don't know how to run unit tests.
You could build upon one of the existing tests.
To run all tests do 'mvn test', to run a single test run 'mvn -Dtest=SomeTestClass test' (see also
http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html).
If you're using an IDE you can also install a testng plugin (most IDEs only support only junit out of the box) and run the test from your IDE.
I've left your name and email address in the comments, partly because of the lack of unit tests. Would you prefer I inserted my own name?
Yes, you should receive the credits for your work. :-)
Cheers,
Martin
Let me know what you think.
—
Reply to this email directly or view it on GitHub.
from kryo-serializers.
OK, I think I've made the improvements you requested. I'll try to create unit tests later today, and then submit a pull request.
from kryo-serializers.
Cool!
Am 12.03.2015 07:37 schrieb "RenniePet" [email protected]:
OK, I think I've made the improvements you requested. I'll try to create
unit tests later today, and then submit a pull request.—
Reply to this email directly or view it on GitHub
#29 (comment)
.
from kryo-serializers.
A pull request has now been submitted. Hope you can use it.
One strange thing I've experienced is that the two "copy" unit test methods do not invoke my serialization/deserialization code at all! Kryo is apparently able to (and prefers to) copy these objects without serializing and deserializing them, at least as objects. Maybe it "serializes" and "deserializes" the individual fields? Anyway, these two copy unit test methods are somewhat misleading, since they aren't actually testing what they claim to be testing. Maybe they should be removed? (I'm running Java on an old Android device, if that has anything to do with it.)
from kryo-serializers.
This is merged/released already.
from kryo-serializers.
Related Issues (20)
- Compatibility with JDK 10 HOT 1
- serializer for org.hibernate.proxy.HibernateProxy HOT 3
- Compatibility with open JDK 11 HOT 1
- Collections.SetFromMap gives null pointer exception in deserialization. HOT 2
- For Kryo-serializers 0.45, I see there is compatibility issue for with java 11.
- Unable to use SubListSerializers with JDK9 HOT 2
- Fail to deserialize lists created from guava's immutableCollection.asList()
- pulls in kryo v5 even though its supposed to be 4 HOT 1
- ImmutableMultimapSerializer does not properly handle EmptyImutableSetMultimap
- Another release depending on kryo-shaded 4.0.2 HOT 3
- 0.45.1 release? HOT 6
- Can't use version 0.45 with JDK11 if i have generics in my code
- Kryo exception for com.google.common.collect.RegularImmutableBiMap
- Kryo v5 support HOT 10
- Support for Ion data type HOT 1
- Compatibility with JDK 17 HOT 6
- Does kryo have a way to support bean adding and deleting fields
- Add support for missing Guava immutable types
- Is this repo still mantained? HOT 9
- Could not access source collection field in java.util.Collections$UnmodifiableCollection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kryo-serializers.