Commit caffba4e authored by 吴晟's avatar 吴晟 Committed by GitHub
Browse files

Revert "Support SpyMemcached V2.x"

parent 57860b95
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ public class ComponentsDefine {

    public static final OfficialComponent JETTY_SERVER = new OfficialComponent(19, "JettyServer");

    public static final OfficialComponent MEMCACHE = new OfficialComponent(20, "Memcache");
    
    private static ComponentsDefine instance = new ComponentsDefine();

    private String[] components;
@@ -56,7 +54,7 @@ public class ComponentsDefine {
    }

    public ComponentsDefine() {
        components = new String[21];
        components = new String[20];
        addComponent(TOMCAT);
        addComponent(HTTPCLIENT);
        addComponent(DUBBO);
@@ -76,7 +74,6 @@ public class ComponentsDefine {
        addComponent(NUTZ_HTTP);
        addComponent(JETTY_CLIENT);
        addComponent(JETTY_SERVER);
        addComponent(MEMCACHE);
    }

    private void addComponent(OfficialComponent component) {
+0 −5
Original line number Diff line number Diff line
@@ -125,11 +125,6 @@
            <artifactId>apm-jetty-server-9.x-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.skywalking</groupId>
            <artifactId>apm-spymemcached-2.x-plugin</artifactId>
            <version>${project.version}</version>
         </dependency>

        <!-- activation -->
        <dependency>
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@
        <module>struts2-2.x-plugin</module>
        <module>nutz-plugins</module>
        <module>jetty-plugin</module>
        <module>spymemcached-2.x-plugin</module>
    </modules>
    <packaging>pom</packaging>

+0 −35
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.skywalking</groupId>
        <artifactId>apm-sdk-plugin</artifactId>
        <version>3.2.3-2017</version>
    </parent>

    <artifactId>apm-spymemcached-2.x-plugin</artifactId>
    <name>spymemcached-2.x-plugin</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spymemcached.version>2.11.1</spymemcached.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>net.spy</groupId>
            <artifactId>spymemcached</artifactId>
            <version>${spymemcached.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.4.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
 No newline at end of file
+0 −23
Original line number Diff line number Diff line
package org.skywalking.apm.plugin.spymemcached.v2;

import java.net.InetSocketAddress;
import java.util.List;

import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;

public class MemcachedConstructorWithInetSocketAddressListArgInterceptor implements InstanceConstructorInterceptor {
    
    @Override
    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
        StringBuilder memcachConnInfo = new StringBuilder();
        @SuppressWarnings("unchecked")
        List<InetSocketAddress> inetSocketAddressList = (List<InetSocketAddress>)allArguments[1];
        for (InetSocketAddress inetSocketAddress : inetSocketAddressList) {
            String host = inetSocketAddress.getAddress().getHostAddress();
            int port = inetSocketAddress.getPort();
            memcachConnInfo.append(host + ":" + port).append(";");
        }
        objInst.setSkyWalkingDynamicField(memcachConnInfo.toString());
    }
}
 No newline at end of file
Loading