diff --git a/pom.xml b/pom.xml index 4d96b5330..fe246af79 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.a.eye skywalking - ${skywalking.version} + 2.1-2017 skywalking-commons diff --git a/skywalking-alarm/pom.xml b/skywalking-alarm/pom.xml index 4fe0c1d41..f464ada1d 100644 --- a/skywalking-alarm/pom.xml +++ b/skywalking-alarm/pom.xml @@ -4,7 +4,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 skywalking-alarm @@ -70,6 +70,11 @@ HikariCP 2.4.3 + + com.a.eye + skywalking-util + 2.1-2017 + skywalking-alarm @@ -110,7 +115,7 @@ ${project.basedir}/docker skywalking/skywalking-alarm - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmProcessServer.java b/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmProcessServer.java index 6a5d0b21a..82944600c 100644 --- a/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmProcessServer.java +++ b/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmProcessServer.java @@ -1,8 +1,8 @@ package com.a.eye.skywalking.alarm; -import com.a.eye.skywalking.alarm.conf.ConfigInitializer; import com.a.eye.skywalking.alarm.conf.Config; import com.a.eye.skywalking.alarm.util.ZKUtil; +import com.a.eye.skywalking.util.ConfigInitializer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/conf/ConfigInitializer.java b/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/conf/ConfigInitializer.java deleted file mode 100644 index e70030d78..000000000 --- a/skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/conf/ConfigInitializer.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.a.eye.skywalking.alarm.conf; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.LinkedList; -import java.util.Properties; -import java.util.logging.Logger; - -public class ConfigInitializer { - private static Logger logger = Logger.getLogger(ConfigInitializer.class.getName()); - - public static void initialize(Properties properties, Class rootConfigType) throws IllegalAccessException { - initNextLevel(properties, rootConfigType, new ConfigDesc()); - } - - private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws NumberFormatException, IllegalArgumentException, IllegalAccessException { - for (Field field : recentConfigType.getFields()) { - if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String configKey = (parentDesc + "." + - field.getName()).toLowerCase(); - String value = properties.getProperty(configKey); - if (value != null) { - if (field.getType().equals(int.class)) - field.set(null, Integer.valueOf(value)); - if (field.getType().equals(String.class)) - field.set(null, value); - if (field.getType().equals(long.class)) - field.set(null, Long.valueOf(value)); - if (field.getType().equals(boolean.class)) - field.set(null, Boolean.valueOf(value)); - } - } - } - for (Class innerConfiguration : recentConfigType.getClasses()) { - parentDesc.append(innerConfiguration.getSimpleName()); - initNextLevel(properties, innerConfiguration, parentDesc); - parentDesc.removeLastDesc(); - } - } -} - -class ConfigDesc { - private LinkedList descs = new LinkedList(); - - void append(String currentDesc) { - descs.addLast(currentDesc); - } - - void removeLastDesc() { - descs.removeLast(); - } - - @Override - public String toString() { - if (descs.size() == 0) { - return ""; - } - StringBuilder ret = new StringBuilder(descs.getFirst()); - boolean first = true; - for (String desc : descs) { - if (first) { - first = false; - continue; - } - ret.append(".").append(desc); - } - return ret.toString(); - } -} diff --git a/skywalking-application-toolkit/pom.xml b/skywalking-application-toolkit/pom.xml index c8b3e2d12..2fb8b4a9d 100644 --- a/skywalking-application-toolkit/pom.xml +++ b/skywalking-application-toolkit/pom.xml @@ -3,7 +3,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 skywalking-application-toolkit diff --git a/skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml b/skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml index c36240962..4b787880c 100644 --- a/skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml +++ b/skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml @@ -5,7 +5,7 @@ skywalking-application-toolkit com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-application-toolkit/skywalking-toolkit-log4j-2.x/pom.xml b/skywalking-application-toolkit/skywalking-toolkit-log4j-2.x/pom.xml index 7c9285bd4..8cb6d2f34 100644 --- a/skywalking-application-toolkit/skywalking-toolkit-log4j-2.x/pom.xml +++ b/skywalking-application-toolkit/skywalking-toolkit-log4j-2.x/pom.xml @@ -5,7 +5,7 @@ skywalking-application-toolkit com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-application-toolkit/skywalking-toolkit-logback-1.x/pom.xml b/skywalking-application-toolkit/skywalking-toolkit-logback-1.x/pom.xml index 5033dc7b2..0dd98155c 100644 --- a/skywalking-application-toolkit/skywalking-toolkit-logback-1.x/pom.xml +++ b/skywalking-application-toolkit/skywalking-toolkit-logback-1.x/pom.xml @@ -5,7 +5,7 @@ skywalking-application-toolkit com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-application-toolkit/skywalking-toolkit-opentracing/pom.xml b/skywalking-application-toolkit/skywalking-toolkit-opentracing/pom.xml index 4fbf75b13..be3ccede1 100644 --- a/skywalking-application-toolkit/skywalking-toolkit-opentracing/pom.xml +++ b/skywalking-application-toolkit/skywalking-toolkit-opentracing/pom.xml @@ -5,7 +5,7 @@ skywalking-application-toolkit com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-application-toolkit/skywalking-toolkit-trace-context/pom.xml b/skywalking-application-toolkit/skywalking-toolkit-trace-context/pom.xml index d82f4fd01..3a55bd23d 100644 --- a/skywalking-application-toolkit/skywalking-toolkit-trace-context/pom.xml +++ b/skywalking-application-toolkit/skywalking-toolkit-trace-context/pom.xml @@ -4,7 +4,7 @@ skywalking-application-toolkit com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/pom.xml b/skywalking-commons/pom.xml index ba7be8391..cd6b72216 100644 --- a/skywalking-commons/pom.xml +++ b/skywalking-commons/pom.xml @@ -3,7 +3,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/skywalking-health-report/pom.xml b/skywalking-commons/skywalking-health-report/pom.xml index ae9f52d68..f492fc0ba 100644 --- a/skywalking-commons/skywalking-health-report/pom.xml +++ b/skywalking-commons/skywalking-health-report/pom.xml @@ -3,7 +3,7 @@ skywalking-commons com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/skywalking-logging/pom.xml b/skywalking-commons/skywalking-logging/pom.xml index e1d154114..de6812c1e 100644 --- a/skywalking-commons/skywalking-logging/pom.xml +++ b/skywalking-commons/skywalking-logging/pom.xml @@ -3,7 +3,7 @@ skywalking-commons com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/skywalking-logging/skywalking-logging-api/pom.xml b/skywalking-commons/skywalking-logging/skywalking-logging-api/pom.xml index 3cc8b37c8..2c31de0b6 100644 --- a/skywalking-commons/skywalking-logging/skywalking-logging-api/pom.xml +++ b/skywalking-commons/skywalking-logging/skywalking-logging-api/pom.xml @@ -5,7 +5,7 @@ skywalking-logging com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/skywalking-logging/skywalking-logging-impl-log4j2/pom.xml b/skywalking-commons/skywalking-logging/skywalking-logging-impl-log4j2/pom.xml index 7d6496a45..f27ac70fa 100644 --- a/skywalking-commons/skywalking-logging/skywalking-logging-impl-log4j2/pom.xml +++ b/skywalking-commons/skywalking-logging/skywalking-logging-impl-log4j2/pom.xml @@ -5,7 +5,7 @@ skywalking-logging com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-commons/skywalking-registry/pom.xml b/skywalking-commons/skywalking-registry/pom.xml index 3d2a86893..8d9af050c 100644 --- a/skywalking-commons/skywalking-registry/pom.xml +++ b/skywalking-commons/skywalking-registry/pom.xml @@ -3,7 +3,7 @@ skywalking-commons com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -21,7 +21,7 @@ com.a.eye skywalking-logging-api - ${skywalking.version} + 2.1-2017 org.apache.zookeeper diff --git a/skywalking-commons/skywalking-util/pom.xml b/skywalking-commons/skywalking-util/pom.xml index a87b64307..301ef1d81 100644 --- a/skywalking-commons/skywalking-util/pom.xml +++ b/skywalking-commons/skywalking-util/pom.xml @@ -3,7 +3,7 @@ skywalking-commons com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -21,7 +21,7 @@ com.a.eye skywalking-network - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/config/ConfigInitializer.java b/skywalking-commons/skywalking-util/src/main/java/com/a/eye/skywalking/util/ConfigInitializer.java similarity index 85% rename from skywalking-webui/src/main/java/com/a/eye/skywalking/web/config/ConfigInitializer.java rename to skywalking-commons/skywalking-util/src/main/java/com/a/eye/skywalking/util/ConfigInitializer.java index 53c6e7b11..b43907e62 100644 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/config/ConfigInitializer.java +++ b/skywalking-commons/skywalking-util/src/main/java/com/a/eye/skywalking/util/ConfigInitializer.java @@ -1,4 +1,4 @@ -package com.a.eye.skywalking.web.config; +package com.a.eye.skywalking.util; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -6,6 +6,12 @@ import java.util.LinkedList; import java.util.Properties; import java.util.logging.Logger; +/** + * Init a class's static fields by a {@link Properties}, + * including static fields and static inner classes. + *

+ * Created by wusheng on 2017/1/9. + */ public class ConfigInitializer { private static Logger logger = Logger.getLogger(ConfigInitializer.class.getName()); @@ -13,11 +19,10 @@ public class ConfigInitializer { initNextLevel(properties, rootConfigType, new ConfigDesc()); } - private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws NumberFormatException, IllegalArgumentException, IllegalAccessException { + private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws IllegalArgumentException, IllegalAccessException { for (Field field : recentConfigType.getFields()) { if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String configKey = (parentDesc + "." + - field.getName()).toLowerCase(); + String configKey = (parentDesc + "." + field.getName()).toLowerCase(); String value = properties.getProperty(configKey); if (value != null) { if (field.getType().equals(int.class)) diff --git a/skywalking-sniffer/pom.xml b/skywalking-sniffer/pom.xml index dcfd4e1c9..28b9cec3a 100644 --- a/skywalking-sniffer/pom.xml +++ b/skywalking-sniffer/pom.xml @@ -5,7 +5,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -27,7 +27,7 @@ com.a.eye skywalking-util - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-sniffer/skywalking-agent/dependency-reduced-pom.xml b/skywalking-sniffer/skywalking-agent/dependency-reduced-pom.xml index e54bf1c87..6bae01f06 100644 --- a/skywalking-sniffer/skywalking-agent/dependency-reduced-pom.xml +++ b/skywalking-sniffer/skywalking-agent/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ skywalking-sniffer com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 skywalking-agent diff --git a/skywalking-sniffer/skywalking-agent/pom.xml b/skywalking-sniffer/skywalking-agent/pom.xml index e7310007f..170d8db8d 100644 --- a/skywalking-sniffer/skywalking-agent/pom.xml +++ b/skywalking-sniffer/skywalking-agent/pom.xml @@ -5,7 +5,7 @@ com.a.eye skywalking-sniffer - ${skywalking.version} + 2.1-2017 skywalking-agent @@ -30,56 +30,56 @@ com.a.eye skywalking-jedis-2.x-plugin - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-jdbc-plugin - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-httpClient-4.x-plugin - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-dubbo-plugin - ${skywalking.version} + 2.1-2017 com.a.eye tomcat-7.x-8.x-plugin - ${skywalking.version} + 2.1-2017 com.a.eye motan-plugin - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-toolkit-log4j-1.x-activation - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-toolkit-log4j-2.x-activation - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-toolkit-logback-1.x-activation - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-toolkit-trace-context-activation - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java b/skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java index 502fd5313..df3cf091e 100644 --- a/skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java +++ b/skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java @@ -2,7 +2,7 @@ package com.a.eye.skywalking.agent; import com.a.eye.skywalking.agent.junction.SkyWalkingEnhanceMatcher; import com.a.eye.skywalking.conf.Config; -import com.a.eye.skywalking.conf.ConfigInitializer; +import com.a.eye.skywalking.conf.SnifferConfigInitializer; import com.a.eye.skywalking.logging.EasyLogResolver; import com.a.eye.skywalking.logging.api.ILog; import com.a.eye.skywalking.logging.api.LogManager; @@ -98,7 +98,7 @@ public class SkyWalkingAgent { Config.SkyWalking.IS_PREMAIN_MODE = true; Config.SkyWalking.AGENT_BASE_PATH = initAgentBasePath(); - ConfigInitializer.initialize(); + SnifferConfigInitializer.initialize(); } /** diff --git a/skywalking-sniffer/skywalking-api/pom.xml b/skywalking-sniffer/skywalking-api/pom.xml index 435ddce4e..6d59dc74c 100644 --- a/skywalking-sniffer/skywalking-api/pom.xml +++ b/skywalking-sniffer/skywalking-api/pom.xml @@ -5,7 +5,7 @@ com.a.eye skywalking-sniffer - ${skywalking.version} + 2.1-2017 @@ -29,7 +29,7 @@ com.a.eye skywalking-network - ${skywalking.version} + 2.1-2017 com.lmax diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/ConfigInitializer.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/ConfigInitializer.java deleted file mode 100644 index 8a3d5dbb0..000000000 --- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/ConfigInitializer.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.a.eye.skywalking.conf; - -import com.a.eye.skywalking.logging.api.ILog; -import com.a.eye.skywalking.logging.api.LogManager; -import com.a.eye.skywalking.util.StringUtil; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.LinkedList; -import java.util.Properties; - -public class ConfigInitializer { - private static ILog logger = LogManager.getLogger(ConfigInitializer.class); - - public static void initialize() { - InputStream configFileStream; - if (Config.SkyWalking.IS_PREMAIN_MODE) { - configFileStream = fetchAuthFileInputStream(); - } else { - configFileStream = ConfigInitializer.class.getResourceAsStream("/sky-walking.config"); - } - - if (configFileStream == null) { - logger.info("Not provide sky-walking certification documents, sky-walking api run in default config."); - } else { - try { - Properties properties = new Properties(); - properties.load(configFileStream); - initNextLevel(properties, Config.class, new ConfigDesc()); - } catch (Exception e) { - logger.error("Failed to read the config file, sky-walking api run in default config.", e); - } - } - Config.SkyWalking.USERNAME = System.getProperty("username"); - Config.SkyWalking.APPLICATION_CODE = System.getProperty("applicationCode"); - Config.SkyWalking.SERVERS = System.getProperty("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."); - } - if(StringUtil.isEmpty(Config.SkyWalking.SERVERS)){ - throw new ExceptionInInitializerError("'-Dservers=' is missing."); - } - } - - private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws NumberFormatException, IllegalArgumentException, IllegalAccessException { - for (Field field : recentConfigType.getFields()) { - if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String configKey = (parentDesc + "." + - field.getName()).toLowerCase(); - String value = properties.getProperty(configKey); - if (value != null) { - if (field.getType().equals(int.class)) - field.set(null, Integer.valueOf(value)); - if (field.getType().equals(String.class)) - field.set(null, value); - if (field.getType().equals(long.class)) - field.set(null, Long.valueOf(value)); - if (field.getType().equals(boolean.class)) - field.set(null, Boolean.valueOf(value)); - } - } - } - for (Class innerConfiguration : recentConfigType.getClasses()) { - parentDesc.append(innerConfiguration.getSimpleName()); - initNextLevel(properties, innerConfiguration, parentDesc); - parentDesc.removeLastDesc(); - } - } - - private static InputStream fetchAuthFileInputStream() { - try { - return new FileInputStream(Config.SkyWalking.AGENT_BASE_PATH + File.separator + "/sky-walking.config"); - } catch (Exception e) { - logger.warn("sky-walking.config is missing, use default config."); - return null; - } - } -} - -class ConfigDesc { - private LinkedList descs = new LinkedList(); - - void append(String currentDesc) { - descs.addLast(currentDesc); - } - - void removeLastDesc() { - descs.removeLast(); - } - - @Override - public String toString() { - if (descs.size() == 0) { - return ""; - } - StringBuilder ret = new StringBuilder(descs.getFirst()); - boolean first = true; - for (String desc : descs) { - if (first) { - first = false; - continue; - } - ret.append(".").append(desc); - } - return ret.toString(); - } -} diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/SnifferConfigInitializer.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/SnifferConfigInitializer.java new file mode 100644 index 000000000..1a04b78bf --- /dev/null +++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/conf/SnifferConfigInitializer.java @@ -0,0 +1,58 @@ +package com.a.eye.skywalking.conf; + +import com.a.eye.skywalking.logging.api.ILog; +import com.a.eye.skywalking.logging.api.LogManager; +import com.a.eye.skywalking.util.ConfigInitializer; +import com.a.eye.skywalking.util.StringUtil; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.Properties; + +public class SnifferConfigInitializer { + private static ILog logger = LogManager.getLogger(SnifferConfigInitializer.class); + + public static void initialize() { + InputStream configFileStream; + if (Config.SkyWalking.IS_PREMAIN_MODE) { + configFileStream = fetchAuthFileInputStream(); + } else { + configFileStream = SnifferConfigInitializer.class.getResourceAsStream("/sky-walking.config"); + } + + if (configFileStream == null) { + logger.info("Not provide sky-walking certification documents, sky-walking api run in default config."); + } else { + try { + Properties properties = new Properties(); + properties.load(configFileStream); + ConfigInitializer.initialize(properties, Config.class); + } catch (Exception e) { + logger.error("Failed to read the config file, sky-walking api run in default config.", e); + } + } + Config.SkyWalking.USERNAME = System.getProperty("username"); + Config.SkyWalking.APPLICATION_CODE = System.getProperty("applicationCode"); + Config.SkyWalking.SERVERS = System.getProperty("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."); + } + if(StringUtil.isEmpty(Config.SkyWalking.SERVERS)){ + throw new ExceptionInInitializerError("'-Dservers=' is missing."); + } + } + + private static InputStream fetchAuthFileInputStream() { + try { + return new FileInputStream(Config.SkyWalking.AGENT_BASE_PATH + File.separator + "/sky-walking.config"); + } catch (Exception e) { + logger.warn("sky-walking.config is missing, use default config."); + return null; + } + } +} diff --git a/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/pom.xml index 7ac8dc215..e14b6b36c 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/pom.xml @@ -3,7 +3,7 @@ skywalking-sdk-plugin com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -21,7 +21,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 org.springframework diff --git a/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/pom.xml index 480a1e36e..af08523cd 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/pom.xml @@ -6,7 +6,7 @@ com.a.eye skywalking-sdk-plugin - ${skywalking.version} + 2.1-2017 skywalking-httpClient-4.x-plugin @@ -23,7 +23,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/pom.xml index 4efd64cec..e7a60bc53 100755 --- a/skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/pom.xml @@ -3,7 +3,7 @@ skywalking-sdk-plugin com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -21,7 +21,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 mysql diff --git a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml index da839ed23..8f74a869c 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml @@ -6,7 +6,7 @@ com.a.eye skywalking-sdk-plugin - ${skywalking.version} + 2.1-2017 skywalking-jedis-2.x-plugin diff --git a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/pom.xml index 27df74a5a..9d5f137ae 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/pom.xml @@ -3,7 +3,7 @@ skywalking-sdk-plugin com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-sdk-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/pom.xml index a44831ff9..529e928b8 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/pom.xml @@ -6,7 +6,7 @@ com.a.eye skywalking-sniffer - ${skywalking.version} + 2.1-2017 skywalking-sdk-plugin @@ -31,7 +31,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml b/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml index 8ef04d757..c24c9ed50 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml +++ b/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml @@ -3,7 +3,7 @@ skywalking-sdk-plugin com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/pom.xml index f1b808e8e..a11af214e 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/pom.xml @@ -5,7 +5,7 @@ skywalking-sniffer com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 pom @@ -23,7 +23,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml index 917461cf0..c7f98f575 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml @@ -5,7 +5,7 @@ skywalking-toolkit-activation com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/pom.xml index 497231a04..968158f3e 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/pom.xml @@ -5,7 +5,7 @@ skywalking-toolkit-activation com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/pom.xml index 92bcf8a8b..66fcb6349 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/pom.xml @@ -5,7 +5,7 @@ skywalking-toolkit-activation com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-opentracing-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-opentracing-activation/pom.xml index 531f15c9b..82e2ecab0 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-opentracing-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-opentracing-activation/pom.xml @@ -5,7 +5,7 @@ skywalking-toolkit-activation com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml index a01200d8f..3a25d2bf2 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml @@ -4,7 +4,7 @@ skywalking-toolkit-activation com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -16,7 +16,7 @@ com.a.eye skywalking-api - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-storage-center/pom.xml b/skywalking-storage-center/pom.xml index 626f62b70..975b0d363 100644 --- a/skywalking-storage-center/pom.xml +++ b/skywalking-storage-center/pom.xml @@ -5,7 +5,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -22,7 +22,7 @@ com.a.eye skywalking-network - ${skywalking.version} + 2.1-2017 com.lmax @@ -32,17 +32,17 @@ com.a.eye skywalking-registry - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-logging-impl-log4j2 - ${skywalking.version} + 2.1-2017 com.a.eye skywalking-health-report - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-storage-center/skywalking-routing/pom.xml b/skywalking-storage-center/skywalking-routing/pom.xml index a16582fd7..5dbbb35c2 100644 --- a/skywalking-storage-center/skywalking-routing/pom.xml +++ b/skywalking-storage-center/skywalking-routing/pom.xml @@ -4,7 +4,7 @@ skywalking-storage-center com.a.eye - ${skywalking.version} + 2.1-2017 4.0.0 @@ -28,7 +28,7 @@ com.a.eye skywalking-util - ${skywalking.version} + 2.1-2017 @@ -74,7 +74,7 @@ ${project.basedir}/docker skywalking/skywalking-routing - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/Main.java b/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/Main.java index 61567750d..405e1bb53 100644 --- a/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/Main.java +++ b/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/Main.java @@ -9,15 +9,25 @@ import com.a.eye.skywalking.registry.api.RegistryCenter; import com.a.eye.skywalking.registry.assist.NetUtils; import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig; import com.a.eye.skywalking.routing.config.Config; -import com.a.eye.skywalking.routing.config.ConfigInitializer; import com.a.eye.skywalking.routing.listener.SpanStorageListenerImpl; import com.a.eye.skywalking.routing.listener.TraceSearchListenerImpl; import com.a.eye.skywalking.routing.router.RoutingService; +import com.a.eye.skywalking.util.ConfigInitializer; import java.io.IOException; import java.util.Map; import java.util.Properties; +/** + * Main Class of the routing server. + * It starts server in a sequence: + * 1. init config + * 2. init logManager + * 3. registry server + * 4. open service, and start listening port. + * + * @author wusheng + */ public class Main { private static final ILog logger = LogManager.getLogger(Main.class); diff --git a/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/config/ConfigInitializer.java b/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/config/ConfigInitializer.java deleted file mode 100644 index 4a505dfb0..000000000 --- a/skywalking-storage-center/skywalking-routing/src/main/java/com/a/eye/skywalking/routing/config/ConfigInitializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.a.eye.skywalking.routing.config; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.LinkedList; -import java.util.Properties; -import java.util.logging.Logger; - -public class ConfigInitializer { - private static Logger logger = Logger.getLogger(ConfigInitializer.class.getName()); - - public static void initialize(Properties properties, Class rootConfigType) throws IllegalAccessException { - initNextLevel(properties, rootConfigType, new ConfigDesc()); - } - - private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws NumberFormatException, IllegalArgumentException, IllegalAccessException { - for (Field field : recentConfigType.getFields()) { - if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String configKey = (parentDesc + "." + - field.getName()).toLowerCase(); - String value = properties.getProperty(configKey); - if (value != null) { - if (field.getType().equals(int.class)) - field.set(null, Integer.valueOf(value)); - if (field.getType().equals(String.class)) - field.set(null, value); - if (field.getType().equals(long.class)) - field.set(null, Long.valueOf(value)); - if (field.getType().equals(boolean.class)) - field.set(null, Boolean.valueOf(value)); - } - } - } - for (Class innerConfiguration : recentConfigType.getClasses()) { - parentDesc.append(innerConfiguration.getSimpleName()); - initNextLevel(properties, innerConfiguration, parentDesc); - parentDesc.removeLastDesc(); - } - } -} - - -class ConfigDesc { - private LinkedList descs = new LinkedList(); - - void append(String currentDesc) { - descs.addLast(currentDesc); - } - - void removeLastDesc() { - descs.removeLast(); - } - - @Override - public String toString() { - if (descs.size() == 0) { - return ""; - } - StringBuilder ret = new StringBuilder(descs.getFirst()); - boolean first = true; - for (String desc : descs) { - if (first) { - first = false; - continue; - } - ret.append(".").append(desc); - } - return ret.toString(); - } -} diff --git a/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_24_02_220_1000 b/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_24_02_220_1000 new file mode 100644 index 000000000..bf032887c --- /dev/null +++ b/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_24_02_220_1000 @@ -0,0 +1,4 @@ +2 + +username_612 +application_code_9app \ No newline at end of file diff --git a/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_27_09_291_1000 b/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_27_09_291_1000 new file mode 100644 index 000000000..bf032887c --- /dev/null +++ b/skywalking-storage-center/skywalking-storage/null/data/file/2017_01_09_15_27_09_291_1000 @@ -0,0 +1,4 @@ +2 + +username_612 +application_code_9app \ No newline at end of file diff --git a/skywalking-storage-center/skywalking-storage/pom.xml b/skywalking-storage-center/skywalking-storage/pom.xml index 4f21f4a62..ad0d79171 100644 --- a/skywalking-storage-center/skywalking-storage/pom.xml +++ b/skywalking-storage-center/skywalking-storage/pom.xml @@ -5,7 +5,7 @@ skywalking-storage-center com.a.eye - ${skywalking.version} + 2.1-2017 skywalking-storage @@ -36,7 +36,7 @@ com.a.eye skywalking-util - ${skywalking.version} + 2.1-2017 @@ -116,7 +116,7 @@ ${project.basedir}/docker skywalking/skywalking-storage - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java index 9225e5e6d..7d96fa2d8 100644 --- a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java +++ b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java @@ -8,17 +8,16 @@ import com.a.eye.skywalking.network.Server; import com.a.eye.skywalking.registry.RegistryCenterFactory; import com.a.eye.skywalking.registry.api.CenterType; import com.a.eye.skywalking.registry.api.RegistryCenter; +import com.a.eye.skywalking.registry.assist.NetUtils; import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig; import com.a.eye.skywalking.storage.boot.ElasticBootstrap; import com.a.eye.skywalking.storage.config.Config; -import com.a.eye.skywalking.storage.config.ConfigInitializer; import com.a.eye.skywalking.storage.data.file.DataFilesManager; import com.a.eye.skywalking.storage.data.index.IndexOperatorFactory; import com.a.eye.skywalking.storage.listener.SearchListener; import com.a.eye.skywalking.storage.listener.StorageListener; -import com.a.eye.skywalking.registry.assist.NetUtils; +import com.a.eye.skywalking.util.ConfigInitializer; -import java.io.File; import java.io.IOException; import java.util.Map; import java.util.Properties; diff --git a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/ConfigInitializer.java b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/ConfigInitializer.java deleted file mode 100644 index 1a5ea4ad0..000000000 --- a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/ConfigInitializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.a.eye.skywalking.storage.config; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.LinkedList; -import java.util.Properties; -import java.util.logging.Logger; - -public class ConfigInitializer { - private static Logger logger = Logger.getLogger(ConfigInitializer.class.getName()); - - public static void initialize(Properties properties, Class rootConfigType) throws IllegalAccessException { - initNextLevel(properties, rootConfigType, new ConfigDesc()); - } - - private static void initNextLevel(Properties properties, Class recentConfigType, ConfigDesc parentDesc) throws NumberFormatException, IllegalArgumentException, IllegalAccessException { - for (Field field : recentConfigType.getFields()) { - if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String configKey = (parentDesc + "." + - field.getName()).toLowerCase(); - String value = properties.getProperty(configKey); - if (value != null) { - if (field.getType().equals(int.class)) - field.set(null, Integer.valueOf(value)); - if (field.getType().equals(String.class)) - field.set(null, value); - if (field.getType().equals(long.class)) - field.set(null, Long.valueOf(value)); - if (field.getType().equals(boolean.class)) - field.set(null, Boolean.valueOf(value)); - } - } - } - for (Class innerConfiguration : recentConfigType.getClasses()) { - parentDesc.append(innerConfiguration.getSimpleName()); - initNextLevel(properties, innerConfiguration, parentDesc); - parentDesc.removeLastDesc(); - } - } -} - - -class ConfigDesc { - private LinkedList descs = new LinkedList(); - - void append(String currentDesc) { - descs.addLast(currentDesc); - } - - void removeLastDesc() { - descs.removeLast(); - } - - @Override - public String toString() { - if (descs.size() == 0) { - return ""; - } - StringBuilder ret = new StringBuilder(descs.getFirst()); - boolean first = true; - for (String desc : descs) { - if (first) { - first = false; - continue; - } - ret.append(".").append(desc); - } - return ret.toString(); - } -} diff --git a/skywalking-webui/pom.xml b/skywalking-webui/pom.xml index 501d39254..d8f7f99b5 100644 --- a/skywalking-webui/pom.xml +++ b/skywalking-webui/pom.xml @@ -6,7 +6,7 @@ skywalking com.a.eye - ${skywalking.version} + 2.1-2017 skywalking-webui @@ -20,7 +20,7 @@ com.a.eye skywalking-network - ${skywalking.version} + 2.1-2017 com.a.eye @@ -111,7 +111,7 @@ com.a.eye skywalking-util - ${skywalking.version} + 2.1-2017 @@ -128,7 +128,7 @@ ${project.basedir}/docker skywalking/skywalking-webui - ${skywalking.version} + 2.1-2017 diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/SearchController.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/SearchController.java index f885b25f2..cd96df805 100644 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/SearchController.java +++ b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/SearchController.java @@ -3,11 +3,11 @@ package com.a.eye.skywalking.web.controller; import com.a.eye.skywalking.registry.RegistryCenterFactory; import com.a.eye.skywalking.registry.api.RegistryCenter; import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig; +import com.a.eye.skywalking.util.ConfigInitializer; import com.a.eye.skywalking.util.StringUtil; import com.a.eye.skywalking.web.client.routing.RoutingServerWatcher; import com.a.eye.skywalking.web.common.BaseController; import com.a.eye.skywalking.web.config.Config; -import com.a.eye.skywalking.web.config.ConfigInitializer; import com.a.eye.skywalking.web.dto.TraceTreeInfo; import com.a.eye.skywalking.web.service.inter.ITraceTreeService; import com.alibaba.fastjson.JSON;