Skip to content

Commit

Permalink
refactor package of tracing.listener
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Aug 15, 2018
1 parent 316718f commit 299752a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import io.opentracing.util.GlobalTracer;
import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.opentracing.config.ConfigurationLoader;
import io.shardingsphere.opentracing.listener.DMLExecuteEventListener;
import io.shardingsphere.opentracing.listener.DQLExecuteEventListener;
import io.shardingsphere.opentracing.listener.OverallExecuteEventListener;
import io.shardingsphere.opentracing.listener.MergeEventListener;
import io.shardingsphere.opentracing.listener.RoutingEventListener;
import io.shardingsphere.opentracing.listener.execution.DMLExecuteEventListener;
import io.shardingsphere.opentracing.listener.execution.DQLExecuteEventListener;
import io.shardingsphere.opentracing.listener.execution.OverallExecuteEventListener;
import io.shardingsphere.opentracing.listener.merger.MergeEventListener;
import io.shardingsphere.opentracing.listener.routing.RouteEventListener;
import io.shardingsphere.opentracing.sampling.SamplingService;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -74,7 +74,7 @@ private static void init(final Tracer tracer, final int sampleNumPM) {
new OverallExecuteEventListener().register();
new DQLExecuteEventListener().register();
new DMLExecuteEventListener().register();
new RoutingEventListener().register();
new RouteEventListener().register();
new MergeEventListener().register();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.execution;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
Expand All @@ -28,7 +28,7 @@
* @author wangkai
* @author maxiaoguang
*/
public final class DMLExecuteEventListener extends SQLExecuteEventListener {
public final class DMLExecuteEventListener extends ExecuteEventListener {

/**
* Listen DML execution event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.execution;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
Expand All @@ -28,7 +28,7 @@
* @author wangkai
* @author maxiaoguang
*/
public final class DQLExecuteEventListener extends SQLExecuteEventListener {
public final class DQLExecuteEventListener extends ExecuteEventListener {

/**
* Listen DQL execution event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.execution;

import com.google.common.base.Joiner;
import io.opentracing.ActiveSpan;
Expand All @@ -25,6 +25,7 @@
import io.shardingsphere.core.executor.event.SQLExecutionEvent;
import io.shardingsphere.core.executor.threadlocal.ExecutorDataMap;
import io.shardingsphere.opentracing.ShardingTracer;
import io.shardingsphere.opentracing.listener.TracingListener;
import io.shardingsphere.opentracing.tag.LocalTags;

/**
Expand All @@ -34,7 +35,7 @@
* @author wangkai
* @author maxiaoguang
*/
public abstract class SQLExecuteEventListener extends TracingListener<SQLExecutionEvent> {
public abstract class ExecuteEventListener extends TracingListener<SQLExecutionEvent> {

private static final String SNAPSHOT_DATA_KEY = "OPENTRACING_SNAPSHOT_DATA";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.execution;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
Expand All @@ -25,6 +25,7 @@
import io.shardingsphere.core.executor.event.OverallExecutionEvent;
import io.shardingsphere.core.executor.threadlocal.ExecutorDataMap;
import io.shardingsphere.opentracing.ShardingTracer;
import io.shardingsphere.opentracing.listener.TracingListener;
import io.shardingsphere.opentracing.sampling.SamplingService;
import io.shardingsphere.opentracing.tag.LocalTags;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.merger;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
Expand All @@ -24,6 +24,7 @@
import io.opentracing.tag.Tags;
import io.shardingsphere.core.merger.event.MergeEvent;
import io.shardingsphere.opentracing.ShardingTracer;
import io.shardingsphere.opentracing.listener.TracingListener;
import io.shardingsphere.opentracing.tag.LocalTags;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* </p>
*/

package io.shardingsphere.opentracing.listener;
package io.shardingsphere.opentracing.listener.routing;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
Expand All @@ -24,14 +24,15 @@
import io.opentracing.tag.Tags;
import io.shardingsphere.core.routing.event.RoutingEvent;
import io.shardingsphere.opentracing.ShardingTracer;
import io.shardingsphere.opentracing.listener.TracingListener;
import io.shardingsphere.opentracing.tag.LocalTags;

/**
* SQL route event listener.
*
* @author chenqingyang
*/
public final class RoutingEventListener extends TracingListener<RoutingEvent> {
public final class RouteEventListener extends TracingListener<RoutingEvent> {

private static final String OPERATION_NAME_PREFIX = "/SHARDING-SPHERE/ROUTING/";

Expand Down

0 comments on commit 299752a

Please sign in to comment.