Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes to the Java driver #7

Merged
merged 40 commits into from
Mar 4, 2020
Merged

Conversation

NotJustAnna
Copy link
Member

@NotJustAnna NotJustAnna commented Feb 10, 2020

This PR tracks experimental changes for the official rethinkdb-java driver.

Implemented changes

  • Updated compile and test dependencies
  • Replaced json-simple with Jackson
    • JSON manipulation is done with plain Java collections
  • Replaced java.util.Optional usage with @Nullable annotations
  • Fixes Util.toReqlAst() wrongly resetting the remaining depth.
  • ReqlAst improvements
    • Support for Jackson's TypeReference<T> on ReqlAst.run()
    • ReqlAst.runAsync(): Asynchronous result
    • ReqlAst.toString() pretty-prints the AST
  • Added generics to MapObject
  • Connection rewrite
    • The connection and the response pump are now wrapped in an interface and custom factories can be set in the builder, with the default factories implemented at DefaultConnectionFactory
    • The handshake is entirely handled by the HandshakeProtocol class instead of the connection socket.
    • Connection.noreplyWaitAsync(): Asynchronous noreplyWait
    • Added Connection.server() and async variance (Implements Add server_info() command #14)
    • Added support for db-urls (Implements python drivers support db-url schemas rethinkdb#4101)
  • Cursor was deleted and replaced with Result
    • ReqlAsr.run() always returns Result<T>, which covers all result types and implements Iterator<T> and Iterable<T>
    • toList(), collect(), stream(), parallelStream() methods
    • Fetch modes for partial sequences
    • If enabled, unwraps atom responses which are lists (Result<List<T>> is unwrapped to Result<T>)
    • Exposed Response's Profile into the builder
    • Pending, leaking Results can be closed from the Connection
  • Added r.pathspec(...) (Implements Implement r.pathspec(...) #16)
  • Renamed methods with weird names and inlined factory methods and Response Builder
  • Util.toReqlAst() now properly serializes primitive arrays and other Collections as well.
  • Documentation for most public methods
  • A lot of small performance improvements.

Partially implemented

Notes

  1. Code which use Connection, Cursor and the old dynamic return type of .run breaks, but those classes got full documentation of the new usage.

  2. All tests doesn't compile. Root tests may need manual rewrite while Generated tests need Python scripts need rewrite to generate new valid tests. Tests now compile by patching TestingCommon to generate expected behaviour.

@NotJustAnna
Copy link
Member Author

NotJustAnna commented Feb 12, 2020

Enum deserialization should be implemented once #9 is merged. Merged and implemented.

Adrian Todt added 2 commits February 14, 2020 19:14
…com/rethinkdb/rethinkdb-java into develop/experimental

� Conflicts:
�	Makefile
�	build.gradle
�	src/main/java/com/rethinkdb/RethinkDB.java
�	src/main/java/com/rethinkdb/net/Util.java
@NotJustAnna
Copy link
Member Author

NotJustAnna commented Feb 15, 2020

If #12 gets merged, Cursors will be removed in favour of reactive flows.

UPDATE: Since 037429c, it now has a reactive Connection implementation, with detached Socket and Response Pump, if you want to write your custom implementation of the socket or integrate the response pump into your main service, say, Spring or Vert.x

Reactive streams was dropped due to their non-null behaviour.

@NotJustAnna NotJustAnna linked an issue Feb 15, 2020 that may be closed by this pull request
@NotJustAnna NotJustAnna linked an issue Feb 15, 2020 that may be closed by this pull request
@NotJustAnna
Copy link
Member Author

rethinkdb/rethinkdb#4101 implemented on commits d214109 and e56f344.

@NotJustAnna NotJustAnna linked an issue Feb 17, 2020 that may be closed by this pull request
@NotJustAnna NotJustAnna marked this pull request as ready for review February 20, 2020 14:25
@NotJustAnna NotJustAnna changed the title Experimental changes to the driver Breaking changes to the Java driver Feb 20, 2020
@NotJustAnna NotJustAnna linked an issue Feb 20, 2020 that may be closed by this pull request
@gabor-boros gabor-boros merged commit c312908 into master Mar 4, 2020
@gabor-boros gabor-boros deleted the develop/experimental branch March 4, 2020 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants