Skip to content
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

Disruptor event clear #546

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>tracer-all-parent</artifactId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<packaging>pom</packaging>
<name>tracer-all-parent</name>
<description>Alipay SOFATracer Log Implemented by OpenTracing</description>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-datasource-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-dubbo-2.6.x-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-dubbo-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-flexible-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-httpclient-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-kafkamq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-mongodb-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-okhttp-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-rabbitmq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-redis-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-resttmplate-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-rocketmq-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-springmvc-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sofa-tracer-plugins/sofa-tracer-zipkin-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions tracer-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>tracer-all</artifactId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<packaging>jar</packaging>

<name>SOFATracer in one without SOFABoot starter</name>
Expand Down
2 changes: 1 addition & 1 deletion tracer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public void onEvent(StringEvent event, long sequence, boolean endOfBatch) throws
try {
appender.append(string);
appender.flush();
event.clear();
} catch (Exception e) {
//todo Globally keep a synchronized log for synchronizing print logs at some key points
if (string != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void onEvent(SofaTracerSpanEvent event, long sequence, boolean endOfBatch
appender.append(encodedStr);
}
appender.flush();

event.clear();
}
} catch (Exception e) {
SofaTracerSpanContext sofaTracerSpanContext = sofaTracerSpan
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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.
*/
package com.alipay.common.tracer.core.appender.manager;

/**
*
* @author songzijie
* @version $Id: ObjectEvent.java, v 0.1 2024-10-08 16:10 songzijie Exp $$
*/
public interface ObjectEvent {

void clear();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @author liangen 3/10/17
*/
public class SofaTracerSpanEvent {
public class SofaTracerSpanEvent implements ObjectEvent {
private volatile SofaTracerSpan sofaTracerSpan;

/**
Expand All @@ -41,4 +41,9 @@ public SofaTracerSpan getSofaTracerSpan() {
public void setSofaTracerSpan(SofaTracerSpan sofaTracerSpan) {
this.sofaTracerSpan = sofaTracerSpan;
}

@Override
public void clear() {
setSofaTracerSpan(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author luoguimu123
* @version $Id: StringEvent.java, v 0.1 November 21, 2017 7:01 PM luoguimu123 Exp $
*/
public class StringEvent {
public class StringEvent implements ObjectEvent {

private volatile String string;

Expand All @@ -32,4 +32,9 @@ public String getString() {
public void setString(String string) {
this.string = string;
}

@Override
public void clear() {
setString(null);
}
}
2 changes: 1 addition & 1 deletion tracer-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
</parent>

<artifactId>tracer-extensions</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tracer-sofa-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tracer-test/core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tracer-test/log4j-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tracer-test/log4j2-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tracer-test/logback-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>tracer-all-parent</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>3.1.7</version>
<version>3.1.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading