[JAVA-4476] Make Java client model classes implement Serializable interface Created: 05/Feb/22 Updated: 25/Aug/23 Resolved: 14/Feb/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | Nir Tsruya | Assignee: | Jeffrey Yemin |
| Resolution: | Declined | Votes: | 0 |
| Labels: | external-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
As a Java developer, I would like to make the Java client model classes implement the Serializable interface. Motivation I am working on a mongodb connector for the [Apache Flink project|https://flink.apache.org/] Internally, Flink is using java serialization to save the records it is working on in a state which in turn used to recover from failures etc, as well as for passing records between different tasks in the pipeline. AC
|
| Comments |
| Comment by Jeffrey Yemin [ 14/Feb/22 ] |
|
No problem. Please let us know what you decide to do, and if there's anything else you need from the driver to enable this integration. |
| Comment by Nir Tsruya [ 14/Feb/22 ] |
|
Thank you for the investigation and quick response. It makes sense |
| Comment by Jeffrey Yemin [ 07/Feb/22 ] |
|
nirtsr@gmail.com. I see a number of problems with adding this to the driver:
I think any approach that is taken by Flink has to involve first converting all instances of org.bson.conversions.Bson and of T into a BsonDocument, which does extend Serializable. But do to that requires knowledge of which CodecRegistry is being using by the application, which WriteModel does not have in isolation (the driver relies on whatever CodecRegistry is configured in the MongoCollection to actually serialize write models). |