Skip to content

Commit

Permalink
Update library to serve building GraalVM Native Image (#21571)
Browse files Browse the repository at this point in the history
* Update library to serve building GraalVM Native Image

* Update groovy version to fix ClassCastException at runtime
  • Loading branch information
linghengqian authored Oct 18, 2022
1 parent c72f63b commit bded970
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 78 deletions.
5 changes: 5 additions & 0 deletions agent/plugins/tracing/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<artifactId>junit</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
package org.apache.shardingsphere.dialect.postgresql.message;

import org.apache.shardingsphere.dialect.postgresql.vendor.PostgreSQLVendorError;
import org.junit.Assert;
import org.junit.Test;
import org.postgresql.util.ServerErrorMessage;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public final class ServerErrorMessageBuilderTest {

@Test
public void assertToServerErrorMessage() {
ServerErrorMessage actual = ServerErrorMessageBuilder.build("FATAL", PostgreSQLVendorError.PRIVILEGE_NOT_GRANTED, "foo_user", "foo_db");
Assert.assertThat(actual.getSeverity(), is("FATAL"));
Assert.assertThat(actual.getSQLState(), is(PostgreSQLVendorError.PRIVILEGE_NOT_GRANTED.getSqlState().getValue()));
Assert.assertThat(actual.getMessage(), is("Access denied for user 'foo_user' to database 'foo_db'"));
assertThat(actual.getSeverity(), is("FATAL"));
assertThat(actual.getSQLState(), is(PostgreSQLVendorError.PRIVILEGE_NOT_GRANTED.getSqlState().getValue()));
assertThat(actual.getMessage(), is("Access denied for user 'foo_user' to database 'foo_db'"));
}
}
82 changes: 41 additions & 41 deletions distribution/proxy/src/main/release-docs/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -222,33 +222,33 @@ The text of each license is the standard Apache 2.0 license.
avatica-core 1.22.0: https://calcite.apache.org/avatica, Apache 2.0
avatica-metrics 1.22.0: https://calcite.apache.org/avatica, Apache 2.0
auto-service-annotations 1.0: https://github.com/google/auto/tree/master/service, Apache 2.0
caffeine 2.9.2: https://github.com/ben-manes/caffeine, Apache 2.0
caffeine 2.9.3: https://github.com/ben-manes/caffeine, Apache 2.0
calcite-core 1.32.0: https://calcite.apache.org, Apache 2.0
calcite-linq4j 1.32.0: https://calcite.apache.org, Apache 2.0
commons-codec 1.15: https://github.com/apache/commons-codec, Apache 2.0
commons-collections4 4.4: https://github.com/apache/commons-collections, Apache 2.0
commons-exec 1.3: https://github.com/apache/commons-exec, Apache 2.0
commons-io 2.11.0: https://github.com/apache/commons-io, Apache 2.0
commons-lang 2.6: https://github.com/apache/commons-lang, Apache 2.0
commons-lang3 3.8: https://github.com/apache/commons-lang, Apache 2.0
commons-lang3 3.12.0: https://github.com/apache/commons-lang, Apache 2.0
commons-logging 1.1.3: https://github.com/apache/commons-logging, Apache 2.0
curator-client 5.1.0: https://github.com/apache/curator, Apache 2.0
curator-framework 5.1.0: https://github.com/apache/curator, Apache 2.0
curator-recipes 5.1.0: https://github.com/apache/curator, Apache 2.0
curator-client 5.3.0: https://github.com/apache/curator, Apache 2.0
curator-framework 5.3.0: https://github.com/apache/curator, Apache 2.0
curator-recipes 5.3.0: https://github.com/apache/curator, Apache 2.0
cosid-core 1.14.4: https://github.com/Ahoo-Wang/CosId, Apache 2.0
error_prone_annotations 2.3.4: https://github.com/google/error-prone, Apache 2.0
failsafe 2.4.1: https://github.com/jhalterman/failsafe, Apache 2.0
failureaccess 1.0.1: https://github.com/google/guava, Apache 2.0
freemarker 2.3.31: https://freemarker.apache.org/, Apache 2.0
groovy 4.0.3: https://groovy.apache.org/, Apache 2.0
grpc-api 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-context 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-core 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-grpclb 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-netty 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-protobuf 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-protobuf-lite 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-stub 1.39.0: https://github.com/grpc/grpc-java, Apache 2.0
groovy 4.0.6: https://groovy.apache.org/, Apache 2.0
grpc-api 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-context 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-core 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-grpclb 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-netty 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-protobuf 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-protobuf-lite 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
grpc-stub 1.48.0: https://github.com/grpc/grpc-java, Apache 2.0
gson 2.9.1: https://github.com/google/gson, Apache 2.0
guava 30.0-jre: https://github.com/google/guava, Apache 2.0
HikariCP 3.4.2: https://github.com/brettwooldridge/HikariCP, Apache 2.0
Expand All @@ -260,30 +260,30 @@ The text of each license is the standard Apache 2.0 license.
jackson-databind 2.10.0: http://github.com/FasterXML/jackson, Apache 2.0
jackson-dataformat-yaml 2.13.2: http://github.com/FasterXML/jackson, Apache 2.0
jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
jetcd-common 0.5.10: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.5.10: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-common 0.7.3: https://github.com/etcd-io/jetcd, Apache 2.0
jetcd-core 0.7.3: https://github.com/etcd-io/jetcd, Apache 2.0
json-path 2.7.0: https://github.com/jayway/JsonPath, Apache 2.0
json-smart 2.4.7: https://www.minidev.net/, Apache 2.0
json-simple 1.1.1: https://code.google.com/archive/p/json-simple/, Apache 2.0
jsr305 3.0.2: http://findbugs.sourceforge.net/, Apache 2.0
log4j 1.2.17: http://logging.apache.org/log4j/1.2/, Apache 2.0
memory 0.9.0, Apache 2.0
netty-buffer 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-codec 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-codec-dns 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-codec-http 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-codec-http2 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-codec-socks 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-common 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-handler 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-handler-proxy 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-resolver 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-resolver-dns 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-transport 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-transport-classes-epoll 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.80.Final-linux-aarch_64: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.80.Final-linux-x86_64: https://github.com/netty, Apache 2.0
netty-transport-native-unix-common 4.1.80.Final: https://github.com/netty, Apache 2.0
netty-buffer 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-codec 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-codec-dns 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-codec-http 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-codec-http2 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-codec-socks 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-common 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-handler 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-handler-proxy 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-resolver 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-resolver-dns 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-transport 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-transport-classes-epoll 4.1.84.Final: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.84.Final-linux-aarch_64: https://github.com/netty, Apache 2.0
netty-transport-native-epoll 4.1.84.Final-linux-x86_64: https://github.com/netty, Apache 2.0
netty-transport-native-unix-common 4.1.84.Final: https://github.com/netty, Apache 2.0
perfmark-api 0.23.0: https://github.com/perfmark/perfmark, Apache 2.0
proto-google-common-protos 2.0.1: https://github.com/googleapis/common-protos-java, Apache 2.0
proj4j 1.1.5: https://github.com/locationtech/proj4j, Apache 2.0
Expand All @@ -293,8 +293,8 @@ The text of each license is the standard Apache 2.0 license.
uzaygezen-core 0.2: https://code.google.com/p/uzaygezen, Apache 2.0
vertx-mysql-client 4.3.3: https://github.com/eclipse-vertx/vertx-sql-client, Apache 2.0
vertx-sql-client 4.3.3: https://github.com/eclipse-vertx/vertx-sql-client, Apache 2.0
zookeeper 3.6.0: https://github.com/apache/zookeeper, Apache 2.0
zookeeper-jute 3.6.0: https://github.com/apache/zookeeper, Apache 2.0
zookeeper 3.8.0: https://github.com/apache/zookeeper, Apache 2.0
zookeeper-jute 3.8.0: https://github.com/apache/zookeeper, Apache 2.0

========================================================================
Apache 2.0 licenses
Expand All @@ -303,11 +303,11 @@ Apache 2.0 licenses
The following components are provided under the Apache License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

atomikos-util 5.0.8: https://www.atomikos.com, Apache 2.0
transactions 5.0.8: https://www.atomikos.com, Apache 2.0
transactions-api 5.0.8: https://www.atomikos.com, Apache 2.0
transactions-jdbc 5.0.8: https://www.atomikos.com, Apache 2.0
transactions-jta 5.0.8: https://www.atomikos.com, Apache 2.0
atomikos-util 5.0.9: https://www.atomikos.com, Apache 2.0
transactions 5.0.9: https://www.atomikos.com, Apache 2.0
transactions-api 5.0.9: https://www.atomikos.com, Apache 2.0
transactions-jdbc 5.0.9: https://www.atomikos.com, Apache 2.0
transactions-jta 5.0.9: https://www.atomikos.com, Apache 2.0
vertx-core 4.3.3: https://github.com/eclipse-vertx/vert.x, Apache 2.0

========================================================================
Expand Down Expand Up @@ -344,8 +344,8 @@ EPL licenses
The following components are provided under the EPL License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project].txt.

