Skip to content

Commit

Permalink
[release-21.0] java package updates for grpc and protobuf and release…
Browse files Browse the repository at this point in the history
… plugins (vitessio#17100) (vitessio#17105)

Signed-off-by: Harshit Gangal <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
  • Loading branch information
vitess-bot[bot] authored Oct 29, 2024
1 parent f70e24f commit aa18a36
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public Cursor streamExecute(Context ctx,
return vtGateConnection.streamExecute(ctx, query, bindVars, vtSession);
}

/**
* @inheritDoc
*/
@Override
public void close() throws IOException {
vtGateConnection.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ StreamIterator<VStreamResponse> getVStream(Context ctx, VStreamRequest vstreamRe
return client.getVStream(ctx, request);
}

/**
* @inheritDoc
*/
@Override
public void close() throws IOException {
client.close();
Expand Down
2 changes: 1 addition & 1 deletion java/client/src/main/java/io/vitess/client/VTSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public Query.ExecuteOptions.TransactionIsolation getTransactionIsolation() {
/**
* Sets this session's transaction isolation level.
*
* @param Transaction Isolation Level of the Session
* @param isolation Isolation Level of the Session
*/
public void setTransactionIsolation(Query.ExecuteOptions.TransactionIsolation isolation) {
this.session = this.session.toBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
package io.vitess.client.grpc.tls;

import java.io.File;
import java.net.InetSocketAddress;

/**
* <p>A wrapper type holding TLS-related fields for the
* {@link io.vitess.client.RpcClientFactory#createTls(InetSocketAddress, TlsOptions)} method, so
* createTls(InetSocketAddress, TlsOptions) method, so
* that this method won't have an unwieldy number of direct parameters.</p>
*
* <p>This path uses a builder pattern style:</p>
Expand Down
4 changes: 4 additions & 0 deletions java/grpc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-inprocess</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

/**
* RetryingInterceptor is used for retrying certain classes of failed requests in the underlying
* gRPC connection. At this time it handles {@link MethodDescriptor.MethodType.UNARY} requests with
* status {@link Status.Code.UNAVAILABLE}, which is according to the spec meant to be a transient
* gRPC connection. At this time it handles unary requests with
* status Unavailable, which is according to the spec meant to be a transient
* error. This class can be configured with {@link RetryingInterceptorConfig} to determine what
* level of exponential backoff to apply to the handled types of failing requests.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public void testNoopConfigPassesThrough() throws ExecutionException, Interrupted
Assert.fail("Should have failed after 1 attempt");
} catch (Exception e) {
Assert.assertEquals(1, forceRetryNTimesInterceptor.getNumRetryableFailures());
}finally {
channel.shutdownNow();
}
}

Expand All @@ -75,6 +77,8 @@ public void testRetryAfterBackoff() throws ExecutionException, InterruptedExcept
} catch (Exception e) {
e.printStackTrace();
Assert.assertEquals(3, forceRetryNTimesInterceptor.getNumRetryableFailures());
} finally {
channel.shutdownNow();
}
}

Expand All @@ -95,6 +99,8 @@ public void testRetryDeadlineExceeded() throws ExecutionException, InterruptedEx
Assert.fail("Should have failed");
} catch (Exception e) {
Assert.assertEquals(1, forceRetryNTimesInterceptor.getNumRetryableFailures());
}finally {
channel.shutdownNow();
}
}

Expand Down
3 changes: 1 addition & 2 deletions java/jdbc/src/main/java/io/vitess/jdbc/VitessConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Statement createStatement() throws SQLException {
}

/**
* Create PreparedStatement for the given connection & sql
* Create PreparedStatement for the given connection and sql
*
* @param sql - Sql Statement
* @return PreparedStatement Object
Expand Down Expand Up @@ -338,7 +338,6 @@ public void setTransactionIsolation(int level) throws SQLException {

/**
* Return Warnings
* <p/>
* TODO: Not implementing as Error is Thrown when occurred
*
* @return SQLWarning or null
Expand Down
2 changes: 0 additions & 2 deletions java/jdbc/src/main/java/io/vitess/jdbc/VitessDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ public Connection connect(String url, Properties info) throws SQLException {

/**
* Checks whether a given url is in a valid format.
* <p/>
* The current uri format is: jdbc:vitess://[host]:[port]
*
* @param url the URL of the database
* @return true, if this driver understands the given URL; false, otherwise
* <p/>
* TODO: Write a better regex
*/
@Override
Expand Down
2 changes: 0 additions & 2 deletions java/jdbc/src/main/java/io/vitess/jdbc/VitessJDBCUrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public String toString() {
* <li><code>trustAlias</code>=alias_under_which_certificate_chain_is_stored (if not set,
* then the first valid <code>X509Certificate</code> found in the trustStore will be used)</li>
* </ul>
* </p>
* <p>
* <p>If <code>useSSL=true</code>, and any of these additional properties are not set on the JDBC
* URL, then the driver will look to see if these corresponding property was set at JVM startup
Expand All @@ -109,7 +108,6 @@ public String toString() {
* <li><code>-Djavax.net.ssl.trustStorePassword</code></li>
* <li><code>-Djavax.net.ssl.trustStoreAlias</code></li>
* </ul>
* </p>
* <p>
* <p>See:</p>
* <p>https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/#tls-ssl</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ public void setQueryTimeout(int seconds) throws SQLException {

/**
* Return Warnings
* <p/>
* Not implementing as Error is Thrown when occurred
*
* @return SQLWarning or null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ public class CharsetMapping {
/**
* MySQL charset could map to several Java encodings. So here we choose the one according to next
* rules:
* <ul>
* <li>if there is no static mapping for this charset then return javaEncoding value as is
* because this could be a custom charset for example
* <li>if static mapping exists and javaEncoding equals to one of Java encoding canonical names
Expand All @@ -550,6 +551,7 @@ public class CharsetMapping {
* <li>if static mapping exists and javaEncoding doesn't match any Java encoding canonical
* names or aliases available for this mapping then return default Java encoding (the first in
* mapping list)
* </ul>
*/
public static String getJavaEncodingForCollationIndex(Integer collationIndex,
String javaEncoding) {
Expand Down
33 changes: 19 additions & 14 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Define versions which are also used by grpc-client/pom.xml. -->
<grpc.version>1.57.1</grpc.version>
<grpc.version>1.67.1</grpc.version>
<!-- NOTE Netty handler and boring SSL must be kept compatible with grpc
https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty -->
<netty.handler.version>4.1.94.Final</netty.handler.version>
<tcnative.boring.ssl.version>2.0.61.Final</tcnative.boring.ssl.version>
<netty.handler.version>4.1.110.Final</netty.handler.version>
<tcnative.boring.ssl.version>2.0.65.Final</tcnative.boring.ssl.version>

<protobuf.java.version>3.25.5</protobuf.java.version>
<protobuf.java.version>4.28.3</protobuf.java.version>
<protobuf.protoc.version>3.24.3</protobuf.protoc.version>
<checkstyle.plugin.version>3.0.0</checkstyle.plugin.version>
<log4j2.version>2.17.1</log4j2.version>
<log4j2.version>2.24.1</log4j2.version>
</properties>

<!-- Add new dependencies here and then add it below or in your module. -->
Expand All @@ -89,12 +89,12 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.0-jre</version>
<version>33.3.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
Expand All @@ -109,7 +109,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
<version>2.17.0</version>
</dependency>

<dependency>
Expand All @@ -122,6 +122,11 @@
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-inprocess</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
Expand Down Expand Up @@ -180,7 +185,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10</version>
<version>2.13.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -227,7 +232,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down Expand Up @@ -288,7 +293,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -299,7 +304,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -312,7 +317,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -325,7 +330,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down

0 comments on commit aa18a36

Please sign in to comment.