提交 b6487399 编写于 作者: P pengys5

Merge branch 'feature/collector' of https://github.com/wu-sheng/sky-walking into feature/collector

......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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,17 +33,11 @@ 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;
......
......@@ -3,8 +3,6 @@ package com.a.eye.skywalking.api.conf;
public class Config {
public static class SkyWalking {
public static String USERNAME = "";
public static String APPLICATION_CODE = "";
public static boolean IS_PREMAIN_MODE = false;
......
......@@ -33,10 +33,6 @@ public class SnifferConfigInitializer {
}
}
String username = System.getProperty("username");
if (!StringUtil.isEmpty(username)) {
Config.SkyWalking.USERNAME = username;
}
String applicationCode = System.getProperty("applicationCode");
if (!StringUtil.isEmpty(applicationCode)) {
Config.SkyWalking.APPLICATION_CODE = applicationCode;
......@@ -46,9 +42,6 @@ public class SnifferConfigInitializer {
Config.SkyWalking.SERVERS = servers;
}
if (StringUtil.isEmpty(Config.SkyWalking.USERNAME)) {
throw new ExceptionInInitializerError("'-Dusername=' is missing.");
}
if (StringUtil.isEmpty(Config.SkyWalking.APPLICATION_CODE)) {
throw new ExceptionInInitializerError("'-DapplicationCode=' is missing.");
}
......
......@@ -14,7 +14,6 @@ public class SnifferConfigInitializerTest {
Config.SkyWalking.IS_PREMAIN_MODE = false;
SnifferConfigInitializer.initialize();
Assert.assertEquals("testUser", Config.SkyWalking.USERNAME);
Assert.assertEquals("crmApp", Config.SkyWalking.APPLICATION_CODE);
Assert.assertEquals("127.0.0.1:8080", Config.SkyWalking.SERVERS);
......
skywalking.username = testUser
skywalking.application_code = crmApp
skywalking.servers = 127.0.0.1:8080
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册