logback-classic 1.2.10: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.10: https://github.com/qos-ch/logback, EPL 1.0
logback-classic 1.2.11: https://github.com/qos-ch/logback, EPL 1.0
logback-core 1.2.11: https://github.com/qos-ch/logback, EPL 1.0
mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java, EPL 1.0
h2 2.1.214: https://github.com/h2database/h2database, EPL 1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ShardingSphere-Proxy 支持配置多个逻辑数据源,每个以 `config-` 前

ShardingSphere-Proxy 默认集成 ZooKeeper Curator 客户端,集群模式使用 ZooKeeper 无须引入其他依赖。

如果集群模式使用 Etcd,需要将 Etcd 的客户端驱动程序 [jetcd-core 0.5.0](https://repo1.maven.org/maven2/io/etcd/jetcd-core/0.5.0/jetcd-core-0.5.0.jar) 复制至目录 `ext-lib`
如果集群模式使用 Etcd,需要将 Etcd 的客户端驱动程序 [jetcd-core 0.7.3](https://repo1.maven.org/maven2/io/etcd/jetcd-core/0.7.3/jetcd-core-0.7.3.jar) 复制至目录 `ext-lib`

6. (可选)引入分布式事务所需依赖

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If the backend is connected to a MySQL database, please download [mysql-connecto

ShardingSphere-Proxy integrates the ZooKeeper Curator client by default. ZooKeeper is used in cluster mode without introducing other dependencies.

If the cluster mode uses Etcd, the client drivers of Etcd [jetcd-core 0.5.0](https://repo1.maven.org/maven2/io/etcd/jetcd-core/0.5.0/jetcd-core-0.5.0.jar) need to be copied into the `ext-lib` directory.
If the cluster mode uses Etcd, the client drivers of Etcd [jetcd-core 0.7.3](https://repo1.maven.org/maven2/io/etcd/jetcd-core/0.7.3/jetcd-core-0.7.3.jar) need to be copied into the `ext-lib` directory.

6. Introduce dependencies required by distributed transactions (Optional)

Expand Down
4 changes: 2 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<seata.version>1.4.2</seata.version>

<junit.version>4.13.2</junit.version>
<junit4.version>4.13.2</junit4.version>
<hamcrest.version>1.3</hamcrest.version>
<mockito.version>2.7.21</mockito.version>

Expand Down Expand Up @@ -373,7 +373,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<version>${junit4.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
package org.apache.shardingsphere.infra.datasource.props;

import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.Arrays;
import java.util.HashMap;
Expand All @@ -32,16 +30,13 @@
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;

public final class DataSourcePropertiesTest {

@Rule
public ExpectedException thrown = ExpectedException.none();

@SuppressWarnings("unchecked")
@Test
public void assertGetDataSourceConfigurationWithConnectionInitSqls() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.google.common.base.Preconditions;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.shardingsphere.data.pipeline.api.config.job.PipelineJobConfiguration;
import org.apache.shardingsphere.data.pipeline.api.config.job.yaml.YamlPipelineJobConfiguration;
import org.apache.shardingsphere.data.pipeline.api.job.PipelineJobId;
Expand Down
2 changes: 1 addition & 1 deletion kernel/transaction/type/xa/provider/atomikos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<name>${project.artifactId}</name>

<properties>
<atomikos.version>5.0.8</atomikos.version>
<atomikos.version>5.0.9</atomikos.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@

package org.apache.shardingsphere.mode.repository.cluster.etcd;

import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import io.etcd.jetcd.ByteSequence;
import io.etcd.jetcd.Client;
import io.etcd.jetcd.KeyValue;
import io.etcd.jetcd.Util;
import io.etcd.jetcd.Watch;
import io.etcd.jetcd.options.DeleteOption;
import io.etcd.jetcd.options.GetOption;
import io.etcd.jetcd.options.OptionsUtil;
import io.etcd.jetcd.options.PutOption;
import io.etcd.jetcd.options.WatchOption;
import io.etcd.jetcd.support.Observers;
import io.etcd.jetcd.support.Util;
import io.etcd.jetcd.watch.WatchEvent;
import lombok.SneakyThrows;
import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
Expand Down Expand Up @@ -192,8 +194,10 @@ public void watch(final String key, final DataChangedEventListener dataChangedEv
}
}
});
client.getWatchClient().watch(ByteSequence.from(key, StandardCharsets.UTF_8),
WatchOption.newBuilder().withPrefix(ByteSequence.from(key, StandardCharsets.UTF_8)).build(), listener);
ByteSequence prefix = ByteSequence.from(key, StandardCharsets.UTF_8);
Preconditions.checkNotNull(prefix, "prefix should not be null");
client.getWatchClient().watch(prefix,
WatchOption.newBuilder().withRange(OptionsUtil.prefixEndOf(prefix)).build(), listener);
}

private Type getEventChangedType(final WatchEvent event) {
Expand Down
Loading

0 comments on commit bded970

Please sign in to comment.