solve compile error
This commit is contained in:
parent
2fa75f9bb5
commit
db1af49366
|
|
@ -45,16 +45,15 @@
|
|||
<version>0.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-logging-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-logging-impl-log4j2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.typesafe.akka</groupId>
|
||||
<artifactId>akka-testkit_2.11</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.collector.cluster;
|
||||
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.util.ConfigInitializer;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
|
@ -21,7 +21,7 @@ import java.util.Properties;
|
|||
*/
|
||||
public class ClusterConfigInitializer {
|
||||
|
||||
private static ILog logger = LogManager.getLogger(ClusterConfigInitializer.class);
|
||||
private static Logger logger = LogManager.getFormatterLogger(ClusterConfigInitializer.class);
|
||||
|
||||
public static final String ConfigFileName = "collector.config";
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class ApplicationMember extends AbstractMember {
|
|||
String code = traceSegment.getApplicationCode();
|
||||
long startTime = -1;
|
||||
long endTime = -1;
|
||||
boolean isError = false;
|
||||
Boolean isError = false;
|
||||
|
||||
for (Span span : traceSegment.getSpans()) {
|
||||
if (span.getParentSpanId() == -1) {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ public class TraceSegmentReceiver extends AbstractWorker {
|
|||
|
||||
@Override
|
||||
public void preStart() throws Exception {
|
||||
ApplicationMember.Factory factory = new ApplicationMember.Factory();
|
||||
factory.createWorker(memberContext(), getSelf());
|
||||
new ApplicationMember.Factory().createWorker(memberContext(), getSelf());
|
||||
new ApplicationRefMember.Factory().createWorker(memberContext(), getSelf());
|
||||
super.preStart();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,16 @@ import com.a.eye.skywalking.trace.Span;
|
|||
|
||||
/**
|
||||
* Do the same thing as {@link StringTag}, just with a {@link Boolean} value.
|
||||
*
|
||||
* <p>
|
||||
* Created by wusheng on 2017/2/17.
|
||||
*/
|
||||
public class BooleanTag extends AbstractTag<Boolean> {
|
||||
public BooleanTag(String key) {
|
||||
|
||||
private boolean defaultValue;
|
||||
|
||||
public BooleanTag(String key, boolean defaultValue) {
|
||||
super(key);
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -28,9 +32,9 @@ public class BooleanTag extends AbstractTag<Boolean> {
|
|||
public Boolean get(Span span) {
|
||||
Object tagValue = span.getTag(super.key);
|
||||
if (tagValue == null) {
|
||||
return null;
|
||||
return defaultValue;
|
||||
} else if (tagValue instanceof Boolean) {
|
||||
return (Boolean)tagValue;
|
||||
return (Boolean) tagValue;
|
||||
} else {
|
||||
return Boolean.valueOf(tagValue.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.a.eye.skywalking.trace.Span;
|
|||
/**
|
||||
* The span tags are supported by sky-walking engine.
|
||||
* As default, all tags will be stored, but these ones have particular meanings.
|
||||
*
|
||||
* <p>
|
||||
* Created by wusheng on 2017/2/17.
|
||||
*/
|
||||
public final class Tags {
|
||||
|
|
@ -39,7 +39,7 @@ public final class Tags {
|
|||
|
||||
/**
|
||||
* SPAN_LAYER represents the kind of span.
|
||||
*
|
||||
* <p>
|
||||
* e.g.
|
||||
* db=database;
|
||||
* rpc=Remote Procedure Call Framework, like motan, thift;
|
||||
|
|
@ -91,7 +91,7 @@ public final class Tags {
|
|||
/**
|
||||
* ERROR indicates whether a Span ended in an error state.
|
||||
*/
|
||||
public static final BooleanTag ERROR = new BooleanTag("error");
|
||||
public static final BooleanTag ERROR = new BooleanTag("error", false);
|
||||
|
||||
/**
|
||||
* PEER_HOST records host address (ip:port, or ip1:port1,ip2:port2) of the peer, maybe IPV4, IPV6 or hostname.
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ThrowableFormatterTest {
|
||||
@Test
|
||||
public void testFormat(){
|
||||
public void testFormat() {
|
||||
NullPointerException exception = new NullPointerException();
|
||||
String formatLines = ThrowableFormatter.format(exception);
|
||||
String[] lines = formatLines.split("\n");
|
||||
String[] lines = formatLines.split(System.lineSeparator());
|
||||
Assert.assertEquals("java.lang.NullPointerException", lines[0]);
|
||||
Assert.assertEquals("\tat com.a.eye.skywalking.api.logging.ThrowableFormatterTest.testFormat(ThrowableFormatterTest.java:12)", lines[1]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue