This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 198fc67763b Fix agent file error (#34412)
198fc67763b is described below

commit 198fc67763b4963db4226b51617eae98000ae260
Author: jiangML <[email protected]>
AuthorDate: Tue Jan 21 10:11:03 2025 +0800

    Fix agent file error (#34412)
    
    * Fix agent file error
    
    * Fix agent file error
---
 .../logging/file/advice/MetaDataContextsFactoryAdvice.java       | 9 +++++----
 .../file/src/main/resources/META-INF/conf/file-advisors.yaml     | 6 +-----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git 
a/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
 
b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
index d1fbef261c9..79bd302253b 100644
--- 
a/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
+++ 
b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
@@ -19,24 +19,25 @@ package 
org.apache.shardingsphere.agent.plugin.logging.file.advice;
 
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shardingsphere.agent.api.advice.TargetAdviceMethod;
-import 
org.apache.shardingsphere.agent.plugin.core.advice.AbstractStaticMethodAdvice;
+import org.apache.shardingsphere.agent.api.advice.TargetAdviceObject;
+import 
org.apache.shardingsphere.agent.plugin.core.advice.AbstractInstanceMethodAdvice;
 import org.apache.shardingsphere.agent.plugin.core.recorder.MethodTimeRecorder;
 
 /**
  * Meta data contexts factory advice.
  */
 @Slf4j
-public final class MetaDataContextsFactoryAdvice extends 
AbstractStaticMethodAdvice {
+public final class MetaDataContextsFactoryAdvice extends 
AbstractInstanceMethodAdvice {
     
     private final MethodTimeRecorder methodTimeRecorder = new 
MethodTimeRecorder(MetaDataContextsFactoryAdvice.class);
     
     @Override
-    public void beforeMethod(final Class<?> clazz, final TargetAdviceMethod 
method, final Object[] args, final String pluginType) {
+    public void beforeMethod(final TargetAdviceObject target, final 
TargetAdviceMethod method, final Object[] args, final String pluginType) {
         methodTimeRecorder.recordNow(method);
     }
     
     @Override
-    public void afterMethod(final Class<?> clazz, final TargetAdviceMethod 
method, final Object[] args, final Object result, final String pluginType) {
+    public void afterMethod(final TargetAdviceObject target, final 
TargetAdviceMethod method, final Object[] args, final Object result, final 
String pluginType) {
         log.info("Build meta data contexts finished, cost {} milliseconds.", 
methodTimeRecorder.getElapsedTimeAndClean(method));
     }
 }
diff --git 
a/agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
 
b/agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
index 0dfb5e88fbf..57a7c57a459 100644
--- 
a/agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
+++ 
b/agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
@@ -16,15 +16,11 @@
 #
 
 advisors:
-  - target: org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory
+  - target: 
org.apache.shardingsphere.mode.metadata.factory.MetaDataContextsFactory
     advice: 
org.apache.shardingsphere.agent.plugin.logging.file.advice.MetaDataContextsFactoryAdvice
     pointcuts:
       - name: create
         type: method
         params:
           - index: 0
-            type: 
org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService
-          - index: 1
             type: 
org.apache.shardingsphere.mode.manager.ContextManagerBuilderParameter
-          - index: 2
-            type: 
org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext

Reply via email to