Support for ShardingSphere 5.0.0 (#98)

* Update ShardingSphere to 5.0.0
* Change docs
This commit is contained in:
Dachuan J 2022-01-28 10:57:23 +08:00 committed by GitHub
parent 592fe29d13
commit fd1f4fe609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 275 additions and 278 deletions

View File

@ -67,7 +67,7 @@ jobs:
- shardingsphere-3.x-scenario
- shardingsphere-4.0.x-scenario
- shardingsphere-4.x-scenario
- shardingsphere-5.0.0-beta-scenario
- shardingsphere-5.0.0-scenario
- sofarpc-scenario
- solrj-7.x-scenario
- spring-3.0.x-scenario

View File

@ -25,6 +25,7 @@ Release Notes.
* Migrate base images to Temurin and add images for ARM.
* (Plugin Test) Fix compiling issues in many plugin tests due to they didn't lock the Spring version, and Spring 3 is
incompatible with 2.x APIs and JDK8 compiling.
* Support ShardingSphere 5.0.0
#### Documentation

View File

@ -31,7 +31,7 @@
<module>sharding-sphere-3.x-plugin</module>
<module>sharding-sphere-4.0.x-plugin</module>
<module>sharding-sphere-4.1.0-plugin</module>
<module>shardingsphere-5.0.0-beta-plugin</module>
<module>sharding-sphere-5.0.0-plugin</module>
</modules>
<properties>

View File

@ -25,15 +25,15 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apm-shardingsphere-5.0.0-beta-plugin</artifactId>
<artifactId>apm-shardingsphere-5.0.0-plugin</artifactId>
<packaging>jar</packaging>
<name>shardingsphere-5.0.0-beta-plugin</name>
<name>sharding-sphere-5.0.0-plugin</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shardingsphere.version>5.0.0-beta</shardingsphere.version>
<shardingsphere.version>5.0.0</shardingsphere.version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutorDataMap;
import org.apache.skywalking.apm.agent.core.context.ContextManager;

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutorDataMap;
import org.apache.skywalking.apm.agent.core.context.ContextManager;

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.context.tag.Tags;

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutorDataMap;
import org.apache.skywalking.apm.agent.core.context.ContextManager;

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
public abstract class AbstractShardingSphereV500BetaInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
public abstract class AbstractShardingSphereV500Instrumentation extends ClassInstanceMethodsEnhancePluginDefine {
@Override
protected final String[] witnessClasses() {

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
@ -24,7 +24,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.ExecuteInterceptor;
import static net.bytebuddy.matcher.ElementMatchers.isPrivate;
import static net.bytebuddy.matcher.ElementMatchers.named;
@ -33,7 +32,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
* {@link ExecuteInstrumentation} presents that skywalking intercepts {@link
* org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback}.
*/
public class ExecuteInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class ExecuteInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback";
@ -48,7 +47,7 @@ public class ExecuteInstrumentation extends AbstractShardingSphereV500BetaInstru
@Override
public String getMethodsInterceptor() {
return ExecuteInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.ExecuteInterceptor";
}
@Override

View File

@ -16,14 +16,13 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.JDBCRootInvokeInterceptor;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments;
@ -41,7 +40,7 @@ import static org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMa
* <li>{@link org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement#executeBatch}</li>
* </ul>
*/
public class JDBCRootInvokeInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class JDBCRootInvokeInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String[] ENHANCE_CLASSES = {
"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement",
@ -64,7 +63,7 @@ public class JDBCRootInvokeInstrumentation extends AbstractShardingSphereV500Bet
@Override
public String getMethodsInterceptor() {
return JDBCRootInvokeInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.JDBCRootInvokeInterceptor";
}
@Override

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
@ -24,14 +24,13 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.ParseInterceptor;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
* {@link ParseInstrumentation} presents that skywalking intercepts {@link org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine}.
*/
public class ParseInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class ParseInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine";
@ -46,7 +45,7 @@ public class ParseInstrumentation extends AbstractShardingSphereV500BetaInstrume
@Override
public String getMethodsInterceptor() {
return ParseInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.ParseInterceptor";
}
@Override

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
@ -24,14 +24,13 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.ProxyRootInvokeInterceptor;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
* ProxyRootInvokeInstrumentation presents that skywalking intercepts org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.
*/
public class ProxyRootInvokeInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class ProxyRootInvokeInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask";
@ -46,7 +45,7 @@ public class ProxyRootInvokeInstrumentation extends AbstractShardingSphereV500Be
@Override
public String getMethodsInterceptor() {
return ProxyRootInvokeInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.ProxyRootInvokeInterceptor";
}
@Override

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
@ -25,12 +25,11 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.RewriteInterceptor;
/**
* {@link RewriteInstrumentation} presents that skywalking intercepts {@link org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry}.
*/
public class RewriteInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class RewriteInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry";
@ -46,7 +45,7 @@ public class RewriteInstrumentation extends AbstractShardingSphereV500BetaInstru
@Override
public String getMethodsInterceptor() {
return RewriteInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.RewriteInterceptor";
}
@Override

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define;
package org.apache.skywalking.apm.plugin.shardingsphere.v500.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
@ -25,12 +25,11 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import org.apache.skywalking.apm.plugin.shardingsphere.v500beta.RouteInterceptor;
/**
* {@link RouteInstrumentation} presents that skywalking intercepts {@link org.apache.shardingsphere.infra.route.engine.SQLRouteEngine}.
*/
public class RouteInstrumentation extends AbstractShardingSphereV500BetaInstrumentation {
public class RouteInstrumentation extends AbstractShardingSphereV500Instrumentation {
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.infra.route.engine.SQLRouteEngine";
@ -46,7 +45,7 @@ public class RouteInstrumentation extends AbstractShardingSphereV500BetaInstrume
@Override
public String getMethodsInterceptor() {
return RouteInterceptor.class.getName();
return "org.apache.skywalking.apm.plugin.shardingsphere.v500.RouteInterceptor";
}
@Override

View File

@ -13,9 +13,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.ProxyRootInvokeInstrumentation
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.JDBCRootInvokeInstrumentation
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.ParseInstrumentation
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.RouteInstrumentation
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.RewriteInstrumentation
shardingsphere-5.0.0-beta=org.apache.skywalking.apm.plugin.shardingsphere.v500beta.define.ExecuteInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.ProxyRootInvokeInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.JDBCRootInvokeInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.ParseInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.RouteInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.RewriteInstrumentation
sharding-sphere-5.0.0=org.apache.skywalking.apm.plugin.shardingsphere.v500.define.ExecuteInstrumentation

View File

@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.plugin.shardingsphere.v500beta;
package org.apache.skywalking.apm.plugin.shardingsphere.v500;
import org.apache.shardingsphere.infra.binder.LogicSQL;
import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;

View File

@ -79,7 +79,7 @@
- sharding-sphere-3.x
- sharding-sphere-4.0.0
- sharding-sphere-4.1.0
- shardingsphere-5.0.0-beta
- sharding-sphere-5.0.0
- sofarpc
- solrj-7.x
- spring-annotation

View File

@ -35,7 +35,7 @@ metrics based on the tracing data.
* Mysql Driver 5.x, 6.x, 8.x
* Oracle Driver (Optional¹)
* H2 Driver 1.3.x -> 1.4.x
* [ShardingSphere](https://github.com/apache/shardingsphere) 3.0.0, 4.0.0, 4.0.1, 4.1.0, 4.1.1, 5.0.0-beta
* [ShardingSphere](https://github.com/apache/shardingsphere) 3.0.0, 4.0.0, 4.0.1, 4.1.0, 4.1.1, 5.0.0
* PostgreSQL Driver 8.x, 9.x, 42.x
* Mariadb Driver 2.x, 1.8
* [InfluxDB](https://github.com/influxdata/influxdb-java) 2.5 -> 2.17

View File

@ -1,218 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems:
- serviceName: shardingsphere-5.0.0-beta-scenario
segmentSize: gt 0
segments:
- segmentId: not null
spans:
- operationName: H2/JDBI/PreparedStatement/executeQuery
parentSpanId: 0
spanId: 1
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- {key: db.type, value: sql}
- {key: db.instance, value: demo_ds_1}
- {key: db.statement, value: SELECT * FROM t_order_0}
- operationName: /ShardingSphere/executeSQL/
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- parentEndpoint: GET:/shardingsphere-5.0.0-beta-scenario/case/execute
networkAddress: ''
refType: CrossThread
parentSpanId: 2
parentTraceSegmentId: not null
parentServiceInstance: not null
parentService: shardingsphere-5.0.0-beta-scenario
traceId: not null
- segmentId: not null
spans:
- operationName: H2/JDBI/PreparedStatement/executeQuery
parentSpanId: 0
spanId: 1
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- {key: db.type, value: sql}
- {key: db.instance, value: demo_ds_0}
- {key: db.statement, value: SELECT * FROM t_order_1}
- operationName: /ShardingSphere/executeSQL/
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- parentEndpoint: GET:/shardingsphere-5.0.0-beta-scenario/case/execute
networkAddress: ''
refType: CrossThread
parentSpanId: 2
parentTraceSegmentId: not null
parentServiceInstance: not null
parentService: shardingsphere-5.0.0-beta-scenario
traceId: not null
- segmentId: not null
spans:
- operationName: H2/JDBI/PreparedStatement/executeQuery
parentSpanId: 0
spanId: 1
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- {key: db.type, value: sql}
- {key: db.instance, value: demo_ds_1}
- {key: db.statement, value: SELECT * FROM t_order_1}
- operationName: /ShardingSphere/executeSQL/
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- parentEndpoint: GET:/shardingsphere-5.0.0-beta-scenario/case/execute
networkAddress: ''
refType: CrossThread
parentSpanId: 2
parentTraceSegmentId: not null
parentServiceInstance: not null
parentService: shardingsphere-5.0.0-beta-scenario
traceId: not null
- segmentId: not null
spans:
- operationName: /ShardingSphere/parseSQL/
parentSpanId: 0
spanId: 1
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
tags:
- {key: db.statement, value: SELECT * FROM t_order}
- operationName: /ShardingSphere/routeSQL/
parentSpanId: 2
spanId: 3
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: /ShardingSphere/rewriteSQL/
parentSpanId: 2
spanId: 4
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: H2/JDBI/PreparedStatement/executeQuery
parentSpanId: 5
spanId: 6
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- {key: db.type, value: sql}
- {key: db.instance, value: demo_ds_0}
- {key: db.statement, value: SELECT * FROM t_order_0}
- operationName: /ShardingSphere/executeSQL/
parentSpanId: 2
spanId: 5
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: /ShardingSphere/JDBCRootInvoke/
parentSpanId: 0
spanId: 2
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: GET:/shardingsphere-5.0.0-beta-scenario/case/execute
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: not null
endTime: not null
componentId: 1
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/shardingsphere-5.0.0-beta-scenario/case/execute'}
- {key: http.method, value: GET}

View File

@ -18,4 +18,4 @@
home="$(cd "$(dirname $0)"; pwd)"
java -jar ${agent_opts} ${home}/../libs/shardingsphere-5.0.0-beta-scenario.jar &
java -jar ${agent_opts} ${home}/../libs/shardingsphere-5.0.0-scenario.jar &

View File

@ -0,0 +1,213 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems:
- serviceName: shardingsphere-5.0.0-scenario
segmentSize: gt 0
segments:
- segmentId: not null
spans:
- operationName: H2/JDBI/PreparedStatement/executeQuery
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- { key: db.type, value: sql}
- { key: db.instance, value: not null}
- { key: db.statement, value: not null}
- segmentId: not null
spans:
- operationName: H2/JDBI/Statement/executeUpdate
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- { key: db.type, value: sql }
- { key: db.instance, value: not null }
- { key: db.statement, value: not null }
- operationName: /ShardingSphere/executeSQL/
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- { parentEndpoint: 'HEAD:/shardingsphere-5.0.0-scenario/case/healthCheck', networkAddress: '',
refType: CrossThread, parentSpanId: not null, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: shardingsphere-5.0.0-scenario,
traceId: not null }
- segmentId: not null
spans:
- operationName: H2/JDBI/Connection/close
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- { key: db.type, value: sql }
- { key: db.instance, value: not null }
- { key: db.statement, value: '' }
- segmentId: not null
spans:
- operationName: H2/JDBI/PreparedStatement/executeQuery
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- { key: db.type, value: sql }
- { key: db.instance, value: not null }
- { key: db.statement, value: not null }
- operationName: /ShardingSphere/executeSQL/
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- { parentEndpoint: 'GET:/shardingsphere-5.0.0-scenario/case/execute', networkAddress: '',
refType: CrossThread, parentSpanId: not null, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: shardingsphere-5.0.0-scenario,
traceId: not null }
- segmentId: not null
spans:
- operationName: /ShardingSphere/parseSQL/
parentSpanId: 0
spanId: 1
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
tags:
- { key: db.statement, value: not null }
- operationName: /ShardingSphere/routeSQL/
parentSpanId: 2
spanId: 3
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: /ShardingSphere/rewriteSQL/
parentSpanId: 2
spanId: 4
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: H2/JDBI/PreparedStatement/executeQuery
parentSpanId: 5
spanId: 6
spanLayer: Database
startTime: not null
endTime: not null
componentId: 32
isError: false
spanType: Exit
peer: localhost:-1
skipAnalysis: false
tags:
- { key: db.type, value: sql }
- { key: db.instance, value: not null }
- { key: db.statement, value: not null }
- operationName: /ShardingSphere/executeSQL/
parentSpanId: 2
spanId: 5
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: /ShardingSphere/JDBCRootInvoke/
parentSpanId: 0
spanId: 2
spanLayer: Unknown
startTime: not null
endTime: not null
componentId: 60
isError: false
spanType: Local
peer: ''
skipAnalysis: false
- operationName: GET:/shardingsphere-5.0.0-scenario/case/execute
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: not null
endTime: not null
componentId: 1
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- { key: url, value: 'http://localhost:8080/shardingsphere-5.0.0-scenario/case/execute' }
- { key: http.method, value: GET }

View File

@ -15,6 +15,6 @@
# limitations under the License.
type: jvm
entryService: http://localhost:8080/shardingsphere-5.0.0-beta-scenario/case/execute
healthCheck: http://localhost:8080/shardingsphere-5.0.0-beta-scenario/case/healthCheck
entryService: http://localhost:8080/shardingsphere-5.0.0-scenario/case/execute
healthCheck: http://localhost:8080/shardingsphere-5.0.0-scenario/case/healthCheck
startScript: ./bin/startup.sh

View File

@ -22,14 +22,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>shardingsphere-5.0.0-beta-scenario</artifactId>
<version>5.0.0-beta</version>
<artifactId>shardingsphere-5.0.0-scenario</artifactId>
<version>5.0.0</version>
<name>skywalking-shardingsphere-5.0.0-beta-scenario</name>
<name>skywalking-shardingsphere-5.0.0-scenario</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<test.framework.version>5.0.0-beta</test.framework.version>
<test.framework.version>5.0.0</test.framework.version>
<spring.version>4.3.8.RELEASE</spring.version>
<spring.boot.version>1.5.2.RELEASE</spring.boot.version>
@ -63,7 +63,7 @@
</dependency>
</dependencies>
<build>
<finalName>shardingsphere-5.0.0-beta-scenario</finalName>
<finalName>shardingsphere-5.0.0-scenario</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -33,7 +33,7 @@
<files>
<file>
<source>${project.build.directory}/shardingsphere-5.0.0-beta-scenario.jar</source>
<source>${project.build.directory}/shardingsphere-5.0.0-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>

View File

@ -60,6 +60,7 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
Properties tableOrderItemInlineProperties = new Properties();
tableOrderItemInlineProperties.setProperty("algorithm-expression", "t_order_item_${order_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingSphereAlgorithmConfiguration("INLINE", tableOrderItemInlineProperties));
shardingRuleConfig.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
Properties properties = new Properties();
properties.setProperty(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(), "16");
properties.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), "true");
@ -68,7 +69,7 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
private static ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "demo_ds_${0..1}.t_order_${[0, 1]}");
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "SNOWFLAKE"));
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "snowflake"));
result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "t_order_inline"));
return result;
}
@ -91,4 +92,10 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
result.put("demo_ds_1", DataSourceUtil.getDataSource("demo_ds_1"));
return result;
}
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker-id", "123");
return result;
}
}

View File

@ -34,7 +34,7 @@ public class DataSourceUtil {
public static void createDataSource(final String dataSourceName) {
JdbcDataSource result = new JdbcDataSource();
result.setUrl("jdbc:h2:mem:" + dataSourceName + ";DB_CLOSE_DELAY=-1");
result.setUrl("jdbc:h2:mem:" + dataSourceName + ";DB_CLOSE_DELAY=-1;;DATABASE_TO_UPPER=FALSE");
result.setUser("sa");
result.setPassword("");
DATA_SOURCE_MAP.put(dataSourceName, result);

View File

@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
server.port=8080
server.contextPath=/shardingsphere-5.0.0-beta-scenario
server.contextPath=/shardingsphere-5.0.0-scenario

View File

@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
5.0.0-beta
5.0.0