-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add support for MySQL pipelining execution #1168
Add support for MySQL pipelining execution #1168
Conversation
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
…execution command being sent Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
This feature is now ready for reviewing |
vertx-mysql-client/src/main/java/io/vertx/mysqlclient/MySQLBatchException.java
Outdated
Show resolved
Hide resolved
vertx-mysql-client/src/main/java/io/vertx/mysqlclient/impl/codec/MySQLDecoder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, a couple of minor changes to do and we are good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @BillyYccc ! I just have a question about usage
* {@code MySQLBatchException} is thrown if an error occurs during executions when using {@link io.vertx.sqlclient.PreparedQuery#executeBatch(List)}. | ||
* The client will try to execute with all the params no matter if one iteration of the executions fails, the iteration count is calculated from zero. | ||
*/ | ||
public class MySQLBatchException extends RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think about a way to combine this type with MySQLException
in a hierarchy? It can be convenient for users to identity where the issue comes from when the exception bubbles up to upper layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using a mapping like Map<Integer, MySQLException>
to represent the errors in a batching process? I think MySQL needs this because it emulates batching by sending multiple requests and might receive multiple error responses which does not behave like Postgres client batching(one request & one response)
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
I also need to label this as breaking change because it changes the way how the batching works. |
@BillyYccc can you update the breaking change wiki page too https://github.com/vert-x3/wiki/wiki/4.3.0-Deprecations-and-breaking-changes |
Signed-off-by: Billy Yuan <[email protected]>
done |
Another small change, I think |
ping @BillyYccc |
vertx-mysql-client/src/test/java/io/vertx/mysqlclient/MySQLPipeliningTest.java
Outdated
Show resolved
Hide resolved
…client Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
I think it's ready for a final review now |
@@ -65,6 +65,7 @@ public static MySQLConnectOptions fromUri(String connectionUri) throws IllegalAr | |||
public static final Map<String, String> DEFAULT_CONNECTION_ATTRIBUTES; | |||
public static final SslMode DEFAULT_SSL_MODE = SslMode.DISABLED; | |||
public static final String DEFAULT_CHARACTER_ENCODING = "UTF-8"; | |||
public static final int DEFAULT_PIPELINING_LIMIT = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use the same value than PgConnectOptions which is 256 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this is for backward compatibility ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I'm trying to avoid introducing breaking changes.
vertx-mysql-client/src/main/java/io/vertx/mysqlclient/impl/MySQLPoolOptions.java
Outdated
Show resolved
Hide resolved
vertx-mysql-client/src/main/java/io/vertx/mysqlclient/impl/codec/MySQLEncoder.java
Outdated
Show resolved
Hide resolved
...ysql-client/src/main/java/io/vertx/mysqlclient/impl/codec/ExtendedQueryCommandBaseCodec.java
Outdated
Show resolved
Hide resolved
...ysql-client/src/main/java/io/vertx/mysqlclient/impl/codec/ExtendedQueryCommandBaseCodec.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor change and a question about pipelining limit default = 1 (assuming it's for being conservative and backward compatible).
@BillyYccc if you can handle the minor changes soon, it can be merged and be part of Vert.x 4.3 release |
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
Signed-off-by: Billy Yuan <[email protected]>
all comments should be addressed now |
thanks for your great contribution @BillyYccc ! |
thanks for the reviewing 😃 |
Motivation:
fixes #861, fixes #873
Changes:
Conformance:
You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines