You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/21 07:33:59 UTC

[GitHub] [incubator-shenyu] HaiqiQin commented on a diff in pull request #3593: [type:refactor] change logging-elasticsearch-plugin thread pool

HaiqiQin commented on code in PR #3593:
URL: https://github.com/apache/incubator-shenyu/pull/3593#discussion_r902256798


##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/pom.xml:
##########
@@ -61,6 +61,10 @@
             <artifactId>jakarta.json-api</artifactId>
             <version>${jakarta.json-api.version}</version>
         </dependency>
+        <dependency>

Review Comment:
   OK.Thank you!



##########
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-elasticsearch/src/main/java/org/apache/shenyu/plugin/logging/elasticsearch/AbstractLogCollector.java:
##########
@@ -49,11 +53,15 @@ public abstract class AbstractLogCollector implements LogCollector {
 
     private final AtomicBoolean started = new AtomicBoolean(true);
 
+    private final ThreadFactory factory = ShenyuThreadFactory.create("shenyu-logging-elasticsearch", true);
+
     @Override
     public void start() {
         bufferSize = LogCollectConfigUtils.getGlobalLogConfig().getBufferQueueSize();
         bufferQueue = new LinkedBlockingDeque<>(bufferSize);
-        ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
+        ByteBuddyAgent.install();
+        ShenyuThreadPoolExecutor threadExecutor = new ShenyuThreadPoolExecutor(1, 1, 0L,
+                TimeUnit.MILLISECONDS, new MemoryLimitedTaskQueue<>(ByteBuddyAgent.getInstrumentation()), factory, new AbortPolicy());

Review Comment:
   OK.I will modify it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org