Commit a4619318 authored by 吴晟's avatar 吴晟
Browse files

Remove collector dependency from agent-module. We will use...

Remove collector dependency from agent-module. We will use HTTP-restful-service. Remove unnecessary dependencies/shades on collector and agent sides. Fix CI issue.
parent c4340859
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -53,30 +53,6 @@
		<scala.compiler.version>2.11.7</scala.compiler.version>
		<powermock.version>1.6.4</powermock.version>
		<docker.plugin.version>0.4.13</docker.plugin.version>

        <shade.package>com.a.eye.skywalking.dependencies</shade.package>
        <shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
        <shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>
        <shade.com.lmax.disruptor.source>com.lmax.disruptor</shade.com.lmax.disruptor.source>
        <shade.com.lmax.disruptor.target>${shade.package}.${shade.com.lmax.disruptor.source}</shade.com.lmax.disruptor.target>
        <shade.akka.source>akka</shade.akka.source>
        <shade.akka.target>${shade.package}.${shade.akka.source}</shade.akka.target>
        <shade.scala.source>scala</shade.scala.source>
        <shade.scala.target>${shade.package}.${shade.scala.source}</shade.scala.target>
        <shade.org.agrona.source>org.agrona</shade.org.agrona.source>
        <shade.org.agrona.target>${shade.package}.${shade.org.agrona.source}</shade.org.agrona.target>
        <shade.org.jboss.netty.source>org.jboss.netty</shade.org.jboss.netty.source>
        <shade.org.jboss.netty.target>${shade.package}.${shade.org.jboss.netty.source}</shade.org.jboss.netty.target>
        <shade.org.reactivestreams.source>org.reactivestreams</shade.org.reactivestreams.source>
        <shade.org.reactivestreams.target>${shade.package}.${shade.org.reactivestreams.source}</shade.org.reactivestreams.target>
        <shade.org.uncommons.maths.source>org.uncommons.maths</shade.org.uncommons.maths.source>
        <shade.org.uncommons.maths.target>${shade.package}.${shade.org.uncommons.maths.source}</shade.org.uncommons.maths.target>
        <shade.com.google.source>com.google</shade.com.google.source>
        <shade.com.google.target>${shade.package}.${shade.com.google.source}</shade.com.google.target>
        <shade.io.aeron.source>io.aeron</shade.io.aeron.source>
        <shade.io.aeron.target>${shade.package}.${shade.io.aeron.source}</shade.io.aeron.target>
        <shade.com.typesafe.source>com.typesafe</shade.com.typesafe.source>
        <shade.com.typesafe.target>${shade.package}.${shade.com.typesafe.source}</shade.com.typesafe.target>
	</properties>

    <dependencies>
+0 −31
Original line number Diff line number Diff line
@@ -45,35 +45,4 @@
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <relocations>
                                <relocation>
                                    <pattern>${shade.akka.source}</pattern>
                                    <shadedPattern>${shade.akka.target}</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
+8 −32
Original line number Diff line number Diff line
@@ -17,6 +17,14 @@
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <premain.class>com.a.eye.skywalking.agent.SkyWalkingAgent</premain.class>

        <shade.package>com.a.eye.skywalking.dependencies</shade.package>
        <shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
        <shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>
        <shade.com.lmax.disruptor.source>com.lmax.disruptor</shade.com.lmax.disruptor.source>
        <shade.com.lmax.disruptor.target>${shade.package}.${shade.com.lmax.disruptor.source}</shade.com.lmax.disruptor.target>
        <shade.com.google.source>com.google</shade.com.google.source>
        <shade.com.google.target>${shade.package}.${shade.com.google.source}</shade.com.google.target>
    </properties>

    <dependencies>
@@ -121,42 +129,10 @@
                                    <pattern>${shade.com.lmax.disruptor.source}</pattern>
                                    <shadedPattern>${shade.com.lmax.disruptor.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.akka.source}</pattern>
                                    <shadedPattern>${shade.akka.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.com.google.source}</pattern>
                                    <shadedPattern>${shade.com.google.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.org.agrona.source}</pattern>
                                    <shadedPattern>${shade.org.agrona.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.org.jboss.netty.source}</pattern>
                                    <shadedPattern>${shade.org.jboss.netty.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.org.reactivestreams.source}</pattern>
                                    <shadedPattern>${shade.org.reactivestreams.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.org.uncommons.maths.source}</pattern>
                                    <shadedPattern>${shade.org.uncommons.maths.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.scala.source}</pattern>
                                    <shadedPattern>${shade.scala.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.io.aeron.source}</pattern>
                                    <shadedPattern>${shade.io.aeron.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.com.typesafe.source}</pattern>
                                    <shadedPattern>${shade.com.typesafe.target}</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
+0 −5
Original line number Diff line number Diff line
@@ -30,11 +30,6 @@
            <artifactId>skywalking-logging-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-collector-commons</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
+0 −16
Original line number Diff line number Diff line
@@ -3,15 +3,9 @@ package com.a.eye.skywalking.api.client;
import com.a.eye.skywalking.api.boot.ServiceManager;
import com.a.eye.skywalking.api.boot.StatusBootService;
import com.a.eye.skywalking.api.queue.TraceSegmentProcessQueue;
import com.a.eye.skywalking.collector.CollectorSystem;
import com.a.eye.skywalking.collector.actor.LookUp;
import com.a.eye.skywalking.collector.actor.WorkerNotFoundException;
import com.a.eye.skywalking.collector.actor.WorkerRefs;
import com.a.eye.skywalking.collector.commons.role.TraceSegmentReceiverRole;
import com.a.eye.skywalking.logging.ILog;
import com.a.eye.skywalking.logging.LogManager;
import com.a.eye.skywalking.trace.TraceSegment;

import java.util.List;

/**
@@ -20,7 +14,6 @@ import java.util.List;
public class CollectorClientService extends StatusBootService implements Runnable {
    private static ILog logger = LogManager.getLogger(CollectorClientService.class);
    private static long SLEEP_TIME_MILLIS = 500;
    private LookUp clusterContext;

    /**
     * Start a new {@link Thread} to get finished {@link TraceSegment} by {@link TraceSegmentProcessQueue#getCachedTraceSegments()}
@@ -29,9 +22,6 @@ public class CollectorClientService extends StatusBootService implements Runnabl
    protected void bootUpWithStatus() throws Exception {
        Thread collectorClientThread = new Thread(this, "collectorClientThread");
        collectorClientThread.start();
        CollectorSystem collectorSystem = new CollectorSystem();
        collectorSystem.boot();
        clusterContext = collectorSystem.getClusterContext();
    }

    @Override
@@ -43,18 +33,12 @@ public class CollectorClientService extends StatusBootService implements Runnabl
                List<TraceSegment> cachedTraceSegments = segmentProcessQueue.getCachedTraceSegments();
                if (cachedTraceSegments.size() > 0) {
                    for (TraceSegment segment : cachedTraceSegments) {
                        try {
                            WorkerRefs workerRefs = clusterContext.lookup(TraceSegmentReceiverRole.INSTANCE);
                            workerRefs.tell(segment);
                        } catch (WorkerNotFoundException t) {
                            logger.error(t, "Role={} not found.", TraceSegmentReceiverRole.INSTANCE.roleName());
                            /**
                             * No receiver found, means collector server is off-line.
                             */
                            sleepTime = SLEEP_TIME_MILLIS * 10;
                            break;
                    }
                    }
                } else {
                    sleepTime = SLEEP_TIME_MILLIS;
                }
Loading