diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/pom.xml b/apm-collector-3.2.3/apm-collector-agentjvm/pom.xml
deleted file mode 100644
index 1eaee624a89642a79964c931a301855fe21b1522..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-agentjvm
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-stream
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-cluster
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-server
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-storage
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java
deleted file mode 100644
index a4bb885baa67252ef5dcad3bf43a7aa924cda57d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.grpc.handler;
-
-import io.grpc.stub.StreamObserver;
-import java.util.List;
-import org.skywalking.apm.collector.agentjvm.worker.cpu.CpuMetricPersistenceWorker;
-import org.skywalking.apm.collector.agentjvm.worker.gc.GCMetricPersistenceWorker;
-import org.skywalking.apm.collector.agentjvm.worker.heartbeat.InstHeartBeatPersistenceWorker;
-import org.skywalking.apm.collector.agentjvm.worker.heartbeat.define.InstanceHeartBeatDataDefine;
-import org.skywalking.apm.collector.agentjvm.worker.memory.MemoryMetricPersistenceWorker;
-import org.skywalking.apm.collector.agentjvm.worker.memorypool.MemoryPoolMetricPersistenceWorker;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricDataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricDataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricDataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.network.proto.CPU;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.GC;
-import org.skywalking.apm.network.proto.JVMMetrics;
-import org.skywalking.apm.network.proto.JVMMetricsServiceGrpc;
-import org.skywalking.apm.network.proto.Memory;
-import org.skywalking.apm.network.proto.MemoryPool;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsServiceImplBase implements GRPCHandler {
-
- private final Logger logger = LoggerFactory.getLogger(JVMMetricsServiceHandler.class);
-
- @Override public void collect(JVMMetrics request, StreamObserver responseObserver) {
- int instanceId = request.getApplicationInstanceId();
- logger.debug("receive the jvm metric from application instance, id: {}", instanceId);
-
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- request.getMetricsList().forEach(metric -> {
- long time = TimeBucketUtils.INSTANCE.getSecondTimeBucket(metric.getTime());
- senToInstanceHeartBeatPersistenceWorker(context, instanceId, metric.getTime());
- sendToCpuMetricPersistenceWorker(context, instanceId, time, metric.getCpu());
- sendToMemoryMetricPersistenceWorker(context, instanceId, time, metric.getMemoryList());
- sendToMemoryPoolMetricPersistenceWorker(context, instanceId, time, metric.getMemoryPoolList());
- sendToGCMetricPersistenceWorker(context, instanceId, time, metric.getGcList());
- });
-
- responseObserver.onNext(Downstream.newBuilder().build());
- responseObserver.onCompleted();
- }
-
- private void senToInstanceHeartBeatPersistenceWorker(StreamModuleContext context, int instanceId,
- long heartBeatTime) {
- InstanceHeartBeatDataDefine.InstanceHeartBeat heartBeat = new InstanceHeartBeatDataDefine.InstanceHeartBeat();
- heartBeat.setId(String.valueOf(instanceId));
- heartBeat.setHeartBeatTime(TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartBeatTime));
- heartBeat.setInstanceId(instanceId);
- try {
- logger.debug("send to instance heart beat persistence worker, id: {}", heartBeat.getId());
- context.getClusterWorkerContext().lookup(InstHeartBeatPersistenceWorker.WorkerRole.INSTANCE).tell(heartBeat.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- private void sendToCpuMetricPersistenceWorker(StreamModuleContext context, int instanceId,
- long timeBucket, CPU cpu) {
- CpuMetricDataDefine.CpuMetric cpuMetric = new CpuMetricDataDefine.CpuMetric();
- cpuMetric.setId(timeBucket + Const.ID_SPLIT + instanceId);
- cpuMetric.setInstanceId(instanceId);
- cpuMetric.setUsagePercent(cpu.getUsagePercent());
- cpuMetric.setTimeBucket(timeBucket);
- try {
- logger.debug("send to cpu metric persistence worker, id: {}", cpuMetric.getId());
- context.getClusterWorkerContext().lookup(CpuMetricPersistenceWorker.WorkerRole.INSTANCE).tell(cpuMetric.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- private void sendToMemoryMetricPersistenceWorker(StreamModuleContext context, int instanceId,
- long timeBucket, List memories) {
-
- memories.forEach(memory -> {
- MemoryMetricDataDefine.MemoryMetric memoryMetric = new MemoryMetricDataDefine.MemoryMetric();
- memoryMetric.setId(timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + String.valueOf(memory.getIsHeap()));
- memoryMetric.setApplicationInstanceId(instanceId);
- memoryMetric.setHeap(memory.getIsHeap());
- memoryMetric.setInit(memory.getInit());
- memoryMetric.setMax(memory.getMax());
- memoryMetric.setUsed(memory.getUsed());
- memoryMetric.setCommitted(memory.getCommitted());
- memoryMetric.setTimeBucket(timeBucket);
- try {
- logger.debug("send to memory metric persistence worker, id: {}", memoryMetric.getId());
- context.getClusterWorkerContext().lookup(MemoryMetricPersistenceWorker.WorkerRole.INSTANCE).tell(memoryMetric.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- });
- }
-
- private void sendToMemoryPoolMetricPersistenceWorker(StreamModuleContext context, int instanceId,
- long timeBucket, List memoryPools) {
-
- memoryPools.forEach(memoryPool -> {
- MemoryPoolMetricDataDefine.MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetricDataDefine.MemoryPoolMetric();
- memoryPoolMetric.setId(timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + String.valueOf(memoryPool.getType().getNumber()));
- memoryPoolMetric.setInstanceId(instanceId);
- memoryPoolMetric.setPoolType(memoryPool.getType().getNumber());
- memoryPoolMetric.setInit(memoryPool.getInit());
- memoryPoolMetric.setMax(memoryPool.getMax());
- memoryPoolMetric.setUsed(memoryPool.getUsed());
- memoryPoolMetric.setCommitted(memoryPool.getCommited());
- memoryPoolMetric.setTimeBucket(timeBucket);
- try {
- logger.debug("send to memory pool metric persistence worker, id: {}", memoryPoolMetric.getId());
- context.getClusterWorkerContext().lookup(MemoryPoolMetricPersistenceWorker.WorkerRole.INSTANCE).tell(memoryPoolMetric.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- });
- }
-
- private void sendToGCMetricPersistenceWorker(StreamModuleContext context, int instanceId,
- long timeBucket, List gcs) {
- gcs.forEach(gc -> {
- GCMetricDataDefine.GCMetric gcMetric = new GCMetricDataDefine.GCMetric();
- gcMetric.setId(timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + String.valueOf(gc.getPhraseValue()));
- gcMetric.setInstanceId(instanceId);
- gcMetric.setPhrase(gc.getPhraseValue());
- gcMetric.setCount(gc.getCount());
- gcMetric.setTime(gc.getTime());
- gcMetric.setTimeBucket(timeBucket);
- try {
- logger.debug("send to gc metric persistence worker, id: {}", gcMetric.getId());
- context.getClusterWorkerContext().lookup(GCMetricPersistenceWorker.WorkerRole.INSTANCE).tell(gcMetric.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- });
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/CpuMetricPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/CpuMetricPersistenceWorker.java
deleted file mode 100644
index 305c5fa436ff2316d16f3f7ff2179b281a6c032c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/CpuMetricPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu;
-
-import org.skywalking.apm.collector.agentjvm.worker.cpu.dao.ICpuMetricDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricPersistenceWorker extends PersistenceWorker {
-
- public CpuMetricPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(ICpuMetricDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public CpuMetricPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new CpuMetricPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return CpuMetricPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new CpuMetricDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricEsDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricEsDAO.java
deleted file mode 100644
index bf885921517431336699091b50eeae246d3e55e1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricEsDAO.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricEsDAO extends EsDAO implements ICpuMetricDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(CpuMetricEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(CpuMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(CpuMetricTable.COLUMN_USAGE_PERCENT, data.getDataDouble(0));
- source.put(CpuMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- logger.debug("prepare cpu metric batch insert, id: {}", data.getDataString(0));
- return getClient().prepareIndex(CpuMetricTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricH2DAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricH2DAO.java
deleted file mode 100644
index afc8eec289f044243e1c7b73c51b4ebbac2ba144..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/CpuMetricH2DAO.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class CpuMetricH2DAO extends H2DAO implements ICpuMetricDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(CpuMetricH2DAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(CpuMetricTable.COLUMN_ID, data.getDataString(0));
- source.put(CpuMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(CpuMetricTable.COLUMN_USAGE_PERCENT, data.getDataDouble(0));
- source.put(CpuMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- logger.debug("prepare cpu metric batch insert, id: {}", data.getDataString(0));
- String sql = SqlBuilder.buildBatchInsertSql(CpuMetricTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/ICpuMetricDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/ICpuMetricDAO.java
deleted file mode 100644
index 03672b45045675179a26c73eddf59c21a7df07f1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/dao/ICpuMetricDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface ICpuMetricDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricEsTableDefine.java
deleted file mode 100644
index e401b8dd9ea8b7b0c649d1644b4a243c1aff023d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricEsTableDefine.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricEsTableDefine extends ElasticSearchTableDefine {
-
- public CpuMetricEsTableDefine() {
- super(CpuMetricTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 1;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(CpuMetricTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(CpuMetricTable.COLUMN_USAGE_PERCENT, ElasticSearchColumnDefine.Type.Double.name()));
- addColumn(new ElasticSearchColumnDefine(CpuMetricTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricH2TableDefine.java
deleted file mode 100644
index 5f41ea05bd3c40d680eb64159d6ca3fa5fad678c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/cpu/define/CpuMetricH2TableDefine.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.cpu.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.CpuMetricTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class CpuMetricH2TableDefine extends H2TableDefine {
-
- public CpuMetricH2TableDefine() {
- super(CpuMetricTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(CpuMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(CpuMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(CpuMetricTable.COLUMN_USAGE_PERCENT, H2ColumnDefine.Type.Double.name()));
- addColumn(new H2ColumnDefine(CpuMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/GCMetricPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/GCMetricPersistenceWorker.java
deleted file mode 100644
index e8171c0d728e7b6054aa37e8ea83f2d729b249a4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/GCMetricPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc;
-
-import org.skywalking.apm.collector.agentjvm.worker.gc.dao.IGCMetricDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricPersistenceWorker extends PersistenceWorker {
-
- public GCMetricPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IGCMetricDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public GCMetricPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new GCMetricPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return GCMetricPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new GCMetricDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricEsDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricEsDAO.java
deleted file mode 100644
index 063cd2216201a1debd3faea39db41d69f4951a41..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricEsDAO.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricEsDAO extends EsDAO implements IGCMetricDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(GCMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(GCMetricTable.COLUMN_PHRASE, data.getDataInteger(1));
- source.put(GCMetricTable.COLUMN_COUNT, data.getDataLong(0));
- source.put(GCMetricTable.COLUMN_TIME, data.getDataLong(1));
- source.put(GCMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(2));
-
- return getClient().prepareIndex(GCMetricTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricH2DAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricH2DAO.java
deleted file mode 100644
index e96576b5aee6f3f66ff3c62d1fa14b215c500161..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/GCMetricH2DAO.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class GCMetricH2DAO extends H2DAO implements IGCMetricDAO, IPersistenceDAO {
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(GCMetricTable.COLUMN_ID, data.getDataString(0));
- source.put(GCMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(GCMetricTable.COLUMN_PHRASE, data.getDataInteger(1));
- source.put(GCMetricTable.COLUMN_COUNT, data.getDataLong(0));
- source.put(GCMetricTable.COLUMN_TIME, data.getDataLong(1));
- source.put(GCMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(2));
-
- String sql = SqlBuilder.buildBatchInsertSql(GCMetricTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/IGCMetricDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/IGCMetricDAO.java
deleted file mode 100644
index 3a3f216e6316e80c854ac19d286cef999b04bcfa..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/dao/IGCMetricDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IGCMetricDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricEsTableDefine.java
deleted file mode 100644
index 002aceed2b1e0ddb3ae0b426b087c66de2543244..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricEsTableDefine.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricEsTableDefine extends ElasticSearchTableDefine {
-
- public GCMetricEsTableDefine() {
- super(GCMetricTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 1;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_PHRASE, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_COUNT, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricH2TableDefine.java
deleted file mode 100644
index de1d236d62bd3edf27717afb4d1226a856ec42fe..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/gc/define/GCMetricH2TableDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.gc.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.GCMetricTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class GCMetricH2TableDefine extends H2TableDefine {
-
- public GCMetricH2TableDefine() {
- super(GCMetricTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_PHRASE, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_COUNT, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/InstHeartBeatPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/InstHeartBeatPersistenceWorker.java
deleted file mode 100644
index 095c1e6bbefd89ed9ebe4cae536b7c0977351a91..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/InstHeartBeatPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.heartbeat;
-
-import org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao.IInstanceHeartBeatDAO;
-import org.skywalking.apm.collector.agentjvm.worker.heartbeat.define.InstanceHeartBeatDataDefine;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class InstHeartBeatPersistenceWorker extends PersistenceWorker {
-
- public InstHeartBeatPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IInstanceHeartBeatDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public InstHeartBeatPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new InstHeartBeatPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return InstHeartBeatPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new InstanceHeartBeatDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/IInstanceHeartBeatDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/IInstanceHeartBeatDAO.java
deleted file mode 100644
index 31603c96fc9a736819223ffd36274977e253d3e7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/IInstanceHeartBeatDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IInstanceHeartBeatDAO {
-}
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatEsDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatEsDAO.java
deleted file mode 100644
index 421e8d59e395aefcb153c1855cf879d214520834..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatEsDAO.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.framework.UnexpectedException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceHeartBeatEsDAO extends EsDAO implements IInstanceHeartBeatDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(InstanceTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, (Integer)source.get(InstanceTable.COLUMN_INSTANCE_ID));
- data.setDataLong(0, (Long)source.get(InstanceTable.COLUMN_HEARTBEAT_TIME));
- logger.debug("id: {} is exists", id);
- return data;
- } else {
- logger.debug("id: {} is not exists", id);
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, data.getDataLong(0));
- return getClient().prepareUpdate(InstanceTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatH2DAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatH2DAO.java
deleted file mode 100644
index 127ff72bc31e4e49d2b5f023c1261c08e8c70040..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/dao/InstanceHeartBeatH2DAO.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.framework.UnexpectedException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class InstanceHeartBeatH2DAO extends H2DAO implements IInstanceHeartBeatDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatEsDAO.class);
- private static final String GET_INSTANCE_HEARTBEAT_SQL = "select * from {0} where {1} = ?";
-
- @Override public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_INSTANCE_HEARTBEAT_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(InstanceTable.COLUMN_INSTANCE_ID));
- data.setDataLong(0, rs.getLong(InstanceTable.COLUMN_HEARTBEAT_TIME));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, data.getDataLong(0));
- String sql = SqlBuilder.buildBatchUpdateSql(InstanceTable.TABLE, source.keySet(), InstanceTable.COLUMN_INSTANCE_ID);
- entity.setSql(sql);
- List params = new ArrayList<>(source.values());
- params.add(data.getDataString(0));
- entity.setParams(params.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/define/InstanceHeartBeatDataDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/define/InstanceHeartBeatDataDefine.java
deleted file mode 100644
index decab66b234203034b67560de44e57102dbeb3e0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/heartbeat/define/InstanceHeartBeatDataDefine.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.heartbeat.define;
-
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.core.stream.Transform;
-import org.skywalking.apm.collector.core.stream.operate.CoverOperation;
-import org.skywalking.apm.collector.core.stream.operate.NonOperation;
-import org.skywalking.apm.collector.remote.grpc.proto.RemoteData;
-import org.skywalking.apm.collector.storage.base.define.Attribute;
-import org.skywalking.apm.collector.storage.base.define.AttributeType;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceHeartBeatDataDefine extends DataDefine {
-
- @Override protected int initialCapacity() {
- return 3;
- }
-
- @Override protected void attributeDefine() {
- addAttribute(0, new Attribute(InstanceTable.COLUMN_ID, AttributeType.STRING, new NonOperation()));
- addAttribute(1, new Attribute(InstanceTable.COLUMN_INSTANCE_ID, AttributeType.INTEGER, new CoverOperation()));
- addAttribute(2, new Attribute(InstanceTable.COLUMN_HEARTBEAT_TIME, AttributeType.LONG, new CoverOperation()));
- }
-
- @Override public Object deserialize(RemoteData remoteData) {
- String id = remoteData.getDataStrings(0);
- int instanceId = remoteData.getDataIntegers(0);
- long heartBeatTime = remoteData.getDataLongs(0);
- return new InstanceHeartBeat(id, heartBeatTime, instanceId);
- }
-
- @Override public RemoteData serialize(Object object) {
- InstanceHeartBeat instanceHeartBeat = (InstanceHeartBeat)object;
- RemoteData.Builder builder = RemoteData.newBuilder();
- builder.addDataStrings(instanceHeartBeat.getId());
- builder.addDataIntegers(instanceHeartBeat.getInstanceId());
- builder.addDataLongs(instanceHeartBeat.getHeartBeatTime());
- return builder.build();
- }
-
- public static class InstanceHeartBeat implements Transform {
- private String id;
- private long heartBeatTime;
- private int instanceId;
-
- public InstanceHeartBeat(String id, long heartBeatTime, int instanceId) {
- this.id = id;
- this.heartBeatTime = heartBeatTime;
- this.instanceId = instanceId;
- }
-
- public InstanceHeartBeat() {
- }
-
- @Override public Data toData() {
- InstanceHeartBeatDataDefine define = new InstanceHeartBeatDataDefine();
- Data data = define.build(id);
- data.setDataString(0, this.id);
- data.setDataInteger(0, this.instanceId);
- data.setDataLong(0, this.heartBeatTime);
- return data;
- }
-
- @Override public InstanceHeartBeat toSelf(Data data) {
- this.id = data.getDataString(0);
- this.instanceId = data.getDataInteger(0);
- this.heartBeatTime = data.getDataLong(0);
- return this;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public long getHeartBeatTime() {
- return heartBeatTime;
- }
-
- public void setHeartBeatTime(long heartBeatTime) {
- this.heartBeatTime = heartBeatTime;
- }
-
- public int getInstanceId() {
- return instanceId;
- }
-
- public void setInstanceId(int instanceId) {
- this.instanceId = instanceId;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/MemoryMetricPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/MemoryMetricPersistenceWorker.java
deleted file mode 100644
index 59a0b91c757e3a17a0db3979bed551615e3257d9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/MemoryMetricPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory;
-
-import org.skywalking.apm.collector.agentjvm.worker.memory.dao.IMemoryMetricDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricPersistenceWorker extends PersistenceWorker {
-
- public MemoryMetricPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IMemoryMetricDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public MemoryMetricPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new MemoryMetricPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return MemoryMetricPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new MemoryMetricDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/IMemoryMetricDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/IMemoryMetricDAO.java
deleted file mode 100644
index 5f422ceb07bbcc610a997b57cf6833d79e84f779..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/IMemoryMetricDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IMemoryMetricDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricEsDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricEsDAO.java
deleted file mode 100644
index ca335e4a64fb7fbde8efb06a56bd5ca596cd7fdd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricEsDAO.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricEsDAO extends EsDAO implements IMemoryMetricDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(MemoryMetricTable.COLUMN_APPLICATION_INSTANCE_ID, data.getDataInteger(0));
- source.put(MemoryMetricTable.COLUMN_IS_HEAP, data.getDataBoolean(0));
- source.put(MemoryMetricTable.COLUMN_INIT, data.getDataLong(0));
- source.put(MemoryMetricTable.COLUMN_MAX, data.getDataLong(1));
- source.put(MemoryMetricTable.COLUMN_USED, data.getDataLong(2));
- source.put(MemoryMetricTable.COLUMN_COMMITTED, data.getDataLong(3));
- source.put(MemoryMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(4));
-
- return getClient().prepareIndex(MemoryMetricTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricH2DAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricH2DAO.java
deleted file mode 100644
index 282a90279431a3ce0be2177ba0bdb1d0eb07c573..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/dao/MemoryMetricH2DAO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class MemoryMetricH2DAO extends H2DAO implements IMemoryMetricDAO, IPersistenceDAO {
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(MemoryMetricTable.COLUMN_ID, data.getDataString(0));
- source.put(MemoryMetricTable.COLUMN_APPLICATION_INSTANCE_ID, data.getDataInteger(0));
- source.put(MemoryMetricTable.COLUMN_IS_HEAP, data.getDataBoolean(0));
- source.put(MemoryMetricTable.COLUMN_INIT, data.getDataLong(0));
- source.put(MemoryMetricTable.COLUMN_MAX, data.getDataLong(1));
- source.put(MemoryMetricTable.COLUMN_USED, data.getDataLong(2));
- source.put(MemoryMetricTable.COLUMN_COMMITTED, data.getDataLong(3));
- source.put(MemoryMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(4));
-
- String sql = SqlBuilder.buildBatchInsertSql(MemoryMetricTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricEsTableDefine.java
deleted file mode 100644
index c5f095a5b7520881d7dc533123ef5796b31f7a3f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricEsTableDefine.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricEsTableDefine extends ElasticSearchTableDefine {
-
- public MemoryMetricEsTableDefine() {
- super(MemoryMetricTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 1;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_APPLICATION_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, ElasticSearchColumnDefine.Type.Boolean.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_INIT, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_MAX, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_USED, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_COMMITTED, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricH2TableDefine.java
deleted file mode 100644
index ff631cc6679f805017bc402fceeff4248f13c131..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memory/define/MemoryMetricH2TableDefine.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memory.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryMetricTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryMetricH2TableDefine extends H2TableDefine {
-
- public MemoryMetricH2TableDefine() {
- super(MemoryMetricTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_APPLICATION_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, H2ColumnDefine.Type.Boolean.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_INIT, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_MAX, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_USED, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_COMMITTED, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/MemoryPoolMetricPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/MemoryPoolMetricPersistenceWorker.java
deleted file mode 100644
index ca42adab82e7207724f277da8e66359bec60255e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/MemoryPoolMetricPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool;
-
-import org.skywalking.apm.collector.agentjvm.worker.memorypool.dao.IMemoryPoolMetricDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricPersistenceWorker extends PersistenceWorker {
-
- public MemoryPoolMetricPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IMemoryPoolMetricDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public MemoryPoolMetricPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new MemoryPoolMetricPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return MemoryPoolMetricPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new MemoryPoolMetricDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/IMemoryPoolMetricDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/IMemoryPoolMetricDAO.java
deleted file mode 100644
index 87c2d07f64b4e072082137845733df6316180027..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/IMemoryPoolMetricDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IMemoryPoolMetricDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java
deleted file mode 100644
index 243f7aa22f93f8ce2640a1a94cbc35d67857e034..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricEsDAO extends EsDAO implements IMemoryPoolMetricDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(MemoryPoolMetricTable.COLUMN_POOL_TYPE, data.getDataInteger(1));
- source.put(MemoryPoolMetricTable.COLUMN_INIT, data.getDataLong(0));
- source.put(MemoryPoolMetricTable.COLUMN_MAX, data.getDataLong(1));
- source.put(MemoryPoolMetricTable.COLUMN_USED, data.getDataLong(2));
- source.put(MemoryPoolMetricTable.COLUMN_COMMITTED, data.getDataLong(3));
- source.put(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(4));
-
- return getClient().prepareIndex(MemoryPoolMetricTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricH2DAO.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricH2DAO.java
deleted file mode 100644
index 7eeea4bec8b329b7c98a80655c28695faebdbde9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricH2DAO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class MemoryPoolMetricH2DAO extends H2DAO implements IMemoryPoolMetricDAO, IPersistenceDAO {
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(MemoryPoolMetricTable.COLUMN_ID, data.getDataString(0));
- source.put(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, data.getDataInteger(0));
- source.put(MemoryPoolMetricTable.COLUMN_POOL_TYPE, data.getDataInteger(1));
- source.put(MemoryPoolMetricTable.COLUMN_INIT, data.getDataLong(0));
- source.put(MemoryPoolMetricTable.COLUMN_MAX, data.getDataLong(1));
- source.put(MemoryPoolMetricTable.COLUMN_USED, data.getDataLong(2));
- source.put(MemoryPoolMetricTable.COLUMN_COMMITTED, data.getDataLong(3));
- source.put(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, data.getDataLong(4));
-
- String sql = SqlBuilder.buildBatchInsertSql(MemoryPoolMetricTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricEsTableDefine.java
deleted file mode 100644
index f98f82cd8a3716b440618b067dfdf69bc2a4180b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricEsTableDefine.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricEsTableDefine extends ElasticSearchTableDefine {
-
- public MemoryPoolMetricEsTableDefine() {
- super(MemoryPoolMetricTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 1;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_POOL_TYPE, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_INIT, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_MAX, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_USED, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_COMMITTED, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricH2TableDefine.java
deleted file mode 100644
index f7b9dc44d4915d4301bd59f6d855c438f5b8953b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricH2TableDefine.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.worker.memorypool.define;
-
-import org.skywalking.apm.collector.storage.base.define.jvm.MemoryPoolMetricTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryPoolMetricH2TableDefine extends H2TableDefine {
-
- public MemoryPoolMetricH2TableDefine() {
- super(MemoryPoolMetricTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_POOL_TYPE, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_INIT, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_MAX, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_USED, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_COMMITTED, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/es_dao.define b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/es_dao.define
deleted file mode 100644
index 13e6077c040e5a3cea870a4e2242a84108b7d340..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/es_dao.define
+++ /dev/null
@@ -1,5 +0,0 @@
-org.skywalking.apm.collector.agentjvm.worker.cpu.dao.CpuMetricEsDAO
-org.skywalking.apm.collector.agentjvm.worker.memory.dao.MemoryMetricEsDAO
-org.skywalking.apm.collector.agentjvm.worker.memorypool.dao.MemoryPoolMetricEsDAO
-org.skywalking.apm.collector.agentjvm.worker.gc.dao.GCMetricEsDAO
-org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao.InstanceHeartBeatEsDAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/h2_dao.define b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/h2_dao.define
deleted file mode 100644
index c6eb797fbdf71656535e9e794d3f1e677149c2af..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/h2_dao.define
+++ /dev/null
@@ -1,5 +0,0 @@
-org.skywalking.apm.collector.agentjvm.worker.cpu.dao.CpuMetricH2DAO
-org.skywalking.apm.collector.agentjvm.worker.memory.dao.MemoryMetricH2DAO
-org.skywalking.apm.collector.agentjvm.worker.memorypool.dao.MemoryPoolMetricH2DAO
-org.skywalking.apm.collector.agentjvm.worker.gc.dao.GCMetricH2DAO
-org.skywalking.apm.collector.agentjvm.worker.heartbeat.dao.InstanceHeartBeatH2DAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/local_worker_provider.define b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/local_worker_provider.define
deleted file mode 100644
index 6c21da7dbdc7181923b22fdf83913cad9c97ec57..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/local_worker_provider.define
+++ /dev/null
@@ -1,5 +0,0 @@
-org.skywalking.apm.collector.agentjvm.worker.cpu.CpuMetricPersistenceWorker$Factory
-org.skywalking.apm.collector.agentjvm.worker.memory.MemoryMetricPersistenceWorker$Factory
-org.skywalking.apm.collector.agentjvm.worker.memorypool.MemoryPoolMetricPersistenceWorker$Factory
-org.skywalking.apm.collector.agentjvm.worker.gc.GCMetricPersistenceWorker$Factory
-org.skywalking.apm.collector.agentjvm.worker.heartbeat.InstHeartBeatPersistenceWorker$Factory
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/storage.define b/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/storage.define
deleted file mode 100644
index a4ac32ed27deeecb239e9ad7696db68f7a78da14..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/main/resources/META-INF/defines/storage.define
+++ /dev/null
@@ -1,11 +0,0 @@
-org.skywalking.apm.collector.agentjvm.worker.cpu.define.CpuMetricEsTableDefine
-org.skywalking.apm.collector.agentjvm.worker.cpu.define.CpuMetricH2TableDefine
-
-org.skywalking.apm.collector.agentjvm.worker.memory.define.MemoryMetricEsTableDefine
-org.skywalking.apm.collector.agentjvm.worker.memory.define.MemoryMetricH2TableDefine
-
-org.skywalking.apm.collector.agentjvm.worker.memorypool.define.MemoryPoolMetricEsTableDefine
-org.skywalking.apm.collector.agentjvm.worker.memorypool.define.MemoryPoolMetricH2TableDefine
-
-org.skywalking.apm.collector.agentjvm.worker.gc.define.GCMetricEsTableDefine
-org.skywalking.apm.collector.agentjvm.worker.gc.define.GCMetricH2TableDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentjvm/src/test/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java b/apm-collector-3.2.3/apm-collector-agentjvm/src/test/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java
deleted file mode 100644
index fbb74625626ecd7f0d211dd6c8569f6bb7b192c5..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentjvm/src/test/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentjvm.grpc.handler;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import org.skywalking.apm.network.proto.CPU;
-import org.skywalking.apm.network.proto.GC;
-import org.skywalking.apm.network.proto.GCPhrase;
-import org.skywalking.apm.network.proto.JVMMetric;
-import org.skywalking.apm.network.proto.JVMMetrics;
-import org.skywalking.apm.network.proto.JVMMetricsServiceGrpc;
-import org.skywalking.apm.network.proto.Memory;
-import org.skywalking.apm.network.proto.MemoryPool;
-import org.skywalking.apm.network.proto.PoolType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class JVMMetricsServiceHandlerTestCase {
-
- private final Logger logger = LoggerFactory.getLogger(JVMMetricsServiceHandlerTestCase.class);
-
- private static JVMMetricsServiceGrpc.JVMMetricsServiceBlockingStub STUB;
-
- public static void main(String[] args) {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build();
- STUB = JVMMetricsServiceGrpc.newBlockingStub(channel);
-
- final long timeInterval = 1;
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> multiInstanceJvmSend(), 1, timeInterval, TimeUnit.SECONDS);
- }
-
- public static void multiInstanceJvmSend() {
- buildJvmMetric(2);
- buildJvmMetric(3);
- }
-
- private static void buildJvmMetric(int instanceId) {
- JVMMetrics.Builder jvmMetricsBuilder = JVMMetrics.newBuilder();
- jvmMetricsBuilder.setApplicationInstanceId(instanceId);
-
- JVMMetric.Builder jvmMetric = JVMMetric.newBuilder();
- jvmMetric.setTime(System.currentTimeMillis());
- buildCpuMetric(jvmMetric);
- buildMemoryMetric(jvmMetric);
- buildMemoryPoolMetric(jvmMetric);
- buildGcMetric(jvmMetric);
-
- jvmMetricsBuilder.addMetrics(jvmMetric.build());
- STUB.collect(jvmMetricsBuilder.build());
- }
-
- private static void buildCpuMetric(JVMMetric.Builder jvmMetric) {
- CPU.Builder cpuBuilder = CPU.newBuilder();
- cpuBuilder.setUsagePercent(70);
- jvmMetric.setCpu(cpuBuilder);
- }
-
- private static void buildMemoryMetric(JVMMetric.Builder jvmMetric) {
- Memory.Builder builderHeap = Memory.newBuilder();
- builderHeap.setIsHeap(true);
- builderHeap.setInit(20);
- builderHeap.setMax(100);
- builderHeap.setUsed(50);
- builderHeap.setCommitted(30);
- jvmMetric.addMemory(builderHeap.build());
-
- Memory.Builder builderNonHeap = Memory.newBuilder();
- builderNonHeap.setIsHeap(false);
- builderNonHeap.setInit(200);
- builderNonHeap.setMax(1000);
- builderNonHeap.setUsed(500);
- builderNonHeap.setCommitted(300);
- jvmMetric.addMemory(builderNonHeap.build());
- }
-
- private static void buildMemoryPoolMetric(JVMMetric.Builder jvmMetric) {
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.NEWGEN_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.NEWGEN_USAGE, false).build());
-
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.OLDGEN_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.OLDGEN_USAGE, false).build());
-
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.METASPACE_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.METASPACE_USAGE, false).build());
-
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.PERMGEN_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.PERMGEN_USAGE, false).build());
-
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.SURVIVOR_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.SURVIVOR_USAGE, false).build());
-
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.CODE_CACHE_USAGE, true).build());
- jvmMetric.addMemoryPool(buildMemoryPoolMetric(PoolType.CODE_CACHE_USAGE, false).build());
- }
-
- private static MemoryPool.Builder buildMemoryPoolMetric(PoolType poolType, boolean isHeap) {
- MemoryPool.Builder builder = MemoryPool.newBuilder();
- builder.setType(poolType);
- builder.setInit(20);
- builder.setMax(100);
- builder.setUsed(50);
- builder.setCommited(30);
- return builder;
- }
-
- private static void buildGcMetric(JVMMetric.Builder jvmMetric) {
- GC.Builder newGcBuilder = GC.newBuilder();
- newGcBuilder.setPhrase(GCPhrase.NEW);
- newGcBuilder.setCount(2);
- newGcBuilder.setTime(100);
- jvmMetric.addGc(newGcBuilder.build());
-
- GC.Builder oldGcBuilder = GC.newBuilder();
- oldGcBuilder.setPhrase(GCPhrase.OLD);
- oldGcBuilder.setCount(2);
- oldGcBuilder.setTime(100);
- jvmMetric.addGc(oldGcBuilder.build());
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/pom.xml b/apm-collector-3.2.3/apm-collector-agentregister/pom.xml
deleted file mode 100644
index 1e988fada41a2e27dcaae8b5d8c072764425ceb1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-agentregister
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-stream
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-cluster
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-server
- ${project.version}
-
-
- org.skywalking
- apm-network
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-cache
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/application/ApplicationIDService.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/application/ApplicationIDService.java
deleted file mode 100644
index 209646469e7ba1ff9e282bc0c2b54d6376e258fd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/application/ApplicationIDService.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.application;
-
-import org.skywalking.apm.collector.agentregister.worker.application.ApplicationRegisterRemoteWorker;
-import org.skywalking.apm.collector.cache.ApplicationCache;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationIDService {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationIDService.class);
-
- public int getOrCreate(String applicationCode) {
- int applicationId = ApplicationCache.get(applicationCode);
-
- if (applicationId == 0) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- ApplicationDataDefine.Application application = new ApplicationDataDefine.Application(applicationCode, applicationCode, 0);
- try {
- context.getClusterWorkerContext().lookup(ApplicationRegisterRemoteWorker.WorkerRole.INSTANCE).tell(application);
- } catch (WorkerNotFoundException | WorkerInvokeException e) {
- logger.error(e.getMessage(), e);
- }
- }
- return applicationId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandler.java
deleted file mode 100644
index c0fc2fb4d718bf5649cf8b9e42703622db257ae0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.grpc.handler;
-
-import com.google.protobuf.ProtocolStringList;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.collector.agentregister.application.ApplicationIDService;
-import org.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.skywalking.apm.network.proto.Application;
-import org.skywalking.apm.network.proto.ApplicationMapping;
-import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc;
-import org.skywalking.apm.network.proto.KeyWithIntegerValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterServiceHandler extends ApplicationRegisterServiceGrpc.ApplicationRegisterServiceImplBase implements GRPCHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServiceHandler.class);
-
- private ApplicationIDService applicationIDService = new ApplicationIDService();
-
- @Override public void register(Application request, StreamObserver responseObserver) {
- logger.debug("register application");
- ProtocolStringList applicationCodes = request.getApplicationCodeList();
-
- ApplicationMapping.Builder builder = ApplicationMapping.newBuilder();
- for (int i = 0; i < applicationCodes.size(); i++) {
- String applicationCode = applicationCodes.get(i);
- int applicationId = applicationIDService.getOrCreate(applicationCode);
-
- if (applicationId != 0) {
- KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(applicationCode).setValue(applicationId).build();
- builder.addApplication(value);
- }
- }
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/InstanceDiscoveryServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/InstanceDiscoveryServiceHandler.java
deleted file mode 100644
index ed59226577f9ab492152557fece6923e9eb70b40..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/InstanceDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.grpc.handler;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.collector.agentregister.instance.InstanceIDService;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.skywalking.apm.network.proto.ApplicationInstance;
-import org.skywalking.apm.network.proto.ApplicationInstanceMapping;
-import org.skywalking.apm.network.proto.ApplicationInstanceRecover;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc;
-import org.skywalking.apm.network.proto.OSInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase implements GRPCHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServiceHandler.class);
-
- private InstanceIDService instanceIDService = new InstanceIDService();
-
- @Override
- public void register(ApplicationInstance request, StreamObserver responseObserver) {
- long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(request.getRegisterTime());
- int instanceId = instanceIDService.getOrCreate(request.getApplicationId(), request.getAgentUUID(), timeBucket, buildOsInfo(request.getOsinfo()));
- ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder();
- builder.setApplicationId(request.getApplicationId());
- builder.setApplicationInstanceId(instanceId);
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-
- @Override
- public void registerRecover(ApplicationInstanceRecover request, StreamObserver responseObserver) {
- long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(request.getRegisterTime());
- instanceIDService.recover(request.getApplicationInstanceId(), request.getApplicationId(), timeBucket, buildOsInfo(request.getOsinfo()));
- responseObserver.onNext(Downstream.newBuilder().build());
- responseObserver.onCompleted();
- }
-
- private String buildOsInfo(OSInfo osinfo) {
- JsonObject osInfoJson = new JsonObject();
- osInfoJson.addProperty("osName", osinfo.getOsName());
- osInfoJson.addProperty("hostName", osinfo.getHostname());
- osInfoJson.addProperty("processId", osinfo.getProcessNo());
-
- JsonArray ipv4Array = new JsonArray();
- osinfo.getIpv4SList().forEach(ipv4 -> {
- ipv4Array.add(ipv4);
- });
- osInfoJson.add("ipv4s", ipv4Array);
- return osInfoJson.toString();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ServiceNameDiscoveryServiceHandler.java
deleted file mode 100644
index 5b77ee4b1d144761120da6848a24a377a644ccb1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/grpc/handler/ServiceNameDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.grpc.handler;
-
-import io.grpc.stub.StreamObserver;
-import java.util.List;
-import org.skywalking.apm.collector.agentregister.servicename.ServiceNameService;
-import org.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.skywalking.apm.network.proto.ServiceNameCollection;
-import org.skywalking.apm.network.proto.ServiceNameDiscoveryServiceGrpc;
-import org.skywalking.apm.network.proto.ServiceNameElement;
-import org.skywalking.apm.network.proto.ServiceNameMappingCollection;
-import org.skywalking.apm.network.proto.ServiceNameMappingElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameDiscoveryServiceHandler extends ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceImplBase implements GRPCHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class);
-
- private ServiceNameService serviceNameService = new ServiceNameService();
-
- @Override public void discovery(ServiceNameCollection request,
- StreamObserver responseObserver) {
- List serviceNameElementList = request.getElementsList();
-
- ServiceNameMappingCollection.Builder builder = ServiceNameMappingCollection.newBuilder();
- for (ServiceNameElement serviceNameElement : serviceNameElementList) {
- int applicationId = serviceNameElement.getApplicationId();
- String serviceName = serviceNameElement.getServiceName();
- int serviceId = serviceNameService.getOrCreate(applicationId, serviceName);
-
- if (serviceId != 0) {
- ServiceNameMappingElement.Builder mappingElement = ServiceNameMappingElement.newBuilder();
- mappingElement.setServiceId(serviceId);
- mappingElement.setElement(serviceNameElement);
- builder.addElements(mappingElement);
- }
- }
-
- responseObserver.onNext(builder.build());
- responseObserver.onCompleted();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/instance/InstanceIDService.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/instance/InstanceIDService.java
deleted file mode 100644
index 6a4ae597a9c3c6eb0092a39880219cf62b7dc3af..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/instance/InstanceIDService.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.instance;
-
-import org.skywalking.apm.collector.agentregister.worker.instance.InstanceRegisterRemoteWorker;
-import org.skywalking.apm.collector.agentregister.worker.instance.dao.IInstanceDAO;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceIDService {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceIDService.class);
-
- public int getOrCreate(int applicationId, String agentUUID, long registerTime, String osInfo) {
- logger.debug("get or create instance id, application id: {}, agentUUID: {}, registerTime: {}, osInfo: {}", applicationId, agentUUID, registerTime, osInfo);
- IInstanceDAO dao = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName());
- int instanceId = dao.getInstanceId(applicationId, agentUUID);
-
- if (instanceId == 0) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- InstanceDataDefine.Instance instance = new InstanceDataDefine.Instance("0", applicationId, agentUUID, registerTime, 0, registerTime, osInfo);
- try {
- context.getClusterWorkerContext().lookup(InstanceRegisterRemoteWorker.WorkerRole.INSTANCE).tell(instance);
- } catch (WorkerNotFoundException | WorkerInvokeException e) {
- logger.error(e.getMessage(), e);
- }
- }
- return instanceId;
- }
-
- public void recover(int instanceId, int applicationId, long registerTime, String osInfo) {
- logger.debug("instance recover, instance id: {}, application id: {}, register time: {}", instanceId, applicationId, registerTime);
- IInstanceDAO dao = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName());
-
- InstanceDataDefine.Instance instance = new InstanceDataDefine.Instance(String.valueOf(instanceId), applicationId, "", registerTime, instanceId, registerTime, osInfo);
- dao.save(instance);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ApplicationRegisterServletHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ApplicationRegisterServletHandler.java
deleted file mode 100644
index 2c932efdeb32111731172bde12b71d1bccc14839..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ApplicationRegisterServletHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.jetty.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentregister.application.ApplicationIDService;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterServletHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServletHandler.class);
-
- private ApplicationIDService applicationIDService = new ApplicationIDService();
- private Gson gson = new Gson();
- private static final String APPLICATION_CODE = "c";
- private static final String APPLICATION_ID = "i";
-
- @Override public String pathSpec() {
- return "/application/register";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonArray responseArray = new JsonArray();
- try {
- JsonArray applicationCodes = gson.fromJson(req.getReader(), JsonArray.class);
- for (int i = 0; i < applicationCodes.size(); i++) {
- String applicationCode = applicationCodes.get(i).getAsString();
- int applicationId = applicationIDService.getOrCreate(applicationCode);
- JsonObject mapping = new JsonObject();
- mapping.addProperty(APPLICATION_CODE, applicationCode);
- mapping.addProperty(APPLICATION_ID, applicationId);
- responseArray.add(mapping);
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseArray;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/InstanceDiscoveryServletHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/InstanceDiscoveryServletHandler.java
deleted file mode 100644
index 1e847b1f3425fc9c68313e10a5fd917c55c457ff..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/InstanceDiscoveryServletHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.jetty.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentregister.instance.InstanceIDService;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceDiscoveryServletHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServletHandler.class);
-
- private InstanceIDService instanceIDService = new InstanceIDService();
- private Gson gson = new Gson();
-
- private static final String APPLICATION_ID = "ai";
- private static final String AGENT_UUID = "au";
- private static final String REGISTER_TIME = "rt";
- private static final String INSTANCE_ID = "ii";
- private static final String OS_INFO = "oi";
-
- @Override public String pathSpec() {
- return "/instance/register";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonObject responseJson = new JsonObject();
- try {
- JsonObject instance = gson.fromJson(req.getReader(), JsonObject.class);
- int applicationId = instance.get(APPLICATION_ID).getAsInt();
- String agentUUID = instance.get(AGENT_UUID).getAsString();
- long registerTime = instance.get(REGISTER_TIME).getAsLong();
- JsonObject osInfo = instance.get(OS_INFO).getAsJsonObject();
-
- int instanceId = instanceIDService.getOrCreate(applicationId, agentUUID, registerTime, osInfo.toString());
- responseJson.addProperty(APPLICATION_ID, applicationId);
- responseJson.addProperty(INSTANCE_ID, instanceId);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseJson;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ServiceNameDiscoveryServiceHandler.java
deleted file mode 100644
index 87f8083d5300450543f004b8677b1242936e64b8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/jetty/handler/ServiceNameDiscoveryServiceHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.jetty.handler;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentregister.servicename.ServiceNameService;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameDiscoveryServiceHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class);
-
- private ServiceNameService serviceNameService = new ServiceNameService();
- private Gson gson = new Gson();
-
- @Override public String pathSpec() {
- return "/servicename/discovery";
- }
-
- private static final String APPLICATION_ID = "ai";
- private static final String SERVICE_NAME = "sn";
- private static final String SERVICE_ID = "si";
- private static final String ELEMENT = "el";
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- JsonArray responseArray = new JsonArray();
- try {
- JsonArray services = gson.fromJson(req.getReader(), JsonArray.class);
- for (JsonElement service : services) {
- int applicationId = service.getAsJsonObject().get(APPLICATION_ID).getAsInt();
- String serviceName = service.getAsJsonObject().get(SERVICE_NAME).getAsString();
-
- int serviceId = serviceNameService.getOrCreate(applicationId, serviceName);
- if (serviceId != 0) {
- JsonObject responseJson = new JsonObject();
- responseJson.addProperty(SERVICE_ID, serviceId);
- responseJson.add(ELEMENT, service);
- responseArray.add(responseJson);
- }
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return responseArray;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/servicename/ServiceNameService.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/servicename/ServiceNameService.java
deleted file mode 100644
index f1d5c32b032a0ee53b93107b8b9636ca27366d72..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/servicename/ServiceNameService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.servicename;
-
-import org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameRegisterRemoteWorker;
-import org.skywalking.apm.collector.cache.dao.IServiceNameCacheDAO;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameService {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameService.class);
-
- public int getOrCreate(int applicationId, String serviceName) {
- IServiceNameCacheDAO dao = (IServiceNameCacheDAO)DAOContainer.INSTANCE.get(IServiceNameCacheDAO.class.getName());
- int serviceId = dao.getServiceId(applicationId, serviceName);
-
- if (serviceId == 0) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- ServiceNameDataDefine.ServiceName service = new ServiceNameDataDefine.ServiceName("0", serviceName, applicationId, 0);
- try {
- context.getClusterWorkerContext().lookup(ServiceNameRegisterRemoteWorker.WorkerRole.INSTANCE).tell(service);
- } catch (WorkerNotFoundException | WorkerInvokeException e) {
- logger.error(e.getMessage(), e);
- }
- }
- return serviceId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/IdAutoIncrement.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/IdAutoIncrement.java
deleted file mode 100644
index a9e06117b26c2fb211cede9641a14d894f499c15..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/IdAutoIncrement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker;
-
-/**
- * @author peng-yongsheng
- */
-public enum IdAutoIncrement {
- INSTANCE;
-
- public int increment(int min, int max) {
- int instanceId;
- if (min == max) {
- instanceId = -1;
- } else if (min + max == 0) {
- instanceId = max + 1;
- } else if (min + max > 0) {
- instanceId = min - 1;
- } else if (max < 0) {
- instanceId = 1;
- } else {
- instanceId = max + 1;
- }
- return instanceId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationEsTableDefine.java
deleted file mode 100644
index 2189cd2b1004871c413c0ce64c680d21f1f7a6b1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationEsTableDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application;
-
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationEsTableDefine extends ElasticSearchTableDefine {
-
- public ApplicationEsTableDefine() {
- super(ApplicationTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_APPLICATION_CODE, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationH2TableDefine.java
deleted file mode 100644
index e8da1a567da582493a83593984866f38e7ce9396..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationH2TableDefine.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application;
-
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceTable;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationH2TableDefine extends H2TableDefine {
-
- public ApplicationH2TableDefine() {
- super(ApplicationTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(GlobalTraceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_APPLICATION_CODE, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterRemoteWorker.java
deleted file mode 100644
index f3cf8bd5be5bb5cfe7f3357e1a772979fe7b42b4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterRemoteWorker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterRemoteWorker extends AbstractRemoteWorker {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterRemoteWorker.class);
-
- protected ApplicationRegisterRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- ApplicationDataDefine.Application application = (ApplicationDataDefine.Application)message;
- logger.debug("application code: {}", application.getApplicationCode());
- getClusterContext().lookup(ApplicationRegisterSerialWorker.WorkerRole.INSTANCE).tell(application);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ApplicationRegisterRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ApplicationRegisterRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ApplicationRegisterRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ApplicationDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterSerialWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterSerialWorker.java
deleted file mode 100644
index 4c231270285c872a9b76883ec596630a31e7ed73..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/ApplicationRegisterSerialWorker.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application;
-
-import org.skywalking.apm.collector.agentregister.worker.IdAutoIncrement;
-import org.skywalking.apm.collector.agentregister.worker.application.dao.IApplicationDAO;
-import org.skywalking.apm.collector.cache.dao.IApplicationCacheDAO;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterSerialWorker.class);
-
- public ApplicationRegisterSerialWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- if (message instanceof ApplicationDataDefine.Application) {
- ApplicationDataDefine.Application application = (ApplicationDataDefine.Application)message;
- logger.debug("register application, application code: {}", application.getApplicationCode());
-
- IApplicationCacheDAO cacheDao = (IApplicationCacheDAO)DAOContainer.INSTANCE.get(IApplicationCacheDAO.class.getName());
- int applicationId = cacheDao.getApplicationId(application.getApplicationCode());
-
- IApplicationDAO dao = (IApplicationDAO)DAOContainer.INSTANCE.get(IApplicationDAO.class.getName());
- if (applicationId == 0) {
- int min = dao.getMinApplicationId();
- if (min == 0) {
- ApplicationDataDefine.Application userApplication = new ApplicationDataDefine.Application(String.valueOf(Const.USER_ID), Const.USER_CODE, Const.USER_ID);
- dao.save(userApplication);
-
- application.setApplicationId(-1);
- application.setId("-1");
- } else {
- int max = dao.getMaxApplicationId();
- applicationId = IdAutoIncrement.INSTANCE.increment(min, max);
- application.setApplicationId(applicationId);
- application.setId(String.valueOf(applicationId));
- }
- dao.save(application);
- }
- }
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ApplicationRegisterSerialWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ApplicationRegisterSerialWorker(role(), clusterContext);
- }
-
- @Override public int queueSize() {
- return 256;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ApplicationRegisterSerialWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ApplicationDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationEsDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationEsDAO.java
deleted file mode 100644
index 93c8933c7d768004cb5f061d2f3cf046d3b0b9c3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationEsDAO.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.support.WriteRequest;
-import org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationEsDAO extends EsDAO implements IApplicationDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationEsDAO.class);
-
- @Override public int getMaxApplicationId() {
- return getMaxId(ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
- }
-
- @Override public int getMinApplicationId() {
- return getMinId(ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
- }
-
- @Override public void save(ApplicationDataDefine.Application application) {
- logger.debug("save application register info, application id: {}, application code: {}", application.getApplicationId(), application.getApplicationCode());
- ElasticSearchClient client = getClient();
- Map source = new HashMap<>();
- source.put(ApplicationTable.COLUMN_APPLICATION_CODE, application.getApplicationCode());
- source.put(ApplicationTable.COLUMN_APPLICATION_ID, application.getApplicationId());
-
- IndexResponse response = client.prepareIndex(ApplicationTable.TABLE, application.getId()).setSource(source).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get();
- logger.debug("save application register info, application id: {}, application code: {}, status: {}", application.getApplicationId(), application.getApplicationCode(), response.status().name());
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationH2DAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationH2DAO.java
deleted file mode 100644
index 99c372bb9d97ac9d591c1c0f53fb2658af1982a7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/ApplicationH2DAO.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ApplicationH2DAO extends H2DAO implements IApplicationDAO {
- private final Logger logger = LoggerFactory.getLogger(ApplicationH2DAO.class);
-
- @Override
- public int getMaxApplicationId() {
- return getMaxId(ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
- }
-
- @Override
- public int getMinApplicationId() {
- return getMinId(ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
- }
-
- @Override
- public void save(ApplicationDataDefine.Application application) {
- H2Client client = getClient();
-
- Map source = new HashMap<>();
- source.put(ApplicationTable.COLUMN_ID, application.getApplicationId());
- source.put(ApplicationTable.COLUMN_APPLICATION_CODE, application.getApplicationCode());
- source.put(ApplicationTable.COLUMN_APPLICATION_ID, application.getApplicationId());
-
- String sql = SqlBuilder.buildBatchInsertSql(ApplicationTable.TABLE, source.keySet());
- Object[] params = source.values().toArray(new Object[0]);
- try {
- client.execute(sql, params);
- } catch (H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/IApplicationDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/IApplicationDAO.java
deleted file mode 100644
index 2e6d56eedf6fce88da3f04ecb7868eb0c7fc03e9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/application/dao/IApplicationDAO.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.application.dao;
-
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-
-/**
- * @author peng-yongsheng
- */
-public interface IApplicationDAO {
- int getMaxApplicationId();
-
- int getMinApplicationId();
-
- void save(ApplicationDataDefine.Application application);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceEsTableDefine.java
deleted file mode 100644
index 34fc05e95e75c29692e4b65dda9406f4f139a96e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceEsTableDefine.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance;
-
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceEsTableDefine extends ElasticSearchTableDefine {
-
- public InstanceEsTableDefine() {
- super(InstanceTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_AGENT_UUID, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_REGISTER_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_HEARTBEAT_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_OS_INFO, ElasticSearchColumnDefine.Type.Keyword.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceH2TableDefine.java
deleted file mode 100644
index 3a9fe3482de769be021aabad4d396ce1827c1fc6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceH2TableDefine.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance;
-
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceH2TableDefine extends H2TableDefine {
-
- public InstanceH2TableDefine() {
- super(InstanceTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_AGENT_UUID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_REGISTER_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_HEARTBEAT_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(InstanceTable.COLUMN_OS_INFO, H2ColumnDefine.Type.Varchar.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterRemoteWorker.java
deleted file mode 100644
index e0613c3fda4d8c21625d19563f5ac56b5bcf59c9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterRemoteWorker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceRegisterRemoteWorker extends AbstractRemoteWorker {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceRegisterRemoteWorker.class);
-
- protected InstanceRegisterRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- InstanceDataDefine.Instance instance = (InstanceDataDefine.Instance)message;
- logger.debug("application id: {}, agentUUID: {}, register time: {}", instance.getApplicationId(), instance.getAgentUUID(), instance.getRegisterTime());
- getClusterContext().lookup(InstanceRegisterSerialWorker.WorkerRole.INSTANCE).tell(instance);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public InstanceRegisterRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new InstanceRegisterRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return InstanceRegisterRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new InstanceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterSerialWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterSerialWorker.java
deleted file mode 100644
index 4a6b0bf85f0ba908c717fd95b5afb8f4959bb1b8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/InstanceRegisterSerialWorker.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance;
-
-import org.skywalking.apm.collector.agentregister.worker.instance.dao.IInstanceDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceRegisterSerialWorker.class);
-
- public InstanceRegisterSerialWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- if (message instanceof InstanceDataDefine.Instance) {
- InstanceDataDefine.Instance instance = (InstanceDataDefine.Instance)message;
- logger.debug("register instance, application id: {}, agentUUID: {}", instance.getApplicationId(), instance.getAgentUUID());
-
- IInstanceDAO dao = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName());
- int instanceId = dao.getInstanceId(instance.getApplicationId(), instance.getAgentUUID());
- if (instanceId == 0) {
-// int min = dao.getMinInstanceId();
-// if (min == 0) {
-// instance.setId("1");
-// instance.setInstanceId(1);
-// } else {
-// int max = dao.getMaxInstanceId();
-// instanceId = IdAutoIncrement.INSTANCE.increment(min, max);
-// instance.setId(String.valueOf(instanceId));
-// instance.setInstanceId(instanceId);
-// }
- int max = dao.getMaxInstanceId();
- if (max == 0) {
- instance.setId("1");
- instance.setInstanceId(1);
- } else {
- instance.setId(String.valueOf(max + 1));
- instance.setInstanceId(max + 1);
- }
-
- dao.save(instance);
- }
- }
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public InstanceRegisterSerialWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new InstanceRegisterSerialWorker(role(), clusterContext);
- }
-
- @Override public int queueSize() {
- return 256;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return InstanceRegisterSerialWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ApplicationDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/IInstanceDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/IInstanceDAO.java
deleted file mode 100644
index 5d7972dfcf906a9a8e7c5bae9eed429d1ed30b87..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/IInstanceDAO.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance.dao;
-
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-
-/**
- * @author peng-yongsheng
- */
-public interface IInstanceDAO {
- int getInstanceId(int applicationId, String agentUUID);
-
- int getMaxInstanceId();
-
- int getMinInstanceId();
-
- void save(InstanceDataDefine.Instance instance);
-
- void updateHeartbeatTime(int instanceId, long heartbeatTime);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceEsDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceEsDAO.java
deleted file mode 100644
index 708c596f2d2a03994826a43182826c0e795b0b70..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceEsDAO.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.search.SearchRequestBuilder;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchType;
-import org.elasticsearch.action.support.WriteRequest;
-import org.elasticsearch.action.update.UpdateRequest;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.SearchHit;
-import org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceEsDAO extends EsDAO implements IInstanceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceEsDAO.class);
-
- @Override public int getInstanceId(int applicationId, String agentUUID) {
- ElasticSearchClient client = getClient();
-
- SearchRequestBuilder searchRequestBuilder = client.prepareSearch(InstanceTable.TABLE);
- searchRequestBuilder.setTypes("type");
- searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH);
- BoolQueryBuilder builder = QueryBuilders.boolQuery();
- builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationId));
- builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_AGENT_UUID, agentUUID));
- searchRequestBuilder.setQuery(builder);
- searchRequestBuilder.setSize(1);
-
- SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
- if (searchResponse.getHits().totalHits > 0) {
- SearchHit searchHit = searchResponse.getHits().iterator().next();
- return (int)searchHit.getSource().get(InstanceTable.COLUMN_INSTANCE_ID);
- }
- return 0;
- }
-
- @Override public int getMaxInstanceId() {
- return getMaxId(InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- }
-
- @Override public int getMinInstanceId() {
- return getMinId(InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- }
-
- @Override public void save(InstanceDataDefine.Instance instance) {
- logger.debug("save instance register info, application id: {}, agentUUID: {}", instance.getApplicationId(), instance.getAgentUUID());
- ElasticSearchClient client = getClient();
- Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_INSTANCE_ID, instance.getInstanceId());
- source.put(InstanceTable.COLUMN_APPLICATION_ID, instance.getApplicationId());
- source.put(InstanceTable.COLUMN_AGENT_UUID, instance.getAgentUUID());
- source.put(InstanceTable.COLUMN_REGISTER_TIME, instance.getRegisterTime());
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, instance.getHeartBeatTime());
- source.put(InstanceTable.COLUMN_OS_INFO, instance.getOsInfo());
-
- IndexResponse response = client.prepareIndex(InstanceTable.TABLE, instance.getId()).setSource(source).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get();
- logger.debug("save instance register info, application id: {}, agentUUID: {}, status: {}", instance.getApplicationId(), instance.getAgentUUID(), response.status().name());
- }
-
- @Override public void updateHeartbeatTime(int instanceId, long heartbeatTime) {
- ElasticSearchClient client = getClient();
- UpdateRequest updateRequest = new UpdateRequest();
- updateRequest.index(InstanceTable.TABLE);
- updateRequest.type("type");
- updateRequest.id(String.valueOf(instanceId));
- updateRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
-
- Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, heartbeatTime);
-
- updateRequest.doc(source);
- client.update(updateRequest);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceH2DAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceH2DAO.java
deleted file mode 100644
index 5c45b56a2b5aaa6c15767529cf6466fef12dd5a7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/instance/dao/InstanceH2DAO.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.instance.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class InstanceH2DAO extends H2DAO implements IInstanceDAO {
- private final Logger logger = LoggerFactory.getLogger(InstanceH2DAO.class);
-
- private static final String GET_INSTANCE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ?";
- private static final String UPDATE_HEARTBEAT_TIME_SQL = "update {0} set {1} = ? where {2} = ?";
-
- @Override public int getInstanceId(int applicationId, String agentUUID) {
- logger.info("get the application id with application id = {}, agentUUID = {}", applicationId, agentUUID);
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.COLUMN_INSTANCE_ID, InstanceTable.TABLE, InstanceTable.COLUMN_APPLICATION_ID,
- InstanceTable.COLUMN_AGENT_UUID);
- Object[] params = new Object[] {applicationId, agentUUID};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- return rs.getInt(InstanceTable.COLUMN_INSTANCE_ID);
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return 0;
- }
-
- @Override public int getMaxInstanceId() {
- return getMaxId(InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- }
-
- @Override public int getMinInstanceId() {
- return getMinId(InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- }
-
- @Override public void save(InstanceDataDefine.Instance instance) {
- H2Client client = getClient();
- Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_ID, instance.getId());
- source.put(InstanceTable.COLUMN_INSTANCE_ID, instance.getInstanceId());
- source.put(InstanceTable.COLUMN_APPLICATION_ID, instance.getApplicationId());
- source.put(InstanceTable.COLUMN_AGENT_UUID, instance.getAgentUUID());
- source.put(InstanceTable.COLUMN_REGISTER_TIME, instance.getRegisterTime());
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, instance.getHeartBeatTime());
- source.put(InstanceTable.COLUMN_OS_INFO, instance.getOsInfo());
- String sql = SqlBuilder.buildBatchInsertSql(InstanceTable.TABLE, source.keySet());
- Object[] params = source.values().toArray(new Object[0]);
- try {
- client.execute(sql, params);
- } catch (H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- @Override public void updateHeartbeatTime(int instanceId, long heartbeatTime) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(UPDATE_HEARTBEAT_TIME_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_HEARTBEAT_TIME,
- InstanceTable.COLUMN_ID);
- Object[] params = new Object[] {heartbeatTime, instanceId};
- try {
- client.execute(sql, params);
- } catch (H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameEsTableDefine.java
deleted file mode 100644
index 73ad1be033c80b83b3cae66718dc23d0f3e28c1f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameEsTableDefine.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename;
-
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameEsTableDefine extends ElasticSearchTableDefine {
-
- public ServiceNameEsTableDefine() {
- super(ServiceNameTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(ServiceNameTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceNameTable.COLUMN_SERVICE_NAME, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceNameTable.COLUMN_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameH2TableDefine.java
deleted file mode 100644
index c47813a9e2e9bbe332a1b7e508cddca8fcfa37cc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameH2TableDefine.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename;
-
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameH2TableDefine extends H2TableDefine {
-
- public ServiceNameH2TableDefine() {
- super(ServiceNameTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(ServiceNameTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceNameTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceNameTable.COLUMN_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceNameTable.COLUMN_SERVICE_ID, H2ColumnDefine.Type.Int.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterRemoteWorker.java
deleted file mode 100644
index bb498be0da26599d79fb70d24d4b68a082284f2d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterRemoteWorker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameRegisterRemoteWorker extends AbstractRemoteWorker {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterRemoteWorker.class);
-
- protected ServiceNameRegisterRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- ServiceNameDataDefine.ServiceName serviceName = (ServiceNameDataDefine.ServiceName)message;
- logger.debug("service name: {}", serviceName.getServiceName());
- getClusterContext().lookup(ServiceNameRegisterSerialWorker.WorkerRole.INSTANCE).tell(serviceName);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceNameRegisterRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceNameRegisterRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceNameRegisterRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceNameDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterSerialWorker.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterSerialWorker.java
deleted file mode 100644
index 34abe51a2ebda1f07c20b7092b4d35a33a74352c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/ServiceNameRegisterSerialWorker.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename;
-
-import org.skywalking.apm.collector.agentregister.worker.IdAutoIncrement;
-import org.skywalking.apm.collector.agentregister.worker.servicename.dao.IServiceNameDAO;
-import org.skywalking.apm.collector.cache.dao.IServiceNameCacheDAO;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterSerialWorker.class);
-
- public ServiceNameRegisterSerialWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- if (message instanceof ServiceNameDataDefine.ServiceName) {
- ServiceNameDataDefine.ServiceName serviceName = (ServiceNameDataDefine.ServiceName)message;
- logger.debug("register service name: {}, application id: {}", serviceName.getServiceName(), serviceName.getApplicationId());
-
- IServiceNameCacheDAO cacheDao = (IServiceNameCacheDAO)DAOContainer.INSTANCE.get(IServiceNameCacheDAO.class.getName());
- int serviceId = cacheDao.getServiceId(serviceName.getApplicationId(), serviceName.getServiceName());
-
- IServiceNameDAO dao = (IServiceNameDAO)DAOContainer.INSTANCE.get(IServiceNameDAO.class.getName());
- if (serviceId == 0) {
- int min = dao.getMinServiceId();
- if (min == 0) {
- ServiceNameDataDefine.ServiceName noneServiceName = new ServiceNameDataDefine.ServiceName("1", Const.NONE_SERVICE_NAME, 0, Const.NONE_SERVICE_ID);
- dao.save(noneServiceName);
-
- serviceName.setServiceId(-1);
- serviceName.setId("-1");
- } else {
- int max = dao.getMaxServiceId();
- serviceId = IdAutoIncrement.INSTANCE.increment(min, max);
- serviceName.setId(String.valueOf(serviceId));
- serviceName.setServiceId(serviceId);
- }
- dao.save(serviceName);
- }
- }
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceNameRegisterSerialWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceNameRegisterSerialWorker(role(), clusterContext);
- }
-
- @Override public int queueSize() {
- return 256;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceNameRegisterSerialWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceNameDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/IServiceNameDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/IServiceNameDAO.java
deleted file mode 100644
index 3326998e7321c75976f72755ef54559e567dfada..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/IServiceNameDAO.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename.dao;
-
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-
-/**
- * @author peng-yongsheng
- */
-public interface IServiceNameDAO {
- int getMaxServiceId();
-
- int getMinServiceId();
-
- void save(ServiceNameDataDefine.ServiceName serviceName);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameEsDAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameEsDAO.java
deleted file mode 100644
index 9c4a79bed2e889bb17f265b41db248268171f9e0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameEsDAO.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.support.WriteRequest;
-import org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameEsDAO extends EsDAO implements IServiceNameDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameEsDAO.class);
-
- @Override public int getMaxServiceId() {
- return getMaxId(ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
- }
-
- @Override public int getMinServiceId() {
- return getMinId(ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
- }
-
- @Override public void save(ServiceNameDataDefine.ServiceName serviceName) {
- logger.debug("save service name register info, application id: {}, service name: {}", serviceName.getApplicationId(), serviceName.getServiceName());
- ElasticSearchClient client = getClient();
- Map source = new HashMap<>();
- source.put(ServiceNameTable.COLUMN_SERVICE_ID, serviceName.getServiceId());
- source.put(ServiceNameTable.COLUMN_APPLICATION_ID, serviceName.getApplicationId());
- source.put(ServiceNameTable.COLUMN_SERVICE_NAME, serviceName.getServiceName());
-
- IndexResponse response = client.prepareIndex(ServiceNameTable.TABLE, serviceName.getId()).setSource(source).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get();
- logger.debug("save service name register info, application id: {}, service name: {}, status: {}", serviceName.getApplicationId(), serviceName.getServiceName(), response.status().name());
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameH2DAO.java b/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameH2DAO.java
deleted file mode 100644
index 984093051109aa2f8034cc4411e53ef84cd28ec6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/java/org/skywalking/apm/collector/agentregister/worker/servicename/dao/ServiceNameH2DAO.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.worker.servicename.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ServiceNameH2DAO extends H2DAO implements IServiceNameDAO {
- private final Logger logger = LoggerFactory.getLogger(ServiceNameH2DAO.class);
-
- @Override
- public int getMaxServiceId() {
- return getMaxId(ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
- }
-
- @Override
- public int getMinServiceId() {
- return getMinId(ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
- }
-
- @Override
- public void save(ServiceNameDataDefine.ServiceName serviceName) {
- logger.debug("save service name register info, application id: {}, service name: {}", serviceName.getApplicationId(), serviceName.getServiceName());
- H2Client client = getClient();
- Map source = new HashMap<>();
- source.put(ServiceNameTable.COLUMN_ID, serviceName.getId());
- source.put(ServiceNameTable.COLUMN_SERVICE_ID, serviceName.getServiceId());
- source.put(ServiceNameTable.COLUMN_APPLICATION_ID, serviceName.getApplicationId());
- source.put(ServiceNameTable.COLUMN_SERVICE_NAME, serviceName.getServiceName());
-
- String sql = SqlBuilder.buildBatchInsertSql(ServiceNameTable.TABLE, source.keySet());
- Object[] params = source.values().toArray(new Object[0]);
- try {
- client.execute(sql, params);
- } catch (H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/es_dao.define b/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/es_dao.define
deleted file mode 100644
index 90d0e020d9def6909d6a313c1726ce9ba86b55eb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/es_dao.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.agentregister.worker.application.dao.ApplicationEsDAO
-org.skywalking.apm.collector.agentregister.worker.instance.dao.InstanceEsDAO
-org.skywalking.apm.collector.agentregister.worker.servicename.dao.ServiceNameEsDAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/h2_dao.define b/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/h2_dao.define
deleted file mode 100644
index f381c69585ea5e7416db81b7cd551f27d9ab988f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/h2_dao.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.agentregister.worker.application.dao.ApplicationH2DAO
-org.skywalking.apm.collector.agentregister.worker.instance.dao.InstanceH2DAO
-org.skywalking.apm.collector.agentregister.worker.servicename.dao.ServiceNameH2DAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/local_worker_provider.define b/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/local_worker_provider.define
deleted file mode 100644
index 758eed4ba6f9511a5ccd0b36f48073eda6eb8578..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/local_worker_provider.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.agentregister.worker.application.ApplicationRegisterSerialWorker$Factory
-org.skywalking.apm.collector.agentregister.worker.instance.InstanceRegisterSerialWorker$Factory
-org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameRegisterSerialWorker$Factory
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/storage.define b/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/storage.define
deleted file mode 100644
index 52807b047961dc27a7572863b071687486fcb491..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/main/resources/META-INF/defines/storage.define
+++ /dev/null
@@ -1,8 +0,0 @@
-org.skywalking.apm.collector.agentregister.worker.application.ApplicationEsTableDefine
-org.skywalking.apm.collector.agentregister.worker.application.ApplicationH2TableDefine
-
-org.skywalking.apm.collector.agentregister.worker.instance.InstanceEsTableDefine
-org.skywalking.apm.collector.agentregister.worker.instance.InstanceH2TableDefine
-
-org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameEsTableDefine
-org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameH2TableDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentregister/src/test/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandlerTestCase.java b/apm-collector-3.2.3/apm-collector-agentregister/src/test/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandlerTestCase.java
deleted file mode 100644
index 60998263d0aafb060c13072d9711a5ddf4e8460d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentregister/src/test/java/org/skywalking/apm/collector/agentregister/grpc/handler/ApplicationRegisterServiceHandlerTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentregister.grpc.handler;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import org.skywalking.apm.network.proto.Application;
-import org.skywalking.apm.network.proto.ApplicationMapping;
-import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegisterServiceHandlerTestCase {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServiceHandlerTestCase.class);
-
- private ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub stub;
-
- public void testRegister() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build();
- stub = ApplicationRegisterServiceGrpc.newBlockingStub(channel);
-
- Application application = Application.newBuilder().addApplicationCode("test141").build();
- ApplicationMapping mapping = stub.register(application);
- logger.debug(mapping.getApplication(0).getKey() + ", " + mapping.getApplication(0).getValue());
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/pom.xml b/apm-collector-3.2.3/apm-collector-agentserver/pom.xml
deleted file mode 100644
index 8d936b29d8a7edbb48bcf75daf7bff8339dced73..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-agentserver
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-cluster
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-server
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentstream
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentregister
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-ui
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleContext.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleContext.java
deleted file mode 100644
index 96e7c4bbfc7e1b91ea12212696997b077ebc22a4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver;
-
-import org.skywalking.apm.collector.core.framework.Context;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerModuleContext extends Context {
-
- public AgentServerModuleContext(String groupName) {
- super(groupName);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleDefine.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleDefine.java
deleted file mode 100644
index 8350d678f381093885b57f513652e1a27c1a81c4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleDefine.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver;
-
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListenerDefine;
-import org.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class AgentServerModuleDefine extends ModuleDefine implements ClusterDataListenerDefine {
-
- @Override protected void initializeOtherContext() {
-
- }
-
- @Override protected final Client createClient() {
- throw new UnsupportedOperationException("");
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleException.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleException.java
deleted file mode 100644
index 85e199609854ba010fd0dcb37ca04c5ef7557b5d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver;
-
-import org.skywalking.apm.collector.core.module.ModuleException;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerModuleException extends ModuleException {
-
- public AgentServerModuleException(String message) {
- super(message);
- }
-
- public AgentServerModuleException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleGroupDefine.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleGroupDefine.java
deleted file mode 100644
index f4b4a7e0a571eee7f552d5d42e37a236a21b1253..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleGroupDefine.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver;
-
-import org.skywalking.apm.collector.core.config.GroupConfigParser;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.module.ModuleGroupDefine;
-import org.skywalking.apm.collector.core.module.ModuleInstaller;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerModuleGroupDefine implements ModuleGroupDefine {
-
- public static final String GROUP_NAME = "agent_server";
- private final AgentServerModuleInstaller installer;
-
- public AgentServerModuleGroupDefine() {
- installer = new AgentServerModuleInstaller();
- }
-
- @Override public String name() {
- return GROUP_NAME;
- }
-
- @Override public Context groupContext() {
- return new AgentServerModuleContext(GROUP_NAME);
- }
-
- @Override public ModuleInstaller moduleInstaller() {
- return installer;
- }
-
- @Override public GroupConfigParser groupConfigParser() {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleInstaller.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleInstaller.java
deleted file mode 100644
index 7fab0006cfb9e2d32470f213e4dbc5db8df9b777..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/AgentServerModuleInstaller.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver;
-
-import java.util.List;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.module.MultipleModuleInstaller;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerModuleInstaller extends MultipleModuleInstaller {
-
- @Override public String groupName() {
- return AgentServerModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public Context moduleContext() {
- return new AgentServerModuleContext(groupName());
- }
-
- @Override public List dependenceModules() {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfig.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfig.java
deleted file mode 100644
index 23daa2ff2d3e7aab4bc3a0e73be93c289a6e627b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerJettyConfig {
- public static String HOST;
- public static int PORT;
- public static String CONTEXT_PATH;
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfigParser.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfigParser.java
deleted file mode 100644
index 304cc042fa01fbcc24347b4d95f859517e820992..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyConfigParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerJettyConfigParser implements ModuleConfigParser {
-
- private static final String HOST = "host";
- private static final String PORT = "port";
- public static final String CONTEXT_PATH = "contextPath";
-
- @Override public void parse(Map config) throws ConfigParseException {
- AgentServerJettyConfig.CONTEXT_PATH = "/";
-
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(HOST))) {
- AgentServerJettyConfig.HOST = "localhost";
- } else {
- AgentServerJettyConfig.HOST = (String)config.get(HOST);
- }
-
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(PORT))) {
- AgentServerJettyConfig.PORT = 10800;
- } else {
- AgentServerJettyConfig.PORT = (Integer)config.get(PORT);
- }
- if (ObjectUtils.isNotEmpty(config) && StringUtils.isNotEmpty(config.get(CONTEXT_PATH))) {
- AgentServerJettyConfig.CONTEXT_PATH = (String)config.get(CONTEXT_PATH);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyDataListener.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyDataListener.java
deleted file mode 100644
index 4184b69451733335cdfdf6b7c37ff2e0b498705d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyDataListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty;
-
-import org.skywalking.apm.collector.agentserver.AgentServerModuleGroupDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerJettyDataListener extends ClusterDataListener {
-
- @Override public String path() {
- return ClusterModuleDefine.BASE_CATALOG + "." + AgentServerModuleGroupDefine.GROUP_NAME + "." + AgentServerJettyModuleDefine.MODULE_NAME;
- }
-
- @Override public void serverJoinNotify(String serverAddress) {
-
- }
-
- @Override public void serverQuitNotify(String serverAddress) {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleDefine.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleDefine.java
deleted file mode 100644
index d2a58edaba0730ea9d7fecc212a85369651d1d66..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleDefine.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.agentserver.AgentServerModuleDefine;
-import org.skywalking.apm.collector.agentserver.AgentServerModuleGroupDefine;
-import org.skywalking.apm.collector.agentserver.jetty.handler.AgentStreamGRPCServerHandler;
-import org.skywalking.apm.collector.agentserver.jetty.handler.AgentStreamJettyServerHandler;
-import org.skywalking.apm.collector.agentserver.jetty.handler.UIJettyServerHandler;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.skywalking.apm.collector.core.server.Server;
-import org.skywalking.apm.collector.server.jetty.JettyServer;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerJettyModuleDefine extends AgentServerModuleDefine {
-
- public static final String MODULE_NAME = "jetty";
-
- @Override protected String group() {
- return AgentServerModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override public boolean defaultModule() {
- return true;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new AgentServerJettyConfigParser();
- }
-
- @Override protected Server server() {
- return new JettyServer(AgentServerJettyConfig.HOST, AgentServerJettyConfig.PORT, AgentServerJettyConfig.CONTEXT_PATH);
- }
-
- @Override protected ModuleRegistration registration() {
- return new AgentServerJettyModuleRegistration();
- }
-
- @Override public ClusterDataListener listener() {
- return new AgentServerJettyDataListener();
- }
-
- @Override public List handlerList() {
- List handlers = new LinkedList<>();
- handlers.add(new AgentStreamGRPCServerHandler());
- handlers.add(new AgentStreamJettyServerHandler());
- handlers.add(new UIJettyServerHandler());
- return handlers;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleRegistration.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleRegistration.java
deleted file mode 100644
index 9e292b7ca2790f4bbccb3db7b92136c629ea572d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/AgentServerJettyModuleRegistration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty;
-
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentServerJettyModuleRegistration extends ModuleRegistration {
-
- @Override public Value buildValue() {
- return new Value(AgentServerJettyConfig.HOST, AgentServerJettyConfig.PORT, AgentServerJettyConfig.CONTEXT_PATH);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamGRPCServerHandler.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamGRPCServerHandler.java
deleted file mode 100644
index 2ebdadb72f8e3d5894e9afb94a74e5028b4ceb51..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamGRPCServerHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty.handler;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentstream.grpc.AgentStreamGRPCDataListener;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCServerHandler extends JettyHandler {
-
- @Override public String pathSpec() {
- return "/agentstream/grpc";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- ClusterModuleRegistrationReader reader = CollectorContextHelper.INSTANCE.getClusterModuleContext().getReader();
- Set servers = reader.read(AgentStreamGRPCDataListener.PATH);
- JsonArray serverArray = new JsonArray();
- servers.forEach(serverArray::add);
- return serverArray;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamJettyServerHandler.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamJettyServerHandler.java
deleted file mode 100644
index 106a39a6942db93274f6bfbeae151101095590b3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/AgentStreamJettyServerHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty.handler;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentstream.jetty.AgentStreamJettyDataListener;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyServerHandler extends JettyHandler {
-
- @Override public String pathSpec() {
- return "/agentstream/jetty";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- ClusterModuleRegistrationReader reader = CollectorContextHelper.INSTANCE.getClusterModuleContext().getReader();
- Set servers = reader.read(AgentStreamJettyDataListener.PATH);
- JsonArray serverArray = new JsonArray();
- servers.forEach(serverArray::add);
- return serverArray;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/UIJettyServerHandler.java b/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/UIJettyServerHandler.java
deleted file mode 100644
index 32a9c74c15035bd02e8058ddc6ae2762b057c562..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/java/org/skywalking/apm/collector/agentserver/jetty/handler/UIJettyServerHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentserver.jetty.handler;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.skywalking.apm.collector.ui.jetty.UIJettyDataListener;
-
-/**
- * @author peng-yongsheng
- */
-public class UIJettyServerHandler extends JettyHandler {
-
- @Override public String pathSpec() {
- return "/ui/jetty";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- ClusterModuleRegistrationReader reader = CollectorContextHelper.INSTANCE.getClusterModuleContext().getReader();
- Set servers = reader.read(UIJettyDataListener.PATH);
- JsonArray serverArray = new JsonArray();
- servers.forEach(serverArray::add);
- return serverArray;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/group.define b/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/group.define
deleted file mode 100644
index 229ed8a563dd999a063917f3ff4fbf8d8bad9cb0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/group.define
+++ /dev/null
@@ -1 +0,0 @@
-org.skywalking.apm.collector.agentserver.AgentServerModuleGroupDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/module.define b/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/module.define
deleted file mode 100644
index cdd20e3bfa21148ac65341def6b1a9268fde2c69..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentserver/src/main/resources/META-INF/defines/module.define
+++ /dev/null
@@ -1 +0,0 @@
-org.skywalking.apm.collector.agentserver.jetty.AgentServerJettyModuleDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/pom.xml b/apm-collector-3.2.3/apm-collector-agentstream/pom.xml
deleted file mode 100644
index f709582d2783f0e5db8daba28d74439ebb6419c0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-agentstream
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-stream
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-cluster
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-server
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-storage
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentjvm
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentregister
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-cache
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleContext.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleContext.java
deleted file mode 100644
index 9a369fba511e9d72e25eef97866e6cdbee4393de..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import org.skywalking.apm.collector.core.framework.Context;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleContext extends Context {
-
- public AgentStreamModuleContext(String groupName) {
- super(groupName);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleDefine.java
deleted file mode 100644
index abfca76e90997dbd10c86af7512a6f5ab89c7d59..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleDefine.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListenerDefine;
-import org.skywalking.apm.collector.core.module.ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class AgentStreamModuleDefine extends ModuleDefine implements ClusterDataListenerDefine {
-
- @Override protected final Client createClient() {
- throw new UnsupportedOperationException("");
- }
-
- @Override public final boolean defaultModule() {
- return true;
- }
-
- @Override protected void initializeOtherContext() {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleException.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleException.java
deleted file mode 100644
index e5ec1b86b9b10662bc5e9da27dbfd3111560d92d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import org.skywalking.apm.collector.core.module.ModuleException;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleException extends ModuleException {
- public AgentStreamModuleException(String message) {
- super(message);
- }
-
- public AgentStreamModuleException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupConfigParser.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupConfigParser.java
deleted file mode 100644
index 425b46d5956cc90647dfa79255c436faa8adbbcc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupConfigParser.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import java.util.Map;
-import org.skywalking.apm.collector.agentstream.config.BufferFileConfig;
-import org.skywalking.apm.collector.core.config.GroupConfigParser;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleGroupConfigParser implements GroupConfigParser {
-
- private static final String BUFFER_OFFSET_MAX_FILE_SIZE = "buffer_offset_max_file_size";
- private static final String BUFFER_SEGMENT_MAX_FILE_SIZE = "buffer_segment_max_file_size";
-
- @Override public void parse(Map config) {
- if (config.containsKey(GroupConfigParser.NODE_NAME)) {
- Map groupConfig = config.get(GroupConfigParser.NODE_NAME);
-
- if (groupConfig.containsKey(BUFFER_OFFSET_MAX_FILE_SIZE)) {
- String sizeStr = groupConfig.get(BUFFER_OFFSET_MAX_FILE_SIZE).toUpperCase();
- if (sizeStr.endsWith("K")) {
- int size = Integer.parseInt(sizeStr.replace("K", ""));
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024;
- } else if (sizeStr.endsWith("KB")) {
- int size = Integer.parseInt(sizeStr.replace("KB", ""));
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024;
- } else if (sizeStr.endsWith("M")) {
- int size = Integer.parseInt(sizeStr.replace("M", ""));
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024 * 1024;
- } else if (sizeStr.endsWith("MB")) {
- int size = Integer.parseInt(sizeStr.replace("MB", ""));
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024 * 1024;
- } else {
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024;
- }
- } else {
- BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024;
- }
-
- if (groupConfig.containsKey(BUFFER_SEGMENT_MAX_FILE_SIZE)) {
- String sizeStr = groupConfig.get(BUFFER_SEGMENT_MAX_FILE_SIZE).toUpperCase();
- if (sizeStr.endsWith("K")) {
- int size = Integer.parseInt(sizeStr.replace("K", ""));
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024;
- } else if (sizeStr.endsWith("KB")) {
- int size = Integer.parseInt(sizeStr.replace("KB", ""));
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024;
- } else if (sizeStr.endsWith("M")) {
- int size = Integer.parseInt(sizeStr.replace("M", ""));
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024 * 1024;
- } else if (sizeStr.endsWith("MB")) {
- int size = Integer.parseInt(sizeStr.replace("MB", ""));
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024 * 1024;
- } else {
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = 1024 * 1024;
- }
- } else {
- BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE = 1024 * 1024;
- }
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupDefine.java
deleted file mode 100644
index 7b2501cda8882893088d9053bfe0fe6838713a83..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleGroupDefine.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import org.skywalking.apm.collector.core.config.GroupConfigParser;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.module.ModuleGroupDefine;
-import org.skywalking.apm.collector.core.module.ModuleInstaller;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleGroupDefine implements ModuleGroupDefine {
-
- public static final String GROUP_NAME = "agent_stream";
- private final AgentStreamModuleInstaller installer;
-
- public AgentStreamModuleGroupDefine() {
- installer = new AgentStreamModuleInstaller();
- }
-
- @Override public String name() {
- return GROUP_NAME;
- }
-
- @Override public Context groupContext() {
- return new AgentStreamModuleContext(GROUP_NAME);
- }
-
- @Override public ModuleInstaller moduleInstaller() {
- return installer;
- }
-
- @Override public GroupConfigParser groupConfigParser() {
- return new AgentStreamModuleGroupConfigParser();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleInstaller.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleInstaller.java
deleted file mode 100644
index 416e5007cead705020508f5b2f096a243d9245d1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/AgentStreamModuleInstaller.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.storage.PersistenceTimer;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.config.ConfigException;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.module.MultipleModuleInstaller;
-import org.skywalking.apm.collector.core.server.ServerException;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleInstaller extends MultipleModuleInstaller {
-
- @Override public String groupName() {
- return AgentStreamModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public Context moduleContext() {
- return new AgentStreamModuleContext(groupName());
- }
-
- @Override public List dependenceModules() {
- return null;
- }
-
- @Override public void install() throws DefineException, ConfigException, ServerException, ClientException {
- super.install();
- new PersistenceTimer().start();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/config/BufferFileConfig.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/config/BufferFileConfig.java
deleted file mode 100644
index 89ef3183da7ebe3bd2f607955a64776f10bd6677..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/config/BufferFileConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.config;
-
-/**
- * @author peng-yongsheng
- */
-public class BufferFileConfig {
- public static int BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024;
- public static int BUFFER_SEGMENT_MAX_FILE_SIZE = 10 * 1024 * 1024;
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfig.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfig.java
deleted file mode 100644
index e98c32df1560dc5ad55e7e2f9b6cb2e005609744..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCConfig {
- public static String HOST;
- public static int PORT;
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfigParser.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfigParser.java
deleted file mode 100644
index d9e3ef98700f9222633d729e5879c3e6174d37ed..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCConfigParser.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCConfigParser implements ModuleConfigParser {
-
- private static final String HOST = "host";
- private static final String PORT = "port";
-
- @Override public void parse(Map config) throws ConfigParseException {
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(HOST))) {
- AgentStreamGRPCConfig.HOST = "localhost";
- } else {
- AgentStreamGRPCConfig.HOST = (String)config.get(HOST);
- }
-
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(PORT))) {
- AgentStreamGRPCConfig.PORT = 11800;
- } else {
- AgentStreamGRPCConfig.PORT = (Integer)config.get(PORT);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCDataListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCDataListener.java
deleted file mode 100644
index fed873fcffdcc3baf759fa8c91bb255b7f3580be..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCDataListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc;
-
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleGroupDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCDataListener extends ClusterDataListener {
-
- public static final String PATH = ClusterModuleDefine.BASE_CATALOG + "." + AgentStreamModuleGroupDefine.GROUP_NAME + "." + AgentStreamGRPCModuleDefine.MODULE_NAME;
-
- @Override public String path() {
- return PATH;
- }
-
- @Override public void serverJoinNotify(String serverAddress) {
-
- }
-
- @Override public void serverQuitNotify(String serverAddress) {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleDefine.java
deleted file mode 100644
index 23b64357580cf1b0f2e0a7c286dfdbb2f54df80e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleDefine.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.agentjvm.grpc.handler.JVMMetricsServiceHandler;
-import org.skywalking.apm.collector.agentregister.grpc.handler.ApplicationRegisterServiceHandler;
-import org.skywalking.apm.collector.agentregister.grpc.handler.InstanceDiscoveryServiceHandler;
-import org.skywalking.apm.collector.agentregister.grpc.handler.ServiceNameDiscoveryServiceHandler;
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleDefine;
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleGroupDefine;
-import org.skywalking.apm.collector.agentstream.grpc.handler.TraceSegmentServiceHandler;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.skywalking.apm.collector.core.server.Server;
-import org.skywalking.apm.collector.server.grpc.GRPCServer;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCModuleDefine extends AgentStreamModuleDefine {
-
- public static final String MODULE_NAME = "grpc";
-
- @Override protected String group() {
- return AgentStreamModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new AgentStreamGRPCConfigParser();
- }
-
- @Override protected Server server() {
- return new GRPCServer(AgentStreamGRPCConfig.HOST, AgentStreamGRPCConfig.PORT);
- }
-
- @Override protected ModuleRegistration registration() {
- return new AgentStreamGRPCModuleRegistration();
- }
-
- @Override public ClusterDataListener listener() {
- return new AgentStreamGRPCDataListener();
- }
-
- @Override public List handlerList() {
- List handlers = new LinkedList<>();
- handlers.add(new TraceSegmentServiceHandler());
- handlers.add(new ApplicationRegisterServiceHandler());
- handlers.add(new InstanceDiscoveryServiceHandler());
- handlers.add(new ServiceNameDiscoveryServiceHandler());
- handlers.add(new JVMMetricsServiceHandler());
- return handlers;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleRegistration.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleRegistration.java
deleted file mode 100644
index ef742a3b08ceacbba81e7621d4a1517516146916..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/AgentStreamGRPCModuleRegistration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc;
-
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamGRPCModuleRegistration extends ModuleRegistration {
-
- @Override public Value buildValue() {
- return new Value(AgentStreamGRPCConfig.HOST, AgentStreamGRPCConfig.PORT, null);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandler.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandler.java
deleted file mode 100644
index b7382c585d758359f7f39f8362588a862b3f9caa..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandler.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc.handler;
-
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.collector.agentstream.worker.segment.SegmentParse;
-import org.skywalking.apm.collector.server.grpc.GRPCHandler;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentServiceHandler extends TraceSegmentServiceGrpc.TraceSegmentServiceImplBase implements GRPCHandler {
-
- private final Logger logger = LoggerFactory.getLogger(TraceSegmentServiceHandler.class);
-
- @Override public StreamObserver collect(StreamObserver responseObserver) {
- return new StreamObserver() {
- @Override public void onNext(UpstreamSegment segment) {
- logger.debug("receive segment");
- SegmentParse segmentParse = new SegmentParse();
- segmentParse.parse(segment, SegmentParse.Source.Agent);
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- responseObserver.onNext(Downstream.newBuilder().build());
- responseObserver.onCompleted();
- }
- };
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfig.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfig.java
deleted file mode 100644
index a29bfe1208a4e2e8bf5d8ba781ced3d706d292a3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyConfig {
- public static String HOST;
- public static int PORT;
- public static String CONTEXT_PATH;
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfigParser.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfigParser.java
deleted file mode 100644
index e73fbd22bbe052215c0a3b9d8980a691af53aae6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyConfigParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyConfigParser implements ModuleConfigParser {
-
- private static final String HOST = "host";
- private static final String PORT = "port";
- public static final String CONTEXT_PATH = "contextPath";
-
- @Override public void parse(Map config) throws ConfigParseException {
- AgentStreamJettyConfig.CONTEXT_PATH = "/";
-
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(HOST))) {
- AgentStreamJettyConfig.HOST = "localhost";
- } else {
- AgentStreamJettyConfig.HOST = (String)config.get(HOST);
- }
-
- if (ObjectUtils.isEmpty(config) || StringUtils.isEmpty(config.get(PORT))) {
- AgentStreamJettyConfig.PORT = 12800;
- } else {
- AgentStreamJettyConfig.PORT = (Integer)config.get(PORT);
- }
- if (ObjectUtils.isNotEmpty(config) && StringUtils.isNotEmpty(config.get(CONTEXT_PATH))) {
- AgentStreamJettyConfig.CONTEXT_PATH = (String)config.get(CONTEXT_PATH);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyDataListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyDataListener.java
deleted file mode 100644
index 173ee74b5245756284ed62158972a018d7482137..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyDataListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty;
-
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleGroupDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyDataListener extends ClusterDataListener {
-
- public static final String PATH = ClusterModuleDefine.BASE_CATALOG + "." + AgentStreamModuleGroupDefine.GROUP_NAME + "." + AgentStreamJettyModuleDefine.MODULE_NAME;
-
- @Override public String path() {
- return PATH;
- }
-
- @Override public void serverJoinNotify(String serverAddress) {
-
- }
-
- @Override public void serverQuitNotify(String serverAddress) {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleDefine.java
deleted file mode 100644
index 5867b164e53ffca14e8120ee39ff556e297d0170..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleDefine.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.agentregister.jetty.handler.ApplicationRegisterServletHandler;
-import org.skywalking.apm.collector.agentregister.jetty.handler.InstanceDiscoveryServletHandler;
-import org.skywalking.apm.collector.agentregister.jetty.handler.ServiceNameDiscoveryServiceHandler;
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleDefine;
-import org.skywalking.apm.collector.agentstream.AgentStreamModuleGroupDefine;
-import org.skywalking.apm.collector.agentstream.jetty.handler.TraceSegmentServletHandler;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.skywalking.apm.collector.core.server.Server;
-import org.skywalking.apm.collector.server.jetty.JettyServer;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyModuleDefine extends AgentStreamModuleDefine {
-
- public static final String MODULE_NAME = "jetty";
-
- @Override protected String group() {
- return AgentStreamModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new AgentStreamJettyConfigParser();
- }
-
- @Override protected Server server() {
- return new JettyServer(AgentStreamJettyConfig.HOST, AgentStreamJettyConfig.PORT, AgentStreamJettyConfig.CONTEXT_PATH);
- }
-
- @Override protected ModuleRegistration registration() {
- return new AgentStreamJettyModuleRegistration();
- }
-
- @Override public ClusterDataListener listener() {
- return new AgentStreamJettyDataListener();
- }
-
- @Override public List handlerList() {
- List handlers = new LinkedList<>();
- handlers.add(new TraceSegmentServletHandler());
- handlers.add(new ApplicationRegisterServletHandler());
- handlers.add(new InstanceDiscoveryServletHandler());
- handlers.add(new ServiceNameDiscoveryServiceHandler());
- return handlers;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleRegistration.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleRegistration.java
deleted file mode 100644
index ea69f2ea739884a25e93df37a9703d2ccda99138..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/AgentStreamJettyModuleRegistration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty;
-
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamJettyModuleRegistration extends ModuleRegistration {
-
- @Override public Value buildValue() {
- return new Value(AgentStreamJettyConfig.HOST, AgentStreamJettyConfig.PORT, AgentStreamJettyConfig.CONTEXT_PATH);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/TraceSegmentServletHandler.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/TraceSegmentServletHandler.java
deleted file mode 100644
index 552834ce9d56caa0b880dcda4381efa6800defaa..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/TraceSegmentServletHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler;
-
-import com.google.gson.JsonElement;
-import com.google.gson.stream.JsonReader;
-import java.io.BufferedReader;
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import org.skywalking.apm.collector.agentstream.jetty.handler.reader.TraceSegment;
-import org.skywalking.apm.collector.agentstream.jetty.handler.reader.TraceSegmentJsonReader;
-import org.skywalking.apm.collector.agentstream.worker.segment.SegmentParse;
-import org.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentServletHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(TraceSegmentServletHandler.class);
-
- @Override public String pathSpec() {
- return "/segments";
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- logger.debug("receive stream segment");
- try {
- BufferedReader bufferedReader = req.getReader();
- read(bufferedReader);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- private TraceSegmentJsonReader jsonReader = new TraceSegmentJsonReader();
-
- private void read(BufferedReader bufferedReader) throws IOException {
- JsonReader reader = new JsonReader(bufferedReader);
-
- reader.beginArray();
- while (reader.hasNext()) {
- SegmentParse segmentParse = new SegmentParse();
- TraceSegment traceSegment = jsonReader.read(reader);
- segmentParse.parse(traceSegment.getUpstreamSegment(), SegmentParse.Source.Agent);
- }
- reader.endArray();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/KeyWithStringValueJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/KeyWithStringValueJsonReader.java
deleted file mode 100644
index 50fb018935a4c465d5e4d0aedf8fff751948c88a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/KeyWithStringValueJsonReader.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.KeyWithStringValue;
-
-/**
- * @author peng-yongsheng
- */
-public class KeyWithStringValueJsonReader implements StreamJsonReader {
-
- private static final String KEY = "k";
- private static final String VALUE = "v";
-
- @Override public KeyWithStringValue read(JsonReader reader) throws IOException {
- KeyWithStringValue.Builder builder = KeyWithStringValue.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case KEY:
- builder.setKey(reader.nextString());
- break;
- case VALUE:
- builder.setValue(reader.nextString());
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/LogJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/LogJsonReader.java
deleted file mode 100644
index db95cc41e63c52246ba563beb7ace9c3ca4273f8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/LogJsonReader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.LogMessage;
-
-/**
- * @author peng-yongsheng
- */
-public class LogJsonReader implements StreamJsonReader {
-
- private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader();
-
- private static final String TIME = "ti";
- private static final String LOG_DATA = "ld";
-
- @Override public LogMessage read(JsonReader reader) throws IOException {
- LogMessage.Builder builder = LogMessage.newBuilder();
-
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case TIME:
- builder.setTime(reader.nextLong());
- case LOG_DATA:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addData(keyWithStringValueJsonReader.read(reader));
- }
- reader.endArray();
- default:
- reader.skipValue();
- }
- }
-
- return builder.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/ReferenceJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/ReferenceJsonReader.java
deleted file mode 100644
index efeb7f21424d6962507d9bdae3198dd63a6326d0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/ReferenceJsonReader.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.TraceSegmentReference;
-
-/**
- * @author peng-yongsheng
- */
-public class ReferenceJsonReader implements StreamJsonReader {
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
-
- private static final String PARENT_TRACE_SEGMENT_ID = "ts";
- private static final String PARENT_APPLICATION_ID = "ai";
- private static final String PARENT_SPAN_ID = "si";
- private static final String PARENT_SERVICE_ID = "vi";
- private static final String PARENT_SERVICE_NAME = "vn";
- private static final String NETWORK_ADDRESS_ID = "ni";
- private static final String NETWORK_ADDRESS = "nn";
- private static final String ENTRY_APPLICATION_INSTANCE_ID = "ea";
- private static final String ENTRY_SERVICE_ID = "ei";
- private static final String ENTRY_SERVICE_NAME = "en";
- private static final String REF_TYPE_VALUE = "rv";
-
- @Override public TraceSegmentReference read(JsonReader reader) throws IOException {
- TraceSegmentReference.Builder builder = TraceSegmentReference.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case PARENT_TRACE_SEGMENT_ID:
- builder.setParentTraceSegmentId(uniqueIdJsonReader.read(reader));
- break;
- case PARENT_APPLICATION_ID:
- builder.setParentApplicationInstanceId(reader.nextInt());
- break;
- case PARENT_SPAN_ID:
- builder.setParentSpanId(reader.nextInt());
- break;
- case PARENT_SERVICE_ID:
- builder.setParentServiceId(reader.nextInt());
- break;
- case PARENT_SERVICE_NAME:
- builder.setParentServiceName(reader.nextString());
- break;
- case NETWORK_ADDRESS_ID:
- builder.setNetworkAddressId(reader.nextInt());
- break;
- case NETWORK_ADDRESS:
- builder.setNetworkAddress(reader.nextString());
- break;
- case ENTRY_APPLICATION_INSTANCE_ID:
- builder.setEntryApplicationInstanceId(reader.nextInt());
- break;
- case ENTRY_SERVICE_ID:
- builder.setEntryServiceId(reader.nextInt());
- break;
- case ENTRY_SERVICE_NAME:
- builder.setEntryServiceName(reader.nextString());
- break;
- case REF_TYPE_VALUE:
- builder.setRefTypeValue(reader.nextInt());
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SegmentJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SegmentJsonReader.java
deleted file mode 100644
index 5a5dde311217ed3969ddcd8e8ec901f7c9287003..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SegmentJsonReader.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentJsonReader implements StreamJsonReader {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentJsonReader.class);
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
- private ReferenceJsonReader referenceJsonReader = new ReferenceJsonReader();
- private SpanJsonReader spanJsonReader = new SpanJsonReader();
-
- private static final String TRACE_SEGMENT_ID = "ts";
- private static final String APPLICATION_ID = "ai";
- private static final String APPLICATION_INSTANCE_ID = "ii";
- private static final String TRACE_SEGMENT_REFERENCE = "rs";
- private static final String SPANS = "ss";
-
- @Override public TraceSegmentObject.Builder read(JsonReader reader) throws IOException {
- TraceSegmentObject.Builder builder = TraceSegmentObject.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case TRACE_SEGMENT_ID:
- builder.setTraceSegmentId(uniqueIdJsonReader.read(reader));
- if (logger.isDebugEnabled()) {
- StringBuilder segmentId = new StringBuilder();
- builder.getTraceSegmentId().getIdPartsList().forEach(idPart -> segmentId.append(idPart));
- logger.debug("segment id: {}", segmentId);
- }
- break;
- case APPLICATION_ID:
- builder.setApplicationId(reader.nextInt());
- break;
- case APPLICATION_INSTANCE_ID:
- builder.setApplicationInstanceId(reader.nextInt());
- break;
- case TRACE_SEGMENT_REFERENCE:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addRefs(referenceJsonReader.read(reader));
- }
- reader.endArray();
- break;
- case SPANS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addSpans(spanJsonReader.read(reader));
- }
- reader.endArray();
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SpanJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SpanJsonReader.java
deleted file mode 100644
index 6059b7d80e9e5f6996bb7d418e6c62c35eb43903..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SpanJsonReader.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.SpanObject;
-
-/**
- * @author peng-yongsheng
- */
-public class SpanJsonReader implements StreamJsonReader {
-
- private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader();
- private LogJsonReader logJsonReader = new LogJsonReader();
-
- private static final String SPAN_ID = "si";
- private static final String SPAN_TYPE_VALUE = "tv";
- private static final String SPAN_LAYER_VALUE = "lv";
- private static final String PARENT_SPAN_ID = "ps";
- private static final String START_TIME = "st";
- private static final String END_TIME = "et";
- private static final String COMPONENT_ID = "ci";
- private static final String COMPONENT_NAME = "cn";
- private static final String OPERATION_NAME_ID = "oi";
- private static final String OPERATION_NAME = "on";
- private static final String PEER_ID = "pi";
- private static final String PEER = "pn";
- private static final String IS_ERROR = "ie";
- private static final String TAGS = "to";
- private static final String LOGS = "lo";
-
- @Override public SpanObject read(JsonReader reader) throws IOException {
- SpanObject.Builder builder = SpanObject.newBuilder();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case SPAN_ID:
- builder.setSpanId(reader.nextInt());
- break;
- case SPAN_TYPE_VALUE:
- builder.setSpanTypeValue(reader.nextInt());
- break;
- case SPAN_LAYER_VALUE:
- builder.setSpanLayerValue(reader.nextInt());
- break;
- case PARENT_SPAN_ID:
- builder.setParentSpanId(reader.nextInt());
- break;
- case START_TIME:
- builder.setStartTime(reader.nextLong());
- break;
- case END_TIME:
- builder.setEndTime(reader.nextLong());
- break;
- case COMPONENT_ID:
- builder.setComponentId(reader.nextInt());
- break;
- case COMPONENT_NAME:
- builder.setComponent(reader.nextString());
- break;
- case OPERATION_NAME_ID:
- builder.setOperationNameId(reader.nextInt());
- break;
- case OPERATION_NAME:
- builder.setOperationName(reader.nextString());
- break;
- case PEER_ID:
- builder.setPeerId(reader.nextInt());
- break;
- case PEER:
- builder.setPeer(reader.nextString());
- break;
- case IS_ERROR:
- builder.setIsError(reader.nextBoolean());
- break;
- case TAGS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addTags(keyWithStringValueJsonReader.read(reader));
- }
- reader.endArray();
- break;
- case LOGS:
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addLogs(logJsonReader.read(reader));
- }
- reader.endArray();
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return builder.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/StreamJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/StreamJsonReader.java
deleted file mode 100644
index 9175c4e8005592c8b78e7650e2a680472dd4a76c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/StreamJsonReader.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-
-/**
- * @author peng-yongsheng
- */
-public interface StreamJsonReader {
- T read(JsonReader reader) throws IOException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegment.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegment.java
deleted file mode 100644
index 851bbfa1c32a87655051d6ac1f4ffe2137cf37b9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegment.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegment {
-
- private UpstreamSegment.Builder builder;
-
- public TraceSegment() {
- builder = UpstreamSegment.newBuilder();
- }
-
- public void addGlobalTraceId(UniqueId.Builder globalTraceId) {
- builder.addGlobalTraceIds(globalTraceId);
- }
-
- public void setTraceSegmentBuilder(TraceSegmentObject.Builder traceSegmentBuilder) {
- builder.setSegment(traceSegmentBuilder.build().toByteString());
- }
-
- public UpstreamSegment getUpstreamSegment() {
- return builder.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReader.java
deleted file mode 100644
index 1390f21ccacda9beb8e5c9f519cf06771adc1840..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReader.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentJsonReader implements StreamJsonReader {
-
- private final Logger logger = LoggerFactory.getLogger(TraceSegmentJsonReader.class);
-
- private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader();
- private SegmentJsonReader segmentJsonReader = new SegmentJsonReader();
-
- private static final String GLOBAL_TRACE_IDS = "gt";
- private static final String SEGMENT = "sg";
-
- @Override public TraceSegment read(JsonReader reader) throws IOException {
- TraceSegment traceSegment = new TraceSegment();
-
- reader.beginObject();
- while (reader.hasNext()) {
- switch (reader.nextName()) {
- case GLOBAL_TRACE_IDS:
- reader.beginArray();
- while (reader.hasNext()) {
- traceSegment.addGlobalTraceId(uniqueIdJsonReader.read(reader));
- }
- reader.endArray();
-
- break;
- case SEGMENT:
- traceSegment.setTraceSegmentBuilder(segmentJsonReader.read(reader));
- break;
- default:
- reader.skipValue();
- break;
- }
- }
- reader.endObject();
-
- return traceSegment;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/UniqueIdJsonReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/UniqueIdJsonReader.java
deleted file mode 100644
index 9bf1c3ed79f1bed6438780f491d9416afdab0cbe..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/UniqueIdJsonReader.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import org.skywalking.apm.network.proto.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public class UniqueIdJsonReader implements StreamJsonReader {
-
- @Override public UniqueId.Builder read(JsonReader reader) throws IOException {
- UniqueId.Builder builder = UniqueId.newBuilder();
-
- reader.beginArray();
- while (reader.hasNext()) {
- builder.addIdParts(reader.nextLong());
- }
- reader.endArray();
- return builder;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/AgentStreamModuleDefineException.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/AgentStreamModuleDefineException.java
deleted file mode 100644
index 4398ca80fd7cedee3d70b0f9c18ce09a7c3d834a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/AgentStreamModuleDefineException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker;
-
-import org.skywalking.apm.collector.core.framework.DefineException;
-
-/**
- * @author peng-yongsheng
- */
-public class AgentStreamModuleDefineException extends DefineException {
-
- public AgentStreamModuleDefineException(String message) {
- super(message);
- }
-
- public AgentStreamModuleDefineException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTracePersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTracePersistenceWorker.java
deleted file mode 100644
index 9c178c3c2b6df44e0e6ae93572bd763a9f560c0f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTracePersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global;
-
-import org.skywalking.apm.collector.agentstream.worker.global.dao.IGlobalTraceDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class GlobalTracePersistenceWorker extends PersistenceWorker {
-
- public GlobalTracePersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IGlobalTraceDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public GlobalTracePersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new GlobalTracePersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return GlobalTracePersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new GlobalTraceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTraceSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTraceSpanListener.java
deleted file mode 100644
index 2640146df8cbb33ff54301eded2aeee27369b7cc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/GlobalTraceSpanListener.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.GlobalTraceIdsListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class GlobalTraceSpanListener implements FirstSpanListener, GlobalTraceIdsListener {
-
- private final Logger logger = LoggerFactory.getLogger(GlobalTraceSpanListener.class);
-
- private List globalTraceIds = new ArrayList<>();
- private String segmentId;
- private long timeBucket;
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- this.timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
- this.segmentId = segmentId;
- }
-
- @Override public void parseGlobalTraceId(UniqueId uniqueId) {
- StringBuilder globalTraceIdBuilder = new StringBuilder();
- for (int i = 0; i < uniqueId.getIdPartsList().size(); i++) {
- if (i == 0) {
- globalTraceIdBuilder.append(uniqueId.getIdPartsList().get(i));
- } else {
- globalTraceIdBuilder.append(".").append(uniqueId.getIdPartsList().get(i));
- }
- }
- globalTraceIds.add(globalTraceIdBuilder.toString());
- }
-
- @Override public void build() {
- logger.debug("global trace listener build");
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- for (String globalTraceId : globalTraceIds) {
- GlobalTraceDataDefine.GlobalTrace globalTrace = new GlobalTraceDataDefine.GlobalTrace();
- globalTrace.setGlobalTraceId(globalTraceId);
- globalTrace.setId(segmentId + Const.ID_SPLIT + globalTraceId);
- globalTrace.setSegmentId(segmentId);
- globalTrace.setTimeBucket(timeBucket);
- try {
- logger.debug("send to global trace persistence worker, id: {}", globalTrace.getId());
- context.getClusterWorkerContext().lookup(GlobalTracePersistenceWorker.WorkerRole.INSTANCE).tell(globalTrace.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceEsDAO.java
deleted file mode 100644
index f2b71a56c60b9428493999b27f36e06f2d08db0e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceEsDAO.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.framework.UnexpectedException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class GlobalTraceEsDAO extends EsDAO implements IGlobalTraceDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(GlobalTraceEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(GlobalTraceTable.COLUMN_SEGMENT_ID, data.getDataString(1));
- source.put(GlobalTraceTable.COLUMN_GLOBAL_TRACE_ID, data.getDataString(2));
- source.put(GlobalTraceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- logger.debug("global trace source: {}", source.toString());
- return getClient().prepareIndex(GlobalTraceTable.TABLE, data.getDataString(0)).setSource(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceH2DAO.java
deleted file mode 100644
index e01f730b41f57aaa08f387f3c9de13791d8fe3ea..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/GlobalTraceH2DAO.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.framework.UnexpectedException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class GlobalTraceH2DAO extends H2DAO implements IGlobalTraceDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(GlobalTraceH2DAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- throw new UnexpectedException("There is no need to merge stream data with database data.");
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(GlobalTraceTable.COLUMN_ID, data.getDataString(0));
- source.put(GlobalTraceTable.COLUMN_SEGMENT_ID, data.getDataString(1));
- source.put(GlobalTraceTable.COLUMN_GLOBAL_TRACE_ID, data.getDataString(2));
- source.put(GlobalTraceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- logger.debug("global trace source: {}", source.toString());
-
- String sql = SqlBuilder.buildBatchInsertSql(GlobalTraceTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/IGlobalTraceDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/IGlobalTraceDAO.java
deleted file mode 100644
index e215ca5dd656d688491c38363ec9d794a647afea..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/dao/IGlobalTraceDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IGlobalTraceDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceEsTableDefine.java
deleted file mode 100644
index 9c375320bff07a316701c93861aa0584f17953ef..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceEsTableDefine.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global.define;
-
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class GlobalTraceEsTableDefine extends ElasticSearchTableDefine {
-
- public GlobalTraceEsTableDefine() {
- super(GlobalTraceTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 5;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.COLUMN_SEGMENT_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.COLUMN_GLOBAL_TRACE_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceH2TableDefine.java
deleted file mode 100644
index 8b34dfe91a76f6579fddee50b17863234b13cbe6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/global/define/GlobalTraceH2TableDefine.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.global.define;
-
-import org.skywalking.apm.collector.storage.base.define.global.GlobalTraceTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class GlobalTraceH2TableDefine extends H2TableDefine {
-
- public GlobalTraceH2TableDefine() {
- super(GlobalTraceTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(GlobalTraceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(GlobalTraceTable.COLUMN_SEGMENT_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(GlobalTraceTable.COLUMN_GLOBAL_TRACE_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(GlobalTraceTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformancePersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformancePersistenceWorker.java
deleted file mode 100644
index f56fb0352ded4b54e8747b75c8f541b5d56d1b18..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformancePersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance;
-
-import org.skywalking.apm.collector.agentstream.worker.instance.performance.dao.IInstPerformanceDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class InstPerformancePersistenceWorker extends PersistenceWorker {
-
- public InstPerformancePersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IInstPerformanceDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public InstPerformancePersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new InstPerformancePersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return InstPerformancePersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new InstPerformanceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformanceSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformanceSpanListener.java
deleted file mode 100644
index 18d42b1e3a288bd52f0a1dade5d44a5586aa859c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/InstPerformanceSpanListener.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstPerformanceSpanListener implements EntrySpanListener, FirstSpanListener {
-
- private final Logger logger = LoggerFactory.getLogger(InstPerformanceSpanListener.class);
-
- private int applicationId;
- private int instanceId;
- private long cost;
- private long timeBucket;
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- }
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- this.applicationId = applicationId;
- this.instanceId = applicationInstanceId;
- this.cost = spanDecorator.getEndTime() - spanDecorator.getStartTime();
- timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(spanDecorator.getStartTime());
- }
-
- @Override public void build() {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- InstPerformanceDataDefine.InstPerformance instPerformance = new InstPerformanceDataDefine.InstPerformance();
- instPerformance.setId(timeBucket + Const.ID_SPLIT + instanceId);
- instPerformance.setApplicationId(applicationId);
- instPerformance.setInstanceId(instanceId);
- instPerformance.setCalls(1);
- instPerformance.setCostTotal(cost);
- instPerformance.setTimeBucket(timeBucket);
-
- try {
- logger.debug("send to instance performance persistence worker, id: {}", instPerformance.getId());
- context.getClusterWorkerContext().lookup(InstPerformancePersistenceWorker.WorkerRole.INSTANCE).tell(instPerformance.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/IInstPerformanceDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/IInstPerformanceDAO.java
deleted file mode 100644
index 1821d54c1600a193cfa74a76ff1a57c1bb0a647f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/IInstPerformanceDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IInstPerformanceDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceEsDAO.java
deleted file mode 100644
index 16977d80704e33b4816317264f20f179b4b7cd6e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceEsDAO.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstPerformanceEsDAO extends EsDAO implements IInstPerformanceDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(InstPerformanceEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(InstPerformanceTable.TABLE, id).get();
- if (getResponse.isExists()) {
- logger.debug("id: {} is exist", id);
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, (Integer)source.get(InstPerformanceTable.COLUMN_APPLICATION_ID));
- data.setDataInteger(1, (Integer)source.get(InstPerformanceTable.COLUMN_INSTANCE_ID));
- data.setDataInteger(2, (Integer)source.get(InstPerformanceTable.COLUMN_CALLS));
- data.setDataLong(0, ((Number)source.get(InstPerformanceTable.COLUMN_COST_TOTAL)).longValue());
- data.setDataLong(1, ((Number)source.get(InstPerformanceTable.COLUMN_TIME_BUCKET)).longValue());
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(InstPerformanceTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(InstPerformanceTable.COLUMN_INSTANCE_ID, data.getDataInteger(1));
- source.put(InstPerformanceTable.COLUMN_CALLS, data.getDataInteger(2));
- source.put(InstPerformanceTable.COLUMN_COST_TOTAL, data.getDataLong(0));
- source.put(InstPerformanceTable.COLUMN_TIME_BUCKET, data.getDataLong(1));
-
- return getClient().prepareIndex(InstPerformanceTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(InstPerformanceTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(InstPerformanceTable.COLUMN_INSTANCE_ID, data.getDataInteger(1));
- source.put(InstPerformanceTable.COLUMN_CALLS, data.getDataInteger(2));
- source.put(InstPerformanceTable.COLUMN_COST_TOTAL, data.getDataLong(0));
- source.put(InstPerformanceTable.COLUMN_TIME_BUCKET, data.getDataLong(1));
-
- return getClient().prepareUpdate(InstPerformanceTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceH2DAO.java
deleted file mode 100644
index b674ad0cccfc40c5ec48574c93fb8a814963f950..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/dao/InstPerformanceH2DAO.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class InstPerformanceH2DAO extends H2DAO implements IInstPerformanceDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(InstPerformanceH2DAO.class);
- private static final String GET_SQL = "select * from {0} where {1} = ?";
-
- @Override public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SQL, InstPerformanceTable.TABLE, InstPerformanceTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(InstPerformanceTable.COLUMN_APPLICATION_ID));
- data.setDataInteger(1, rs.getInt(InstPerformanceTable.COLUMN_INSTANCE_ID));
- data.setDataInteger(2, rs.getInt(InstPerformanceTable.COLUMN_CALLS));
- data.setDataLong(0, rs.getLong(InstPerformanceTable.COLUMN_COST_TOTAL));
- data.setDataLong(1, rs.getLong(InstPerformanceTable.COLUMN_TIME_BUCKET));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(InstPerformanceTable.COLUMN_ID, data.getDataString(0));
- source.put(InstPerformanceTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(InstPerformanceTable.COLUMN_INSTANCE_ID, data.getDataInteger(1));
- source.put(InstPerformanceTable.COLUMN_CALLS, data.getDataInteger(2));
- source.put(InstPerformanceTable.COLUMN_COST_TOTAL, data.getDataLong(0));
- source.put(InstPerformanceTable.COLUMN_TIME_BUCKET, data.getDataLong(1));
- String sql = SqlBuilder.buildBatchInsertSql(InstPerformanceTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(InstPerformanceTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(InstPerformanceTable.COLUMN_INSTANCE_ID, data.getDataInteger(1));
- source.put(InstPerformanceTable.COLUMN_CALLS, data.getDataInteger(2));
- source.put(InstPerformanceTable.COLUMN_COST_TOTAL, data.getDataLong(0));
- source.put(InstPerformanceTable.COLUMN_TIME_BUCKET, data.getDataLong(1));
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(InstPerformanceTable.TABLE, source.keySet(), InstPerformanceTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceEsTableDefine.java
deleted file mode 100644
index 4ec7ca5c7e6d4a2a2d869c2ce69c5f946a57d764..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceEsTableDefine.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance.define;
-
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class InstPerformanceEsTableDefine extends ElasticSearchTableDefine {
-
- public InstPerformanceEsTableDefine() {
- super(InstPerformanceTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(InstPerformanceTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(InstPerformanceTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(InstPerformanceTable.COLUMN_CALLS, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(InstPerformanceTable.COLUMN_COST_TOTAL, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(InstPerformanceTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceH2TableDefine.java
deleted file mode 100644
index 60e35f1c4005d9157b2a8b8e2bbfdff44d33c107..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/instance/performance/define/InstPerformanceH2TableDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.instance.performance.define;
-
-import org.skywalking.apm.collector.storage.base.define.instance.InstPerformanceTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class InstPerformanceH2TableDefine extends H2TableDefine {
-
- public InstPerformanceH2TableDefine() {
- super(InstPerformanceTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_CALLS, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_COST_TOTAL, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(InstPerformanceTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentAggregationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentAggregationWorker.java
deleted file mode 100644
index 0ddc2326c50f67fea7f212e2cc5f73de903619a4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentAggregationWorker.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerRefs;
-import org.skywalking.apm.collector.stream.worker.impl.AggregationWorker;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentAggregationWorker extends AggregationWorker {
-
- public NodeComponentAggregationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected WorkerRefs nextWorkRef(String id) throws WorkerNotFoundException {
- return getClusterContext().lookup(NodeComponentRemoteWorker.WorkerRole.INSTANCE);
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeComponentAggregationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeComponentAggregationWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeComponentAggregationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeComponentDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentPersistenceWorker.java
deleted file mode 100644
index 447012931f5e3bb4e5061093a9b632d8ffb94afc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component;
-
-import org.skywalking.apm.collector.agentstream.worker.node.component.dao.INodeComponentDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentPersistenceWorker extends PersistenceWorker {
-
- public NodeComponentPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(INodeComponentDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeComponentPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeComponentPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeComponentPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeComponentDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentRemoteWorker.java
deleted file mode 100644
index 80f0bcce308e9795ac8ddd5f24ecd202fa76250e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentRemoteWorker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentRemoteWorker extends AbstractRemoteWorker {
-
- protected NodeComponentRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
-
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- getClusterContext().lookup(NodeComponentPersistenceWorker.WorkerRole.INSTANCE).tell(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeComponentRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeComponentRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeComponentRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeComponentDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentSpanListener.java
deleted file mode 100644
index 26026dc0938e15709da66cf77e693a99409b7f95..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentSpanListener.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.ExitSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentSpanListener implements EntrySpanListener, ExitSpanListener, FirstSpanListener {
-
- private final Logger logger = LoggerFactory.getLogger(NodeComponentSpanListener.class);
-
- private List nodeComponents = new ArrayList<>();
- private long timeBucket;
-
- @Override
- public void parseExit(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId) {
- NodeComponentDataDefine.NodeComponent nodeComponent = new NodeComponentDataDefine.NodeComponent();
- nodeComponent.setComponentId(spanDecorator.getComponentId());
-
- String id;
- if (spanDecorator.getComponentId() == 0) {
- nodeComponent.setComponentName(spanDecorator.getComponent());
- id = nodeComponent.getComponentName();
- } else {
- nodeComponent.setComponentName(Const.EMPTY_STRING);
- id = String.valueOf(nodeComponent.getComponentId());
- }
-
- nodeComponent.setPeerId(spanDecorator.getPeerId());
- nodeComponent.setPeer(Const.EMPTY_STRING);
- id = id + Const.ID_SPLIT + nodeComponent.getPeerId();
- nodeComponent.setId(id);
- nodeComponents.add(nodeComponent);
- }
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- NodeComponentDataDefine.NodeComponent nodeComponent = new NodeComponentDataDefine.NodeComponent();
- nodeComponent.setComponentId(spanDecorator.getComponentId());
-
- String id;
- if (spanDecorator.getComponentId() == 0) {
- nodeComponent.setComponentName(spanDecorator.getComponent());
- id = nodeComponent.getComponentName();
- } else {
- id = String.valueOf(nodeComponent.getComponentId());
- nodeComponent.setComponentName(Const.EMPTY_STRING);
- }
-
- nodeComponent.setPeerId(applicationId);
- nodeComponent.setPeer(Const.EMPTY_STRING);
- id = id + Const.ID_SPLIT + String.valueOf(applicationId);
- nodeComponent.setId(id);
-
- nodeComponents.add(nodeComponent);
- }
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
- }
-
- @Override public void build() {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- nodeComponents.forEach(nodeComponent -> {
- nodeComponent.setId(timeBucket + Const.ID_SPLIT + nodeComponent.getId());
- nodeComponent.setTimeBucket(timeBucket);
-
- try {
- logger.debug("send to node component aggregation worker, id: {}", nodeComponent.getId());
- context.getClusterWorkerContext().lookup(NodeComponentAggregationWorker.WorkerRole.INSTANCE).tell(nodeComponent.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- });
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/INodeComponentDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/INodeComponentDAO.java
deleted file mode 100644
index 237f2e9f8764ef6f0672af00a9a99e37a902b37e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/INodeComponentDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface INodeComponentDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentEsDAO.java
deleted file mode 100644
index 867336bd4eb7775fd241bbab8bcbc93eb916f3df..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentEsDAO.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentEsDAO extends EsDAO implements INodeComponentDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(NodeComponentTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, ((Number)source.get(NodeComponentTable.COLUMN_COMPONENT_ID)).intValue());
- data.setDataString(1, (String)source.get(NodeComponentTable.COLUMN_COMPONENT_NAME));
- data.setDataInteger(1, ((Number)source.get(NodeComponentTable.COLUMN_PEER_ID)).intValue());
- data.setDataString(2, (String)source.get(NodeComponentTable.COLUMN_PEER));
- data.setDataLong(0, (Long)source.get(NodeComponentTable.COLUMN_TIME_BUCKET));
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(NodeComponentTable.COLUMN_COMPONENT_ID, data.getDataInteger(0));
- source.put(NodeComponentTable.COLUMN_COMPONENT_NAME, data.getDataString(1));
- source.put(NodeComponentTable.COLUMN_PEER_ID, data.getDataInteger(1));
- source.put(NodeComponentTable.COLUMN_PEER, data.getDataString(2));
- source.put(NodeComponentTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareIndex(NodeComponentTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(NodeComponentTable.COLUMN_COMPONENT_ID, data.getDataInteger(0));
- source.put(NodeComponentTable.COLUMN_COMPONENT_NAME, data.getDataString(1));
- source.put(NodeComponentTable.COLUMN_PEER_ID, data.getDataInteger(1));
- source.put(NodeComponentTable.COLUMN_PEER, data.getDataString(2));
- source.put(NodeComponentTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareUpdate(NodeComponentTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentH2DAO.java
deleted file mode 100644
index 6b5365c2cbee99ca39839baa8b0702808dc757fd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/dao/NodeComponentH2DAO.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class NodeComponentH2DAO extends H2DAO implements INodeComponentDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(NodeComponentH2DAO.class);
- private static final String GET_SQL = "select * from {0} where {1} = ?";
-
- @Override
- public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SQL, NodeComponentTable.TABLE, NodeComponentTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(NodeComponentTable.COLUMN_COMPONENT_ID));
- data.setDataString(1, rs.getString(NodeComponentTable.COLUMN_COMPONENT_NAME));
- data.setDataInteger(1, rs.getInt(NodeComponentTable.COLUMN_PEER_ID));
- data.setDataString(2, rs.getString(NodeComponentTable.COLUMN_PEER));
- data.setDataLong(0, rs.getLong(NodeComponentTable.COLUMN_TIME_BUCKET));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override
- public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeComponentTable.COLUMN_ID, data.getDataString(0));
- source.put(NodeComponentTable.COLUMN_COMPONENT_ID, data.getDataInteger(0));
- source.put(NodeComponentTable.COLUMN_COMPONENT_NAME, data.getDataString(1));
- source.put(NodeComponentTable.COLUMN_PEER_ID, data.getDataInteger(1));
- source.put(NodeComponentTable.COLUMN_PEER, data.getDataString(2));
- source.put(NodeComponentTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- String sql = SqlBuilder.buildBatchInsertSql(NodeComponentTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override
- public H2SqlEntity prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeComponentTable.COLUMN_COMPONENT_ID, data.getDataInteger(0));
- source.put(NodeComponentTable.COLUMN_COMPONENT_NAME, data.getDataString(1));
- source.put(NodeComponentTable.COLUMN_PEER_ID, data.getDataInteger(1));
- source.put(NodeComponentTable.COLUMN_PEER, data.getDataString(2));
- source.put(NodeComponentTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(NodeComponentTable.TABLE, source.keySet(), NodeComponentTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentEsTableDefine.java
deleted file mode 100644
index bb781b4c0c80e7974239bc43cfe8524b5454fc69..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentEsTableDefine.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component.define;
-
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentEsTableDefine extends ElasticSearchTableDefine {
-
- public NodeComponentEsTableDefine() {
- super(NodeComponentTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(NodeComponentTable.COLUMN_COMPONENT_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeComponentTable.COLUMN_COMPONENT_NAME, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(NodeComponentTable.COLUMN_PEER_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeComponentTable.COLUMN_PEER, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(NodeComponentTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentH2TableDefine.java
deleted file mode 100644
index b51abc885c767db7713ae3179daacf8b58ec7248..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/define/NodeComponentH2TableDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.component.define;
-
-import org.skywalking.apm.collector.storage.base.define.node.NodeComponentTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeComponentH2TableDefine extends H2TableDefine {
-
- public NodeComponentH2TableDefine() {
- super(NodeComponentTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_COMPONENT_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_COMPONENT_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_PEER_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_PEER, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeComponentTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingAggregationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingAggregationWorker.java
deleted file mode 100644
index dae97619c819fce0387ebf62ca38d5ab6ba3e1ae..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingAggregationWorker.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerRefs;
-import org.skywalking.apm.collector.stream.worker.impl.AggregationWorker;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingAggregationWorker extends AggregationWorker {
-
- public NodeMappingAggregationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected WorkerRefs nextWorkRef(String id) throws WorkerNotFoundException {
- return getClusterContext().lookup(NodeMappingRemoteWorker.WorkerRole.INSTANCE);
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeMappingAggregationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeMappingAggregationWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeMappingAggregationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeMappingDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingPersistenceWorker.java
deleted file mode 100644
index b6cb1e5ed11e1a2f9faf7221fd20a7f5b7ae6ad1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping;
-
-import org.skywalking.apm.collector.agentstream.worker.node.mapping.dao.INodeMappingDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingPersistenceWorker extends PersistenceWorker {
-
- public NodeMappingPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(INodeMappingDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeMappingPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeMappingPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeMappingPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeMappingDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingRemoteWorker.java
deleted file mode 100644
index e0d9b8861fd4429ac86ee46914cca90e19498edd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingRemoteWorker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingRemoteWorker extends AbstractRemoteWorker {
-
- protected NodeMappingRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
-
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- getClusterContext().lookup(NodeMappingPersistenceWorker.WorkerRole.INSTANCE).tell(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeMappingRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeMappingRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeMappingRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeMappingDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingSpanListener.java
deleted file mode 100644
index d0b76fe344c04fd6c784fa869f0beff090a142cf..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingSpanListener.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.RefsListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingSpanListener implements RefsListener, FirstSpanListener {
-
- private final Logger logger = LoggerFactory.getLogger(NodeMappingSpanListener.class);
-
- private List nodeMappings = new ArrayList<>();
- private long timeBucket;
-
- @Override public void parseRef(ReferenceDecorator referenceDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- logger.debug("node mapping listener parse reference");
- NodeMappingDataDefine.NodeMapping nodeMapping = new NodeMappingDataDefine.NodeMapping();
- nodeMapping.setApplicationId(applicationId);
- nodeMapping.setAddressId(referenceDecorator.getNetworkAddressId());
- nodeMapping.setAddress(Const.EMPTY_STRING);
- String id = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(nodeMapping.getAddressId());
- nodeMapping.setId(id);
- nodeMappings.add(nodeMapping);
- }
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
- }
-
- @Override public void build() {
- logger.debug("node mapping listener build");
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- for (NodeMappingDataDefine.NodeMapping nodeMapping : nodeMappings) {
- try {
- nodeMapping.setId(timeBucket + Const.ID_SPLIT + nodeMapping.getId());
- nodeMapping.setTimeBucket(timeBucket);
- logger.debug("send to node mapping aggregation worker, id: {}", nodeMapping.getId());
- context.getClusterWorkerContext().lookup(NodeMappingAggregationWorker.WorkerRole.INSTANCE).tell(nodeMapping.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/INodeMappingDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/INodeMappingDAO.java
deleted file mode 100644
index 9049eca2d732fc2dc75165964ce7f9e4d1235d25..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/INodeMappingDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface INodeMappingDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingEsDAO.java
deleted file mode 100644
index 63d01e8628c39a0253310a1b06eb76caa5ca5c27..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingEsDAO.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingEsDAO extends EsDAO implements INodeMappingDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(NodeMappingTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, ((Number)source.get(NodeMappingTable.COLUMN_APPLICATION_ID)).intValue());
- data.setDataInteger(1, ((Number)source.get(NodeMappingTable.COLUMN_ADDRESS_ID)).intValue());
- data.setDataString(1, (String)source.get(NodeMappingTable.COLUMN_ADDRESS));
- data.setDataLong(0, ((Number)source.get(NodeMappingTable.COLUMN_TIME_BUCKET)).longValue());
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(NodeMappingTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeMappingTable.COLUMN_ADDRESS_ID, data.getDataInteger(1));
- source.put(NodeMappingTable.COLUMN_ADDRESS, data.getDataString(1));
- source.put(NodeMappingTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareIndex(NodeMappingTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(NodeMappingTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeMappingTable.COLUMN_ADDRESS_ID, data.getDataInteger(1));
- source.put(NodeMappingTable.COLUMN_ADDRESS, data.getDataString(1));
- source.put(NodeMappingTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareUpdate(NodeMappingTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingH2DAO.java
deleted file mode 100644
index b3ff4179432ffa42e602c125830b48cc3861b8c5..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/dao/NodeMappingH2DAO.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.agentstream.worker.node.component.dao.NodeComponentH2DAO;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class NodeMappingH2DAO extends H2DAO implements INodeMappingDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(NodeComponentH2DAO.class);
- private static final String GET_SQL = "select * from {0} where {1} = ?";
-
- @Override public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SQL, NodeMappingTable.TABLE, NodeMappingTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(NodeMappingTable.COLUMN_APPLICATION_ID));
- data.setDataInteger(1, rs.getInt(NodeMappingTable.COLUMN_ADDRESS_ID));
- data.setDataString(1, rs.getString(NodeMappingTable.COLUMN_ADDRESS));
- data.setDataLong(0, rs.getLong(NodeMappingTable.COLUMN_TIME_BUCKET));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeMappingTable.COLUMN_ID, data.getDataString(0));
- source.put(NodeMappingTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeMappingTable.COLUMN_ADDRESS_ID, data.getDataInteger(1));
- source.put(NodeMappingTable.COLUMN_ADDRESS, data.getDataString(1));
- source.put(NodeMappingTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- String sql = SqlBuilder.buildBatchInsertSql(NodeMappingTable.TABLE, source.keySet());
- entity.setSql(sql);
-
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeMappingTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeMappingTable.COLUMN_ADDRESS_ID, data.getDataInteger(1));
- source.put(NodeMappingTable.COLUMN_ADDRESS, data.getDataString(1));
- source.put(NodeMappingTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(NodeMappingTable.TABLE, source.keySet(), NodeMappingTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingEsTableDefine.java
deleted file mode 100644
index 8914990bdf987b0a1fb23bb2e7333064ce5aed6e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingEsTableDefine.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping.define;
-
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingEsTableDefine extends ElasticSearchTableDefine {
-
- public NodeMappingEsTableDefine() {
- super(NodeMappingTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(NodeMappingTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeMappingTable.COLUMN_ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeMappingTable.COLUMN_ADDRESS, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(NodeMappingTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingH2TableDefine.java
deleted file mode 100644
index 445ae00432f9401743bbce3dd1e2045fdb5b51ff..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/define/NodeMappingH2TableDefine.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.node.mapping.define;
-
-import org.skywalking.apm.collector.storage.base.define.node.NodeMappingTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeMappingH2TableDefine extends H2TableDefine {
-
- public NodeMappingH2TableDefine() {
- super(NodeMappingTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(NodeMappingTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeMappingTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeMappingTable.COLUMN_ADDRESS_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeMappingTable.COLUMN_ADDRESS, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeMappingTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceAggregationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceAggregationWorker.java
deleted file mode 100644
index f50ab9bb42a77091e723ad5abddb0d254df2f777..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceAggregationWorker.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerRefs;
-import org.skywalking.apm.collector.stream.worker.impl.AggregationWorker;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceAggregationWorker extends AggregationWorker {
-
- public NodeReferenceAggregationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected WorkerRefs nextWorkRef(String id) throws WorkerNotFoundException {
- return getClusterContext().lookup(NodeReferenceRemoteWorker.WorkerRole.INSTANCE);
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeReferenceAggregationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeReferenceAggregationWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeReferenceAggregationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferencePersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferencePersistenceWorker.java
deleted file mode 100644
index 7ba6e30eda23d5a3228186facd41f12371f2bcf3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferencePersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef;
-
-import org.skywalking.apm.collector.agentstream.worker.noderef.dao.INodeReferenceDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferencePersistenceWorker extends PersistenceWorker {
-
- public NodeReferencePersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(INodeReferenceDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeReferencePersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeReferencePersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeReferencePersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceRemoteWorker.java
deleted file mode 100644
index 94968a0bfcd565c2a70c4ff2c8b80963a684dcdb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceRemoteWorker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceRemoteWorker extends AbstractRemoteWorker {
-
- protected NodeReferenceRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
-
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- getClusterContext().lookup(NodeReferencePersistenceWorker.WorkerRole.INSTANCE).tell(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public NodeReferenceRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new NodeReferenceRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return NodeReferenceRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new NodeReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceSpanListener.java
deleted file mode 100644
index 8e309c69e1a62fd40ac3cbbee795f998fe3e189b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceSpanListener.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.ExitSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.RefsListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.cache.InstanceCache;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceSpanListener implements EntrySpanListener, ExitSpanListener, RefsListener {
-
- private final Logger logger = LoggerFactory.getLogger(NodeReferenceSpanListener.class);
-
- private List nodeReferences = new LinkedList<>();
- private List references = new LinkedList<>();
-
- @Override
- public void parseExit(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId) {
- NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
- nodeReference.setFrontApplicationId(applicationId);
- nodeReference.setBehindApplicationId(spanDecorator.getPeerId());
- nodeReference.setBehindPeer(Const.EMPTY_STRING);
- nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
-
- StringBuilder idBuilder = new StringBuilder();
- idBuilder.append(nodeReference.getTimeBucket()).append(Const.ID_SPLIT).append(applicationId)
- .append(Const.ID_SPLIT).append(spanDecorator.getPeerId());
-
- nodeReference.setId(idBuilder.toString());
- nodeReferences.add(buildNodeRefSum(nodeReference, spanDecorator.getStartTime(), spanDecorator.getEndTime(), spanDecorator.getIsError()));
- }
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- if (CollectionUtils.isNotEmpty(references)) {
- references.forEach(nodeReference -> {
- nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
- String idBuilder = String.valueOf(nodeReference.getTimeBucket()) + Const.ID_SPLIT + nodeReference.getFrontApplicationId() +
- Const.ID_SPLIT + nodeReference.getBehindApplicationId();
-
- nodeReference.setId(idBuilder);
- nodeReferences.add(buildNodeRefSum(nodeReference, spanDecorator.getStartTime(), spanDecorator.getEndTime(), spanDecorator.getIsError()));
- });
- } else {
- NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
- nodeReference.setFrontApplicationId(Const.USER_ID);
- nodeReference.setBehindApplicationId(applicationId);
- nodeReference.setBehindPeer(Const.EMPTY_STRING);
- nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
-
- String idBuilder = String.valueOf(nodeReference.getTimeBucket()) + Const.ID_SPLIT + nodeReference.getFrontApplicationId() +
- Const.ID_SPLIT + nodeReference.getBehindApplicationId();
-
- nodeReference.setId(idBuilder);
- nodeReferences.add(buildNodeRefSum(nodeReference, spanDecorator.getStartTime(), spanDecorator.getEndTime(), spanDecorator.getIsError()));
- }
- }
-
- @Override public void parseRef(ReferenceDecorator referenceDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- int parentApplicationId = InstanceCache.get(referenceDecorator.getParentApplicationInstanceId());
-
- NodeReferenceDataDefine.NodeReference referenceSum = new NodeReferenceDataDefine.NodeReference();
- referenceSum.setFrontApplicationId(parentApplicationId);
- referenceSum.setBehindApplicationId(applicationId);
- referenceSum.setBehindPeer(Const.EMPTY_STRING);
- references.add(referenceSum);
- }
-
- @Override public void build() {
- logger.debug("node reference summary listener build");
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- for (NodeReferenceDataDefine.NodeReference nodeReference : nodeReferences) {
- try {
- logger.debug("send to node reference summary aggregation worker, id: {}", nodeReference.getId());
- context.getClusterWorkerContext().lookup(NodeReferenceAggregationWorker.WorkerRole.INSTANCE).tell(nodeReference.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-
- private NodeReferenceDataDefine.NodeReference buildNodeRefSum(NodeReferenceDataDefine.NodeReference reference,
- long startTime, long endTime, boolean isError) {
- long cost = endTime - startTime;
- if (cost <= 1000 && !isError) {
- reference.setS1LTE(1);
- } else if (1000 < cost && cost <= 3000 && !isError) {
- reference.setS3LTE(1);
- } else if (3000 < cost && cost <= 5000 && !isError) {
- reference.setS5LTE(1);
- } else if (5000 < cost && !isError) {
- reference.setS5GT(1);
- } else {
- reference.setError(1);
- }
- reference.setSummary(1);
- return reference;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/INodeReferenceDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/INodeReferenceDAO.java
deleted file mode 100644
index db8d485d2bfca057f08d6b5fcf4f277978fe5222..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/INodeReferenceDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface INodeReferenceDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceEsDAO.java
deleted file mode 100644
index 9a6c6398256c0c54bf7f3c0e4512942724bb61eb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceEsDAO.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceEsDAO extends EsDAO implements INodeReferenceDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(NodeReferenceTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, ((Number)source.get(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID)).intValue());
- data.setDataInteger(1, ((Number)source.get(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID)).intValue());
- data.setDataString(1, (String)source.get(NodeReferenceTable.COLUMN_BEHIND_PEER));
- data.setDataInteger(2, ((Number)source.get(NodeReferenceTable.COLUMN_S1_LTE)).intValue());
- data.setDataInteger(3, ((Number)source.get(NodeReferenceTable.COLUMN_S3_LTE)).intValue());
- data.setDataInteger(4, ((Number)source.get(NodeReferenceTable.COLUMN_S5_LTE)).intValue());
- data.setDataInteger(5, ((Number)source.get(NodeReferenceTable.COLUMN_S5_GT)).intValue());
- data.setDataInteger(6, ((Number)source.get(NodeReferenceTable.COLUMN_SUMMARY)).intValue());
- data.setDataInteger(7, ((Number)source.get(NodeReferenceTable.COLUMN_ERROR)).intValue());
- data.setDataLong(0, ((Number)source.get(NodeReferenceTable.COLUMN_TIME_BUCKET)).longValue());
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, data.getDataInteger(1));
- source.put(NodeReferenceTable.COLUMN_BEHIND_PEER, data.getDataString(1));
- source.put(NodeReferenceTable.COLUMN_S1_LTE, data.getDataInteger(2));
- source.put(NodeReferenceTable.COLUMN_S3_LTE, data.getDataInteger(3));
- source.put(NodeReferenceTable.COLUMN_S5_LTE, data.getDataInteger(4));
- source.put(NodeReferenceTable.COLUMN_S5_GT, data.getDataInteger(5));
- source.put(NodeReferenceTable.COLUMN_SUMMARY, data.getDataInteger(6));
- source.put(NodeReferenceTable.COLUMN_ERROR, data.getDataInteger(7));
- source.put(NodeReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareIndex(NodeReferenceTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, data.getDataInteger(1));
- source.put(NodeReferenceTable.COLUMN_BEHIND_PEER, data.getDataString(1));
- source.put(NodeReferenceTable.COLUMN_S1_LTE, data.getDataInteger(2));
- source.put(NodeReferenceTable.COLUMN_S3_LTE, data.getDataInteger(3));
- source.put(NodeReferenceTable.COLUMN_S5_LTE, data.getDataInteger(4));
- source.put(NodeReferenceTable.COLUMN_S5_GT, data.getDataInteger(5));
- source.put(NodeReferenceTable.COLUMN_SUMMARY, data.getDataInteger(6));
- source.put(NodeReferenceTable.COLUMN_ERROR, data.getDataInteger(7));
- source.put(NodeReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
-
- return getClient().prepareUpdate(NodeReferenceTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceH2DAO.java
deleted file mode 100644
index 73733d89e8e1d11528fb0c12d2a6e6551133efb7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/dao/NodeReferenceH2DAO.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class NodeReferenceH2DAO extends H2DAO implements INodeReferenceDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(NodeReferenceH2DAO.class);
- private static final String GET_SQL = "select * from {0} where {1} = ?";
-
- @Override public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SQL, NodeReferenceTable.TABLE, NodeReferenceTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID));
- data.setDataInteger(1, rs.getInt(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID));
- data.setDataString(1, rs.getString(NodeReferenceTable.COLUMN_BEHIND_PEER));
- data.setDataInteger(2, rs.getInt(NodeReferenceTable.COLUMN_S1_LTE));
- data.setDataInteger(3, rs.getInt(NodeReferenceTable.COLUMN_S3_LTE));
- data.setDataInteger(4, rs.getInt(NodeReferenceTable.COLUMN_S5_LTE));
- data.setDataInteger(5, rs.getInt(NodeReferenceTable.COLUMN_S5_GT));
- data.setDataInteger(6, rs.getInt(NodeReferenceTable.COLUMN_SUMMARY));
- data.setDataInteger(7, rs.getInt(NodeReferenceTable.COLUMN_ERROR));
- data.setDataLong(0, rs.getLong(NodeReferenceTable.COLUMN_TIME_BUCKET));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeReferenceTable.COLUMN_ID, data.getDataString(0));
- source.put(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, data.getDataInteger(1));
- source.put(NodeReferenceTable.COLUMN_BEHIND_PEER, data.getDataString(1));
- source.put(NodeReferenceTable.COLUMN_S1_LTE, data.getDataInteger(2));
- source.put(NodeReferenceTable.COLUMN_S3_LTE, data.getDataInteger(3));
- source.put(NodeReferenceTable.COLUMN_S5_LTE, data.getDataInteger(4));
- source.put(NodeReferenceTable.COLUMN_S5_GT, data.getDataInteger(5));
- source.put(NodeReferenceTable.COLUMN_SUMMARY, data.getDataInteger(6));
- source.put(NodeReferenceTable.COLUMN_ERROR, data.getDataInteger(7));
- source.put(NodeReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- String sql = SqlBuilder.buildBatchInsertSql(NodeReferenceTable.TABLE, source.keySet());
- entity.setSql(sql);
-
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, data.getDataInteger(0));
- source.put(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, data.getDataInteger(1));
- source.put(NodeReferenceTable.COLUMN_BEHIND_PEER, data.getDataString(1));
- source.put(NodeReferenceTable.COLUMN_S1_LTE, data.getDataInteger(2));
- source.put(NodeReferenceTable.COLUMN_S3_LTE, data.getDataInteger(3));
- source.put(NodeReferenceTable.COLUMN_S5_LTE, data.getDataInteger(4));
- source.put(NodeReferenceTable.COLUMN_S5_GT, data.getDataInteger(5));
- source.put(NodeReferenceTable.COLUMN_SUMMARY, data.getDataInteger(6));
- source.put(NodeReferenceTable.COLUMN_ERROR, data.getDataInteger(7));
- source.put(NodeReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(0));
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(NodeReferenceTable.TABLE, source.keySet(), NodeReferenceTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceEsTableDefine.java
deleted file mode 100644
index 896a3494be05e5f1ad84235352aad1c5b9449c6a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceEsTableDefine.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef.define;
-
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceEsTableDefine extends ElasticSearchTableDefine {
-
- public NodeReferenceEsTableDefine() {
- super(NodeReferenceTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_BEHIND_PEER, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_S1_LTE, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_S3_LTE, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_S5_LTE, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_S5_GT, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_SUMMARY, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_ERROR, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(NodeReferenceTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceH2TableDefine.java
deleted file mode 100644
index 0618f71628ced86d2d020fce22e1a22394fe8c90..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/define/NodeReferenceH2TableDefine.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.noderef.define;
-
-import org.skywalking.apm.collector.storage.base.define.noderef.NodeReferenceTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class NodeReferenceH2TableDefine extends H2TableDefine {
-
- public NodeReferenceH2TableDefine() {
- super(NodeReferenceTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_BEHIND_PEER, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_S1_LTE, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_S3_LTE, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_S5_LTE, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_S5_GT, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_SUMMARY, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_ERROR, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(NodeReferenceTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/EntrySpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/EntrySpanListener.java
deleted file mode 100644
index 1b62201b1b7c2d4cd9fef06dcb173311949e8baf..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/EntrySpanListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-
-/**
- * @author peng-yongsheng
- */
-public interface EntrySpanListener extends SpanListener {
- void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/ExitSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/ExitSpanListener.java
deleted file mode 100644
index 96302d359e5187680d56e7a06ee0c3b68a04583d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/ExitSpanListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-
-/**
- * @author peng-yongsheng
- */
-public interface ExitSpanListener extends SpanListener {
- void parseExit(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/FirstSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/FirstSpanListener.java
deleted file mode 100644
index 72764229eff969174d8b863d0e8f7f5bfc0f36f5..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/FirstSpanListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-
-/**
- * @author peng-yongsheng
- */
-public interface FirstSpanListener extends SpanListener {
- void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/GlobalTraceIdsListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/GlobalTraceIdsListener.java
deleted file mode 100644
index 5ddf355fecfa64bc5914afecba468b7d67b95908..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/GlobalTraceIdsListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.network.proto.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public interface GlobalTraceIdsListener extends SpanListener {
- void parseGlobalTraceId(UniqueId uniqueId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/LocalSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/LocalSpanListener.java
deleted file mode 100644
index 8f17f243ab0c2874f9b6c527ff9d5e47686386c0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/LocalSpanListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-
-/**
- * @author peng-yongsheng
- */
-public interface LocalSpanListener extends SpanListener {
- void parseLocal(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/RefsListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/RefsListener.java
deleted file mode 100644
index ac8fa6f425a3cdc6b7bfbeb96706a36b9c17e541..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/RefsListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-
-/**
- * @author peng-yongsheng
- */
-public interface RefsListener extends SpanListener {
- void parseRef(ReferenceDecorator referenceDecorator, int applicationId, int applicationInstanceId, String segmentId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SegmentParse.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SegmentParse.java
deleted file mode 100644
index ed969b954aa35084dd67157dd781f14502a819ef..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SegmentParse.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-import com.google.protobuf.InvalidProtocolBufferException;
-import java.util.ArrayList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.global.GlobalTraceSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.instance.performance.InstPerformanceSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.node.component.NodeComponentSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.node.mapping.NodeMappingSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.noderef.NodeReferenceSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.cost.SegmentCostSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.origin.SegmentPersistenceWorker;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceIdExchanger;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SegmentDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SegmentStandardizationWorker;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanIdExchanger;
-import org.skywalking.apm.collector.agentstream.worker.service.entry.ServiceEntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.serviceref.ServiceReferenceSpanListener;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentParse {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentParse.class);
-
- private List spanListeners;
- private String segmentId;
-
- public SegmentParse() {
- spanListeners = new ArrayList<>();
- spanListeners.add(new NodeComponentSpanListener());
- spanListeners.add(new NodeMappingSpanListener());
- spanListeners.add(new NodeReferenceSpanListener());
- spanListeners.add(new SegmentCostSpanListener());
- spanListeners.add(new GlobalTraceSpanListener());
- spanListeners.add(new ServiceEntrySpanListener());
- spanListeners.add(new ServiceReferenceSpanListener());
- spanListeners.add(new InstPerformanceSpanListener());
- }
-
- public boolean parse(UpstreamSegment segment, Source source) {
- try {
- List traceIds = segment.getGlobalTraceIdsList();
- TraceSegmentObject segmentObject = TraceSegmentObject.parseFrom(segment.getSegment());
-
- SegmentDecorator segmentDecorator = new SegmentDecorator(segmentObject);
- if (!preBuild(traceIds, segmentDecorator)) {
- logger.debug("This segment id exchange not success, write to buffer file, id: {}", segmentId);
-
- if (source.equals(Source.Agent)) {
- writeToBufferFile(segmentId, segment);
- }
- return false;
- } else {
- logger.debug("This segment id exchange success, id: {}", segmentId);
- notifyListenerToBuild();
- buildSegment(segmentId, segmentDecorator.toByteArray());
- return true;
- }
- } catch (InvalidProtocolBufferException e) {
- logger.error(e.getMessage(), e);
- }
- return false;
- }
-
- private boolean preBuild(List traceIds, SegmentDecorator segmentDecorator) {
- StringBuilder segmentIdBuilder = new StringBuilder();
-
- for (int i = 0; i < segmentDecorator.getTraceSegmentId().getIdPartsList().size(); i++) {
- if (i == 0) {
- segmentIdBuilder.append(segmentDecorator.getTraceSegmentId().getIdPartsList().get(i));
- } else {
- segmentIdBuilder.append(".").append(segmentDecorator.getTraceSegmentId().getIdPartsList().get(i));
- }
- }
-
- segmentId = segmentIdBuilder.toString();
-
- for (UniqueId uniqueId : traceIds) {
- notifyGlobalsListener(uniqueId);
- }
-
- int applicationId = segmentDecorator.getApplicationId();
- int applicationInstanceId = segmentDecorator.getApplicationInstanceId();
-
- for (int i = 0; i < segmentDecorator.getRefsCount(); i++) {
- ReferenceDecorator referenceDecorator = segmentDecorator.getRefs(i);
- if (!ReferenceIdExchanger.getInstance().exchange(referenceDecorator, applicationId)) {
- return false;
- }
-
- notifyRefsListener(referenceDecorator, applicationId, applicationInstanceId, segmentId);
- }
-
- for (int i = 0; i < segmentDecorator.getSpansCount(); i++) {
- SpanDecorator spanDecorator = segmentDecorator.getSpans(i);
-
- if (!SpanIdExchanger.getInstance().exchange(spanDecorator, applicationId)) {
- return false;
- }
-
- if (spanDecorator.getSpanId() == 0) {
- notifyFirstListener(spanDecorator, applicationId, applicationInstanceId, segmentId);
- }
-
- if (SpanType.Exit.equals(spanDecorator.getSpanType())) {
- notifyExitListener(spanDecorator, applicationId, applicationInstanceId, segmentId);
- } else if (SpanType.Entry.equals(spanDecorator.getSpanType())) {
- notifyEntryListener(spanDecorator, applicationId, applicationInstanceId, segmentId);
- } else if (SpanType.Local.equals(spanDecorator.getSpanType())) {
- notifyLocalListener(spanDecorator, applicationId, applicationInstanceId, segmentId);
- } else {
- logger.error("span type value was unexpected, span type name: {}", spanDecorator.getSpanType().name());
- }
- }
-
- return true;
- }
-
- private void buildSegment(String id, byte[] dataBinary) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- SegmentDataDefine.Segment segment = new SegmentDataDefine.Segment();
- segment.setId(id);
- segment.setDataBinary(dataBinary);
-
- try {
- logger.debug("send to segment persistence worker, id: {}, dataBinary length: {}", segment.getId(), dataBinary.length);
- context.getClusterWorkerContext().lookup(SegmentPersistenceWorker.WorkerRole.INSTANCE).tell(segment.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- private void writeToBufferFile(String id, UpstreamSegment upstreamSegment) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- try {
- logger.debug("send to segment buffer write worker, id: {}", id);
- context.getClusterWorkerContext().lookup(SegmentStandardizationWorker.WorkerRole.INSTANCE).tell(upstreamSegment);
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- private void notifyListenerToBuild() {
- spanListeners.forEach(SpanListener::build);
- }
-
- private void notifyExitListener(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof ExitSpanListener) {
- ((ExitSpanListener)listener).parseExit(spanDecorator, applicationId, applicationInstanceId, segmentId);
- }
- }
- }
-
- private void notifyEntryListener(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof EntrySpanListener) {
- ((EntrySpanListener)listener).parseEntry(spanDecorator, applicationId, applicationInstanceId, segmentId);
- }
- }
- }
-
- private void notifyLocalListener(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof LocalSpanListener) {
- ((LocalSpanListener)listener).parseLocal(spanDecorator, applicationId, applicationInstanceId, segmentId);
- }
- }
- }
-
- private void notifyFirstListener(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof FirstSpanListener) {
- ((FirstSpanListener)listener).parseFirst(spanDecorator, applicationId, applicationInstanceId, segmentId);
- }
- }
- }
-
- private void notifyRefsListener(ReferenceDecorator reference, int applicationId, int applicationInstanceId,
- String segmentId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof RefsListener) {
- ((RefsListener)listener).parseRef(reference, applicationId, applicationInstanceId, segmentId);
- }
- }
- }
-
- private void notifyGlobalsListener(UniqueId uniqueId) {
- for (SpanListener listener : spanListeners) {
- if (listener instanceof GlobalTraceIdsListener) {
- ((GlobalTraceIdsListener)listener).parseGlobalTraceId(uniqueId);
- }
- }
- }
-
- public enum Source {
- Agent, Buffer
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SpanListener.java
deleted file mode 100644
index e52fc8b7c51ac3961af7066c5ceba068c8c94f9d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/SpanListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment;
-
-/**
- * @author peng-yongsheng
- */
-public interface SpanListener {
- void build();
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/Offset.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/Offset.java
deleted file mode 100644
index 2ea0896ac44b3a80387a8fbea2e7b2446605e286..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/Offset.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-/**
- * @author peng-yongsheng
- */
-public class Offset {
-
- private static final String SPLIT_CHARACTER = ",";
- private ReadOffset readOffset;
- private WriteOffset writeOffset;
-
- public Offset() {
- readOffset = new ReadOffset();
- writeOffset = new WriteOffset();
- }
-
- public String serialize() {
- return readOffset.getReadFileName() + SPLIT_CHARACTER + String.valueOf(readOffset.getReadFileOffset())
- + SPLIT_CHARACTER + writeOffset.getWriteFileName() + SPLIT_CHARACTER + String.valueOf(writeOffset.getWriteFileOffset());
- }
-
- public void deserialize(String value) {
- String[] values = value.split(SPLIT_CHARACTER);
- if (values.length == 4) {
- this.readOffset.readFileName = values[0];
- this.readOffset.readFileOffset = Long.parseLong(values[1]);
- this.writeOffset.writeFileName = values[2];
- this.writeOffset.writeFileOffset = Long.parseLong(values[3]);
- }
- }
-
- public ReadOffset getReadOffset() {
- return readOffset;
- }
-
- public WriteOffset getWriteOffset() {
- return writeOffset;
- }
-
- public static class ReadOffset {
- private String readFileName;
- private long readFileOffset = 0;
-
- public String getReadFileName() {
- return readFileName;
- }
-
- public long getReadFileOffset() {
- return readFileOffset;
- }
-
- public void setReadFileName(String readFileName) {
- this.readFileName = readFileName;
- }
-
- public void setReadFileOffset(long readFileOffset) {
- this.readFileOffset = readFileOffset;
- }
- }
-
- public static class WriteOffset {
- private String writeFileName;
- private long writeFileOffset = 0;
-
- public String getWriteFileName() {
- return writeFileName;
- }
-
- public long getWriteFileOffset() {
- return writeFileOffset;
- }
-
- public void setWriteFileName(String writeFileName) {
- this.writeFileName = writeFileName;
- }
-
- public void setWriteFileOffset(long writeFileOffset) {
- this.writeFileOffset = writeFileOffset;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/OffsetManager.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/OffsetManager.java
deleted file mode 100644
index 3e9518749391ab4bb679111ee3011f095fcd4e09..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/OffsetManager.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import org.skywalking.apm.collector.agentstream.config.BufferFileConfig;
-import org.skywalking.apm.collector.agentstream.worker.util.FileUtils;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum OffsetManager {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(OffsetManager.class);
-
- private static final String OFFSET_FILE_PREFIX = "offset";
- private File offsetFile;
- private Offset offset;
- private boolean initialized = false;
- private RandomAccessFile randomAccessFile = null;
- private String lastOffsetRecord = Const.EMPTY_STRING;
-
- public synchronized void initialize() throws IOException {
- if (!initialized) {
- this.offset = new Offset();
- File dataPath = new File(SegmentBufferConfig.BUFFER_PATH);
- if (dataPath.mkdirs()) {
- createOffsetFile();
- } else {
- File[] offsetFiles = dataPath.listFiles(new PrefixFileNameFilter());
- if (CollectionUtils.isNotEmpty(offsetFiles) && offsetFiles.length > 0) {
- for (int i = 0; i < offsetFiles.length; i++) {
- if (i != offsetFiles.length - 1) {
- offsetFiles[i].delete();
- } else {
- offsetFile = offsetFiles[i];
- }
- }
- } else {
- createOffsetFile();
- }
- }
- String offsetRecord = FileUtils.INSTANCE.readLastLine(offsetFile);
- offset.deserialize(offsetRecord);
- initialized = true;
-
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> flush(), 10, 3, TimeUnit.SECONDS);
- }
- }
-
- private void createOffsetFile() throws IOException {
- String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis()));
- String offsetFileName = OFFSET_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX;
- offsetFile = new File(SegmentBufferConfig.BUFFER_PATH + offsetFileName);
- this.offset.getWriteOffset().setWriteFileName(Const.EMPTY_STRING);
- this.offset.getWriteOffset().setWriteFileOffset(0);
- this.offset.getReadOffset().setReadFileName(Const.EMPTY_STRING);
- this.offset.getReadOffset().setReadFileOffset(0);
- this.flush();
- }
-
- public void flush() {
- String offsetRecord = offset.serialize();
- if (!lastOffsetRecord.equals(offsetRecord)) {
- if (offsetFile.length() >= BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE) {
- nextFile();
- }
- FileUtils.INSTANCE.writeAppendToLast(offsetFile, randomAccessFile, offsetRecord);
- lastOffsetRecord = offsetRecord;
- }
- }
-
- private void nextFile() {
- String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis()));
- String offsetFileName = OFFSET_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX;
- File newOffsetFile = new File(SegmentBufferConfig.BUFFER_PATH + offsetFileName);
- offsetFile.delete();
- offsetFile = newOffsetFile;
- this.flush();
- }
-
- public String getReadFileName() {
- return offset.getReadOffset().getReadFileName();
- }
-
- public long getReadFileOffset() {
- return offset.getReadOffset().getReadFileOffset();
- }
-
- public void setReadOffset(long readFileOffset) {
- offset.getReadOffset().setReadFileOffset(readFileOffset);
- }
-
- public void setReadOffset(String readFileName, long readFileOffset) {
- offset.getReadOffset().setReadFileName(readFileName);
- offset.getReadOffset().setReadFileOffset(readFileOffset);
- }
-
- public String getWriteFileName() {
- return offset.getWriteOffset().getWriteFileName();
- }
-
- public long getWriteFileOffset() {
- return offset.getWriteOffset().getWriteFileOffset();
- }
-
- public void setWriteOffset(String writeFileName, long writeFileOffset) {
- offset.getWriteOffset().setWriteFileName(writeFileName);
- offset.getWriteOffset().setWriteFileOffset(writeFileOffset);
- }
-
- public void setWriteOffset(long writeFileOffset) {
- offset.getWriteOffset().setWriteFileOffset(writeFileOffset);
- }
-
- class PrefixFileNameFilter implements FilenameFilter {
- @Override public boolean accept(File dir, String name) {
- return name.startsWith(OFFSET_FILE_PREFIX);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferConfig.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferConfig.java
deleted file mode 100644
index 16fab593d7826ae4d05d414dd4d275f612729465..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-import org.skywalking.apm.collector.core.config.SystemConfig;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentBufferConfig {
- public static String BUFFER_PATH = SystemConfig.DATA_PATH + "/buffer/";
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferManager.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferManager.java
deleted file mode 100644
index 07339d596a3cfbf3fa7e7904ebdc6ab337333eb2..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferManager.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import org.skywalking.apm.collector.agentstream.config.BufferFileConfig;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum SegmentBufferManager {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(SegmentBufferManager.class);
-
- public static final String DATA_FILE_PREFIX = "data";
- private FileOutputStream outputStream;
-
- public synchronized void initialize() {
- logger.info("segment buffer initialize");
- try {
- OffsetManager.INSTANCE.initialize();
- if (new File(SegmentBufferConfig.BUFFER_PATH).mkdirs()) {
- newDataFile();
- } else {
- String writeFileName = OffsetManager.INSTANCE.getWriteFileName();
- if (StringUtils.isNotEmpty(writeFileName)) {
- File dataFile = new File(SegmentBufferConfig.BUFFER_PATH + writeFileName);
- if (dataFile.exists()) {
- outputStream = new FileOutputStream(new File(SegmentBufferConfig.BUFFER_PATH + writeFileName), true);
- } else {
- newDataFile();
- }
- } else {
- newDataFile();
- }
- }
- SegmentBufferReader.INSTANCE.initialize();
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- public synchronized void writeBuffer(UpstreamSegment segment) {
- try {
- segment.writeDelimitedTo(outputStream);
- long position = outputStream.getChannel().position();
- if (position > BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE) {
- newDataFile();
- } else {
- OffsetManager.INSTANCE.setWriteOffset(position);
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- private void newDataFile() throws IOException {
- logger.debug("create new segment buffer file");
- String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis()));
- String writeFileName = DATA_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX;
- File dataFile = new File(SegmentBufferConfig.BUFFER_PATH + writeFileName);
- dataFile.createNewFile();
- OffsetManager.INSTANCE.setWriteOffset(writeFileName, 0);
- try {
- if (outputStream != null) {
- outputStream.close();
- }
- outputStream = new FileOutputStream(dataFile);
- outputStream.getChannel().position(0);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- public synchronized void flush() {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferReader.java
deleted file mode 100644
index 4f8c767985f84834cb8b028773182c094a1225be..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferReader.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-import com.google.protobuf.CodedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import org.skywalking.apm.collector.agentstream.worker.segment.SegmentParse;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum SegmentBufferReader {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(SegmentBufferReader.class);
- private InputStream inputStream;
-
- public void initialize() {
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(this::preRead, 3, 3, TimeUnit.SECONDS);
- }
-
- private void preRead() {
- String readFileName = OffsetManager.INSTANCE.getReadFileName();
- if (StringUtils.isNotEmpty(readFileName)) {
- File readFile = new File(SegmentBufferConfig.BUFFER_PATH + readFileName);
- if (readFile.exists()) {
- deleteTheDataFilesBeforeReadFile(readFileName);
- long readFileOffset = OffsetManager.INSTANCE.getReadFileOffset();
- read(readFile, readFileOffset);
- readEarliestCreateDataFile();
- } else {
- deleteTheDataFilesBeforeReadFile(readFileName);
- readEarliestCreateDataFile();
- }
- } else {
- readEarliestCreateDataFile();
- }
- }
-
- private void deleteTheDataFilesBeforeReadFile(String readFileName) {
- File[] dataFiles = new File(SegmentBufferConfig.BUFFER_PATH).listFiles(new PrefixFileNameFilter());
-
- long readFileCreateTime = getFileCreateTime(readFileName);
- for (File dataFile : dataFiles) {
- long fileCreateTime = getFileCreateTime(dataFile.getName());
- if (fileCreateTime < readFileCreateTime) {
- dataFile.delete();
- } else if (fileCreateTime == readFileCreateTime) {
- break;
- }
- }
- }
-
- private long getFileCreateTime(String fileName) {
- fileName = fileName.replace(SegmentBufferManager.DATA_FILE_PREFIX + "_", Const.EMPTY_STRING);
- fileName = fileName.replace("." + Const.FILE_SUFFIX, Const.EMPTY_STRING);
- return Long.valueOf(fileName);
- }
-
- private void readEarliestCreateDataFile() {
- String readFileName = OffsetManager.INSTANCE.getReadFileName();
- File[] dataFiles = new File(SegmentBufferConfig.BUFFER_PATH).listFiles(new PrefixFileNameFilter());
-
- if (CollectionUtils.isNotEmpty(dataFiles)) {
- if (dataFiles[0].getName().equals(readFileName)) {
- return;
- }
- }
-
- for (File dataFile : dataFiles) {
- logger.debug("Reading segment buffer data file, file name: {}", dataFile.getAbsolutePath());
- OffsetManager.INSTANCE.setReadOffset(dataFile.getName(), 0);
- if (!read(dataFile, 0)) {
- break;
- }
- }
- }
-
- private boolean read(File readFile, long readFileOffset) {
- try {
- inputStream = new FileInputStream(readFile);
- inputStream.skip(readFileOffset);
-
- String writeFileName = OffsetManager.INSTANCE.getWriteFileName();
- long endPoint = readFile.length();
- if (writeFileName.equals(readFile.getName())) {
- endPoint = OffsetManager.INSTANCE.getWriteFileOffset();
- }
-
- while (readFile.length() > readFileOffset && readFileOffset < endPoint) {
- UpstreamSegment upstreamSegment = UpstreamSegment.parser().parseDelimitedFrom(inputStream);
- SegmentParse parse = new SegmentParse();
- if (!parse.parse(upstreamSegment, SegmentParse.Source.Buffer)) {
- return false;
- }
-
- final int serialized = upstreamSegment.getSerializedSize();
- readFileOffset = readFileOffset + CodedOutputStream.computeUInt32SizeNoTag(serialized) + serialized;
- logger.debug("read segment buffer from file: {}, offset: {}, file length: {}", readFile.getName(), readFileOffset, readFile.length());
- OffsetManager.INSTANCE.setReadOffset(readFileOffset);
- }
-
- inputStream.close();
- if (!writeFileName.equals(readFile.getName())) {
- readFile.delete();
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- return false;
- }
- return true;
- }
-
- class PrefixFileNameFilter implements FilenameFilter {
- @Override public boolean accept(File dir, String name) {
- return name.startsWith(SegmentBufferManager.DATA_FILE_PREFIX);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostPersistenceWorker.java
deleted file mode 100644
index 1a5a0a01a2fdfd70e4975e62dc22c5326da3cd23..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.cost.dao.ISegmentCostDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentCostPersistenceWorker extends PersistenceWorker {
-
- public SegmentCostPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(ISegmentCostDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public SegmentCostPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new SegmentCostPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return SegmentCostPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new SegmentCostDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostSpanListener.java
deleted file mode 100644
index d72d22485060625a98710502ba7a7876ed557e10..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/SegmentCostSpanListener.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.ExitSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.LocalSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.cache.ServiceNameCache;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentCostSpanListener implements EntrySpanListener, ExitSpanListener, LocalSpanListener, FirstSpanListener {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentCostSpanListener.class);
-
- private List segmentCosts = new ArrayList<>();
- private boolean isError = false;
- private long timeBucket;
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
-
- SegmentCostDataDefine.SegmentCost segmentCost = new SegmentCostDataDefine.SegmentCost();
- segmentCost.setSegmentId(segmentId);
- segmentCost.setApplicationId(applicationId);
- segmentCost.setCost(spanDecorator.getEndTime() - spanDecorator.getStartTime());
- segmentCost.setStartTime(spanDecorator.getStartTime());
- segmentCost.setEndTime(spanDecorator.getEndTime());
- segmentCost.setId(segmentId);
- if (spanDecorator.getOperationNameId() == 0) {
- segmentCost.setServiceName(spanDecorator.getOperationName());
- } else {
- segmentCost.setServiceName(ServiceNameCache.getSplitServiceName(ServiceNameCache.get(spanDecorator.getOperationNameId())));
- }
-
- segmentCosts.add(segmentCost);
- isError = isError || spanDecorator.getIsError();
- }
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- isError = isError || spanDecorator.getIsError();
- }
-
- @Override
- public void parseExit(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId, String segmentId) {
- isError = isError || spanDecorator.getIsError();
- }
-
- @Override
- public void parseLocal(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- isError = isError || spanDecorator.getIsError();
- }
-
- @Override public void build() {
- logger.debug("segment cost listener build");
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- for (SegmentCostDataDefine.SegmentCost segmentCost : segmentCosts) {
- segmentCost.setError(isError);
- segmentCost.setTimeBucket(timeBucket);
- try {
- logger.debug("send to segment cost persistence worker, id: {}", segmentCost.getId());
- context.getClusterWorkerContext().lookup(SegmentCostPersistenceWorker.WorkerRole.INSTANCE).tell(segmentCost.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/ISegmentCostDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/ISegmentCostDAO.java
deleted file mode 100644
index b09d6d3306ddc2639b3565f5162deae4d2e05042..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/ISegmentCostDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface ISegmentCostDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostEsDAO.java
deleted file mode 100644
index cfa7ef18050b9886f46fa6ade3591a9ba0bf574e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostEsDAO.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentCostEsDAO extends EsDAO implements ISegmentCostDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentCostEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- logger.debug("segment cost prepareBatchInsert, id: {}", data.getDataString(0));
- Map source = new HashMap<>();
- source.put(SegmentCostTable.COLUMN_SEGMENT_ID, data.getDataString(1));
- source.put(SegmentCostTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(SegmentCostTable.COLUMN_SERVICE_NAME, data.getDataString(2));
- source.put(SegmentCostTable.COLUMN_COST, data.getDataLong(0));
- source.put(SegmentCostTable.COLUMN_START_TIME, data.getDataLong(1));
- source.put(SegmentCostTable.COLUMN_END_TIME, data.getDataLong(2));
- source.put(SegmentCostTable.COLUMN_IS_ERROR, data.getDataBoolean(0));
- source.put(SegmentCostTable.COLUMN_TIME_BUCKET, data.getDataLong(3));
- logger.debug("segment cost source: {}", source.toString());
- return getClient().prepareIndex(SegmentCostTable.TABLE, data.getDataString(0)).setSource(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostH2DAO.java
deleted file mode 100644
index bb93190208748a87a5e0dd81e772704dfbd68502..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/dao/SegmentCostH2DAO.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class SegmentCostH2DAO extends H2DAO implements ISegmentCostDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(SegmentCostH2DAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- logger.debug("segment cost prepareBatchInsert, id: {}", data.getDataString(0));
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(SegmentCostTable.COLUMN_ID, data.getDataString(0));
- source.put(SegmentCostTable.COLUMN_SEGMENT_ID, data.getDataString(1));
- source.put(SegmentCostTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(SegmentCostTable.COLUMN_SERVICE_NAME, data.getDataString(2));
- source.put(SegmentCostTable.COLUMN_COST, data.getDataLong(0));
- source.put(SegmentCostTable.COLUMN_START_TIME, data.getDataLong(1));
- source.put(SegmentCostTable.COLUMN_END_TIME, data.getDataLong(2));
- source.put(SegmentCostTable.COLUMN_IS_ERROR, data.getDataBoolean(0));
- source.put(SegmentCostTable.COLUMN_TIME_BUCKET, data.getDataLong(3));
- logger.debug("segment cost source: {}", source.toString());
-
- String sql = SqlBuilder.buildBatchInsertSql(SegmentCostTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostEsTableDefine.java
deleted file mode 100644
index 6fdd31170b62594e0a3bbcc3482af0d7372bdca7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostEsTableDefine.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost.define;
-
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentCostEsTableDefine extends ElasticSearchTableDefine {
-
- public SegmentCostEsTableDefine() {
- super(SegmentCostTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 5;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_SEGMENT_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_SERVICE_NAME, ElasticSearchColumnDefine.Type.Text.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_COST, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_START_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_END_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, ElasticSearchColumnDefine.Type.Boolean.name()));
- addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostH2TableDefine.java
deleted file mode 100644
index 687daff8816bbb15602a9f55829172b3a015ef47..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/cost/define/SegmentCostH2TableDefine.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.cost.define;
-
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentCostTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentCostH2TableDefine extends H2TableDefine {
-
- public SegmentCostH2TableDefine() {
- super(SegmentCostTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_SEGMENT_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_COST, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_START_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_END_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, H2ColumnDefine.Type.Boolean.name()));
- addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/SegmentPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/SegmentPersistenceWorker.java
deleted file mode 100644
index 8a2e9a04659e222920661acd6b1497e368d4a943..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/SegmentPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.origin.dao.ISegmentDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.RollingSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentPersistenceWorker extends PersistenceWorker {
-
- public SegmentPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return false;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(ISegmentDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public SegmentPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new SegmentPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return SegmentPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new RollingSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new SegmentDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/ISegmentDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/ISegmentDAO.java
deleted file mode 100644
index eb3ef5a5256680102039a98cbf24e889494ce9ab..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/ISegmentDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface ISegmentDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentEsDAO.java
deleted file mode 100644
index 60ba2044f6326d65399d9e501e3c02af6f6cb061..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentEsDAO.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin.dao;
-
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentEsDAO extends EsDAO implements ISegmentDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- return null;
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(SegmentTable.COLUMN_DATA_BINARY, new String(Base64.getEncoder().encode(data.getDataBytes(0))));
- logger.debug("segment source: {}", source.toString());
- return getClient().prepareIndex(SegmentTable.TABLE, data.getDataString(0)).setSource(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentH2DAO.java
deleted file mode 100644
index c5cc429b7cd1bfaad8a9cbada0c00db44bc49b87..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/dao/SegmentH2DAO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.agentstream.worker.segment.cost.dao.SegmentCostH2DAO;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class SegmentH2DAO extends H2DAO implements ISegmentDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(SegmentCostH2DAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- H2SqlEntity entity = new H2SqlEntity();
- source.put(SegmentTable.COLUMN_ID, data.getDataString(0));
- source.put(SegmentTable.COLUMN_DATA_BINARY, data.getDataBytes(0));
- logger.debug("segment source: {}", source.toString());
-
- String sql = SqlBuilder.buildBatchInsertSql(SegmentTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentEsTableDefine.java
deleted file mode 100644
index acb00444f9dc0d3dfba9ffdb17746b360fc24c8d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentEsTableDefine.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin.define;
-
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentEsTableDefine extends ElasticSearchTableDefine {
-
- public SegmentEsTableDefine() {
- super(SegmentTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 10;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(SegmentTable.COLUMN_DATA_BINARY, ElasticSearchColumnDefine.Type.Binary.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentH2TableDefine.java
deleted file mode 100644
index f05be709ad9bb94a3a5f275853151ece2ea62389..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/origin/define/SegmentH2TableDefine.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.origin.define;
-
-import org.skywalking.apm.collector.storage.base.define.segment.SegmentTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentH2TableDefine extends H2TableDefine {
-
- public SegmentH2TableDefine() {
- super(SegmentTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(SegmentTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(SegmentTable.COLUMN_DATA_BINARY, H2ColumnDefine.Type.BINARY.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/IdExchanger.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/IdExchanger.java
deleted file mode 100644
index 2d052f3f0970333d47a0924d81f5e5f895c7eb33..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/IdExchanger.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-/**
- * @author peng-yongsheng
- */
-public interface IdExchanger {
- boolean exchange(T standardBuilder, int applicationId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceDecorator.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceDecorator.java
deleted file mode 100644
index 4c9f1db725353458038da207a4e52a030e780fe1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceDecorator.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.network.proto.RefType;
-import org.skywalking.apm.network.proto.TraceSegmentReference;
-import org.skywalking.apm.network.proto.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public class ReferenceDecorator implements StandardBuilder {
- private boolean isOrigin = true;
- private StandardBuilder standardBuilder;
- private TraceSegmentReference referenceObject;
- private TraceSegmentReference.Builder referenceBuilder;
-
- public ReferenceDecorator(TraceSegmentReference referenceObject, StandardBuilder standardBuilder) {
- this.referenceObject = referenceObject;
- this.standardBuilder = standardBuilder;
- }
-
- public ReferenceDecorator(TraceSegmentReference.Builder referenceBuilder, StandardBuilder standardBuilder) {
- this.referenceBuilder = referenceBuilder;
- this.standardBuilder = standardBuilder;
- this.isOrigin = false;
- }
-
- public RefType getRefType() {
- if (isOrigin) {
- return referenceObject.getRefType();
- } else {
- return referenceBuilder.getRefType();
- }
- }
-
- public int getRefTypeValue() {
- if (isOrigin) {
- return referenceObject.getRefTypeValue();
- } else {
- return referenceBuilder.getRefTypeValue();
- }
- }
-
- public int getEntryServiceId() {
- if (isOrigin) {
- return referenceObject.getEntryServiceId();
- } else {
- return referenceBuilder.getEntryServiceId();
- }
- }
-
- public void setEntryServiceId(int value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setEntryServiceId(value);
- }
-
- public String getEntryServiceName() {
- if (isOrigin) {
- return referenceObject.getEntryServiceName();
- } else {
- return referenceBuilder.getEntryServiceName();
- }
- }
-
- public void setEntryServiceName(String value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setEntryServiceName(value);
- }
-
- public int getEntryApplicationInstanceId() {
- if (isOrigin) {
- return referenceObject.getEntryApplicationInstanceId();
- } else {
- return referenceBuilder.getEntryApplicationInstanceId();
- }
- }
-
- public int getParentApplicationInstanceId() {
- if (isOrigin) {
- return referenceObject.getParentApplicationInstanceId();
- } else {
- return referenceBuilder.getParentApplicationInstanceId();
- }
- }
-
- public int getParentServiceId() {
- if (isOrigin) {
- return referenceObject.getParentServiceId();
- } else {
- return referenceBuilder.getParentServiceId();
- }
- }
-
- public void setParentServiceId(int value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setParentServiceId(value);
- }
-
- public int getParentSpanId() {
- if (isOrigin) {
- return referenceObject.getParentSpanId();
- } else {
- return referenceBuilder.getParentSpanId();
- }
- }
-
- public String getParentServiceName() {
- if (isOrigin) {
- return referenceObject.getParentServiceName();
- } else {
- return referenceBuilder.getParentServiceName();
- }
- }
-
- public void setParentServiceName(String value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setParentServiceName(value);
- }
-
- public UniqueId getParentTraceSegmentId() {
- if (isOrigin) {
- return referenceObject.getParentTraceSegmentId();
- } else {
- return referenceBuilder.getParentTraceSegmentId();
- }
- }
-
- public int getNetworkAddressId() {
- if (isOrigin) {
- return referenceObject.getNetworkAddressId();
- } else {
- return referenceBuilder.getNetworkAddressId();
- }
- }
-
- public void setNetworkAddressId(int value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setNetworkAddressId(value);
- }
-
- public String getNetworkAddress() {
- if (isOrigin) {
- return referenceObject.getNetworkAddress();
- } else {
- return referenceBuilder.getNetworkAddress();
- }
- }
-
- public void setNetworkAddress(String value) {
- if (isOrigin) {
- toBuilder();
- }
- referenceBuilder.setNetworkAddress(value);
- }
-
- @Override public void toBuilder() {
- if (this.isOrigin) {
- this.isOrigin = false;
- referenceBuilder = referenceObject.toBuilder();
- standardBuilder.toBuilder();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceIdExchanger.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceIdExchanger.java
deleted file mode 100644
index da0fefdffc16d00acca5475553de26d39ad11614..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/ReferenceIdExchanger.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.collector.agentregister.servicename.ServiceNameService;
-import org.skywalking.apm.collector.cache.ApplicationCache;
-import org.skywalking.apm.collector.cache.InstanceCache;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ReferenceIdExchanger implements IdExchanger {
-
- private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class);
-
- private static ReferenceIdExchanger EXCHANGER;
- private ServiceNameService serviceNameService;
-
- public static ReferenceIdExchanger getInstance() {
- if (EXCHANGER == null) {
- EXCHANGER = new ReferenceIdExchanger();
- }
- return EXCHANGER;
- }
-
- public ReferenceIdExchanger() {
- serviceNameService = new ServiceNameService();
- }
-
- @Override public boolean exchange(ReferenceDecorator standardBuilder, int applicationId) {
- if (standardBuilder.getEntryServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getEntryServiceName())) {
- int entryServiceId = serviceNameService.getOrCreate(InstanceCache.get(standardBuilder.getEntryApplicationInstanceId()), standardBuilder.getEntryServiceName());
- if (entryServiceId == 0) {
- return false;
- } else {
- standardBuilder.toBuilder();
- standardBuilder.setEntryServiceId(entryServiceId);
- standardBuilder.setEntryServiceName(Const.EMPTY_STRING);
- }
- }
-
- if (standardBuilder.getParentServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getParentServiceName())) {
- int parentServiceId = serviceNameService.getOrCreate(InstanceCache.get(standardBuilder.getParentApplicationInstanceId()), standardBuilder.getParentServiceName());
- if (parentServiceId == 0) {
- return false;
- } else {
- standardBuilder.toBuilder();
- standardBuilder.setParentServiceId(parentServiceId);
- standardBuilder.setParentServiceName(Const.EMPTY_STRING);
- }
- }
-
- if (standardBuilder.getNetworkAddressId() == 0 && StringUtils.isNotEmpty(standardBuilder.getNetworkAddress())) {
- int networkAddressId = ApplicationCache.get(standardBuilder.getNetworkAddress());
- if (networkAddressId == 0) {
- return false;
- } else {
- standardBuilder.toBuilder();
- standardBuilder.setNetworkAddressId(networkAddressId);
- standardBuilder.setNetworkAddress(Const.EMPTY_STRING);
- }
- }
- return true;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentDecorator.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentDecorator.java
deleted file mode 100644
index 2e0bf92c1acd3aab8d312236835ec8127b97e348..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentDecorator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.UniqueId;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentDecorator implements StandardBuilder {
- private boolean isOrigin = true;
- private final TraceSegmentObject segmentObject;
- private TraceSegmentObject.Builder segmentBuilder;
-
- public SegmentDecorator(TraceSegmentObject segmentObject) {
- this.segmentObject = segmentObject;
- }
-
- public int getApplicationId() {
- return segmentObject.getApplicationId();
- }
-
- public int getApplicationInstanceId() {
- return segmentObject.getApplicationInstanceId();
- }
-
- public UniqueId getTraceSegmentId() {
- return segmentObject.getTraceSegmentId();
- }
-
- public int getSpansCount() {
- return segmentObject.getSpansCount();
- }
-
- public SpanDecorator getSpans(int index) {
- if (isOrigin) {
- return new SpanDecorator(segmentObject.getSpans(index), this);
- } else {
- return new SpanDecorator(segmentBuilder.getSpansBuilder(index), this);
- }
- }
-
- public int getRefsCount() {
- return segmentObject.getRefsCount();
- }
-
- public ReferenceDecorator getRefs(int index) {
- if (isOrigin) {
- return new ReferenceDecorator(segmentObject.getRefs(index), this);
- } else {
- return new ReferenceDecorator(segmentBuilder.getRefsBuilder(index), this);
- }
- }
-
- public byte[] toByteArray() {
- if (isOrigin) {
- return segmentObject.toByteArray();
- } else {
- return segmentBuilder.build().toByteArray();
- }
- }
-
- @Override public void toBuilder() {
- if (isOrigin) {
- this.isOrigin = false;
- this.segmentBuilder = segmentObject.toBuilder();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentStandardizationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentStandardizationWorker.java
deleted file mode 100644
index 529ca69b9b6f87fb8e7e58154a216083938e86ae..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SegmentStandardizationWorker.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.buffer.SegmentBufferManager;
-import org.skywalking.apm.collector.core.queue.EndOfBatchCommand;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.impl.FlushAndSwitch;
-import org.skywalking.apm.collector.stream.worker.selector.ForeverFirstSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentStandardizationWorker extends AbstractLocalAsyncWorker {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentStandardizationWorker.class);
-
- public SegmentStandardizationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- SegmentBufferManager.INSTANCE.initialize();
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- if (message instanceof FlushAndSwitch) {
- SegmentBufferManager.INSTANCE.flush();
- } else if (message instanceof EndOfBatchCommand) {
- } else if (message instanceof UpstreamSegment) {
- UpstreamSegment upstreamSegment = (UpstreamSegment)message;
- SegmentBufferManager.INSTANCE.writeBuffer(upstreamSegment);
- } else {
- logger.error("unhandled message, message instance must UpstreamSegment, but is %s", message.getClass().toString());
- }
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return SegmentStandardizationWorker.WorkerRole.INSTANCE;
- }
-
- @Override
- public SegmentStandardizationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new SegmentStandardizationWorker(role(), clusterContext);
- }
-
- @Override public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return SegmentStandardizationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new ForeverFirstSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return null;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanDecorator.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanDecorator.java
deleted file mode 100644
index e4373ae36fdbad702804b49d47c2bc7caed60f96..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanDecorator.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-
-/**
- * @author peng-yongsheng
- */
-public class SpanDecorator implements StandardBuilder {
- private boolean isOrigin = true;
- private StandardBuilder standardBuilder;
- private SpanObject spanObject;
- private SpanObject.Builder spanBuilder;
-
- public SpanDecorator(SpanObject spanObject, StandardBuilder standardBuilder) {
- this.spanObject = spanObject;
- this.standardBuilder = standardBuilder;
- }
-
- public SpanDecorator(SpanObject.Builder spanBuilder, StandardBuilder standardBuilder) {
- this.spanBuilder = spanBuilder;
- this.standardBuilder = standardBuilder;
- this.isOrigin = false;
- }
-
- public int getSpanId() {
- if (isOrigin) {
- return spanObject.getSpanId();
- } else {
- return spanBuilder.getSpanId();
- }
- }
-
- public int getParentSpanId() {
- if (isOrigin) {
- return spanObject.getParentSpanId();
- } else {
- return spanBuilder.getParentSpanId();
- }
- }
-
- public SpanType getSpanType() {
- if (isOrigin) {
- return spanObject.getSpanType();
- } else {
- return spanBuilder.getSpanType();
- }
- }
-
- public int getSpanTypeValue() {
- if (isOrigin) {
- return spanObject.getSpanTypeValue();
- } else {
- return spanBuilder.getSpanTypeValue();
- }
- }
-
- public SpanLayer getSpanLayer() {
- if (isOrigin) {
- return spanObject.getSpanLayer();
- } else {
- return spanBuilder.getSpanLayer();
- }
- }
-
- public int getSpanLayerValue() {
- if (isOrigin) {
- return spanObject.getSpanLayerValue();
- } else {
- return spanBuilder.getSpanLayerValue();
- }
- }
-
- public long getStartTime() {
- if (isOrigin) {
- return spanObject.getStartTime();
- } else {
- return spanBuilder.getStartTime();
- }
- }
-
- public long getEndTime() {
- if (isOrigin) {
- return spanObject.getEndTime();
- } else {
- return spanBuilder.getEndTime();
- }
- }
-
- public int getComponentId() {
- if (isOrigin) {
- return spanObject.getComponentId();
- } else {
- return spanBuilder.getComponentId();
- }
- }
-
- public String getComponent() {
- if (isOrigin) {
- return spanObject.getComponent();
- } else {
- return spanBuilder.getComponent();
- }
- }
-
- public int getPeerId() {
- if (isOrigin) {
- return spanObject.getPeerId();
- } else {
- return spanBuilder.getPeerId();
- }
- }
-
- public void setPeerId(int peerId) {
- if (isOrigin) {
- toBuilder();
- }
- spanBuilder.setPeerId(peerId);
- }
-
- public String getPeer() {
- if (isOrigin) {
- return spanObject.getPeer();
- } else {
- return spanBuilder.getPeer();
- }
- }
-
- public void setPeer(String peer) {
- if (isOrigin) {
- toBuilder();
- }
- spanBuilder.setPeer(peer);
- }
-
- public int getOperationNameId() {
- if (isOrigin) {
- return spanObject.getOperationNameId();
- } else {
- return spanBuilder.getOperationNameId();
- }
- }
-
- public void setOperationNameId(int value) {
- if (isOrigin) {
- toBuilder();
- }
- spanBuilder.setOperationNameId(value);
- }
-
- public String getOperationName() {
- if (isOrigin) {
- return spanObject.getOperationName();
- } else {
- return spanBuilder.getOperationName();
- }
- }
-
- public void setOperationName(String value) {
- if (isOrigin) {
- toBuilder();
- }
- spanBuilder.setOperationName(value);
- }
-
- public boolean getIsError() {
- if (isOrigin) {
- return spanObject.getIsError();
- } else {
- return spanBuilder.getIsError();
- }
- }
-
- @Override public void toBuilder() {
- if (this.isOrigin) {
- this.isOrigin = false;
- spanBuilder = spanObject.toBuilder();
- standardBuilder.toBuilder();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanIdExchanger.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanIdExchanger.java
deleted file mode 100644
index 2a5cfe6c1c8c65852918f1dc9878f0c8429a34ad..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/SpanIdExchanger.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-import org.skywalking.apm.collector.agentregister.servicename.ServiceNameService;
-import org.skywalking.apm.collector.cache.ApplicationCache;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class SpanIdExchanger implements IdExchanger {
-
- private static SpanIdExchanger EXCHANGER;
- private ServiceNameService serviceNameService;
-
- public static SpanIdExchanger getInstance() {
- if (EXCHANGER == null) {
- EXCHANGER = new SpanIdExchanger();
- }
- return EXCHANGER;
- }
-
- public SpanIdExchanger() {
- serviceNameService = new ServiceNameService();
- }
-
- @Override public boolean exchange(SpanDecorator standardBuilder, int applicationId) {
- if (standardBuilder.getPeerId() == 0 && StringUtils.isNotEmpty(standardBuilder.getPeer())) {
- int peerId = ApplicationCache.get(standardBuilder.getPeer());
- if (peerId == 0) {
- return false;
- } else {
- standardBuilder.toBuilder();
- standardBuilder.setPeerId(peerId);
- standardBuilder.setPeer(Const.EMPTY_STRING);
- }
- }
-
- if (standardBuilder.getOperationNameId() == 0 && StringUtils.isNotEmpty(standardBuilder.getOperationName())) {
- int operationNameId = serviceNameService.getOrCreate(applicationId, standardBuilder.getOperationName());
- if (operationNameId == 0) {
- return false;
- } else {
- standardBuilder.toBuilder();
- standardBuilder.setOperationNameId(operationNameId);
- standardBuilder.setOperationName(Const.EMPTY_STRING);
- }
- }
- return true;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/StandardBuilder.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/StandardBuilder.java
deleted file mode 100644
index 8002fd6e27b0160f3c7cbbcd16407952d1f23d2c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/segment/standardization/StandardBuilder.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.standardization;
-
-/**
- * @author peng-yongsheng
- */
-public interface StandardBuilder {
- void toBuilder();
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryAggregationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryAggregationWorker.java
deleted file mode 100644
index f155e0d9f2dcd3f4d2ea0447c81e9e811a31dd8e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryAggregationWorker.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerRefs;
-import org.skywalking.apm.collector.stream.worker.impl.AggregationWorker;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryAggregationWorker extends AggregationWorker {
-
- public ServiceEntryAggregationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected WorkerRefs nextWorkRef(String id) throws WorkerNotFoundException {
- return getClusterContext().lookup(ServiceEntryRemoteWorker.WorkerRole.INSTANCE);
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceEntryAggregationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceEntryAggregationWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceEntryAggregationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceEntryDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryPersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryPersistenceWorker.java
deleted file mode 100644
index f0e2e196cde74faf00f897ad90e340b488b25524..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryPersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry;
-
-import org.skywalking.apm.collector.agentstream.worker.service.entry.dao.IServiceEntryDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryPersistenceWorker extends PersistenceWorker {
-
- public ServiceEntryPersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IServiceEntryDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceEntryPersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceEntryPersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceEntryPersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceEntryDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryRemoteWorker.java
deleted file mode 100644
index 5dc4c435410651bdf8a6f19685f4b3caac9f3a34..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntryRemoteWorker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryRemoteWorker extends AbstractRemoteWorker {
-
- protected ServiceEntryRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
-
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- getClusterContext().lookup(ServiceEntryPersistenceWorker.WorkerRole.INSTANCE).tell(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceEntryRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceEntryRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceEntryRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceEntryDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntrySpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntrySpanListener.java
deleted file mode 100644
index 615b16536225fdbb7c6810f5de4d35ae1b9c0b0f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/ServiceEntrySpanListener.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.RefsListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.cache.ServiceNameCache;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntrySpanListener implements RefsListener, FirstSpanListener, EntrySpanListener {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceEntrySpanListener.class);
-
- private long timeBucket;
- private boolean hasReference = false;
- private int applicationId;
- private int entryServiceId;
- private String entryServiceName;
- private boolean hasEntry = false;
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- this.applicationId = applicationId;
- this.entryServiceId = spanDecorator.getOperationNameId();
- this.entryServiceName = ServiceNameCache.getSplitServiceName(ServiceNameCache.get(entryServiceId));
- this.hasEntry = true;
- }
-
- @Override public void parseRef(ReferenceDecorator referenceDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- hasReference = true;
- }
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
- }
-
- @Override public void build() {
- logger.debug("entry service listener build");
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
- if (!hasReference && hasEntry) {
- ServiceEntryDataDefine.ServiceEntry serviceEntry = new ServiceEntryDataDefine.ServiceEntry();
- serviceEntry.setId(applicationId + Const.ID_SPLIT + entryServiceId);
- serviceEntry.setApplicationId(applicationId);
- serviceEntry.setEntryServiceId(entryServiceId);
- serviceEntry.setEntryServiceName(entryServiceName);
- serviceEntry.setRegisterTime(timeBucket);
- serviceEntry.setNewestTime(timeBucket);
-
- try {
- logger.debug("send to service entry aggregation worker, id: {}", serviceEntry.getId());
- context.getClusterWorkerContext().lookup(ServiceEntryAggregationWorker.WorkerRole.INSTANCE).tell(serviceEntry.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/IServiceEntryDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/IServiceEntryDAO.java
deleted file mode 100644
index eb1fc88c4bfbbcecd5caaf2410cab33de786f080..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/IServiceEntryDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IServiceEntryDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryEsDAO.java
deleted file mode 100644
index 29ee4d2b82950cf1bf242de394b12e19346868fc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryEsDAO.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryEsDAO extends EsDAO implements IServiceEntryDAO, IPersistenceDAO {
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(ServiceEntryTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, ((Number)source.get(ServiceEntryTable.COLUMN_APPLICATION_ID)).intValue());
- data.setDataInteger(1, ((Number)source.get(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID)).intValue());
- data.setDataString(1, (String)source.get(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME));
- data.setDataLong(0, ((Number)source.get(ServiceEntryTable.COLUMN_REGISTER_TIME)).longValue());
- data.setDataLong(1, ((Number)source.get(ServiceEntryTable.COLUMN_NEWEST_TIME)).longValue());
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(ServiceEntryTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceEntryTable.COLUMN_REGISTER_TIME, data.getDataLong(0));
- source.put(ServiceEntryTable.COLUMN_NEWEST_TIME, data.getDataLong(1));
- return getClient().prepareIndex(ServiceEntryTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(ServiceEntryTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceEntryTable.COLUMN_REGISTER_TIME, data.getDataLong(0));
- source.put(ServiceEntryTable.COLUMN_NEWEST_TIME, data.getDataLong(1));
-
- return getClient().prepareUpdate(ServiceEntryTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryH2DAO.java
deleted file mode 100644
index 415a9f3c0033f08d39e4f729769547946ce75984..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/dao/ServiceEntryH2DAO.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ServiceEntryH2DAO extends H2DAO implements IServiceEntryDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(ServiceEntryH2DAO.class);
- private static final String GET_SERVICE_ENTRY_SQL = "select * from {0} where {1} = ?";
-
- @Override public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SERVICE_ENTRY_SQL, ServiceEntryTable.TABLE, ServiceEntryTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(ServiceEntryTable.COLUMN_APPLICATION_ID));
- data.setDataInteger(1, rs.getInt(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID));
- data.setDataString(1, rs.getString(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME));
- data.setDataLong(0, rs.getLong(ServiceEntryTable.COLUMN_REGISTER_TIME));
- data.setDataLong(1, rs.getLong(ServiceEntryTable.COLUMN_NEWEST_TIME));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(ServiceEntryTable.COLUMN_ID, data.getDataString(0));
- source.put(ServiceEntryTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceEntryTable.COLUMN_REGISTER_TIME, data.getDataLong(0));
- source.put(ServiceEntryTable.COLUMN_NEWEST_TIME, data.getDataLong(1));
- String sql = SqlBuilder.buildBatchInsertSql(ServiceEntryTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override public H2SqlEntity prepareBatchUpdate(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(ServiceEntryTable.COLUMN_APPLICATION_ID, data.getDataInteger(0));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceEntryTable.COLUMN_REGISTER_TIME, data.getDataLong(0));
- source.put(ServiceEntryTable.COLUMN_NEWEST_TIME, data.getDataLong(1));
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(ServiceEntryTable.TABLE, source.keySet(), ServiceEntryTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryEsTableDefine.java
deleted file mode 100644
index 7abb59b1272ca655783d0fa9cbcc6bced9ba2dca..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryEsTableDefine.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry.define;
-
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryEsTableDefine extends ElasticSearchTableDefine {
-
- public ServiceEntryEsTableDefine() {
- super(ServiceEntryTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(ServiceEntryTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, ElasticSearchColumnDefine.Type.Text.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceEntryTable.COLUMN_REGISTER_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceEntryTable.COLUMN_NEWEST_TIME, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryH2TableDefine.java
deleted file mode 100644
index e814f2f006053c110fd452509490e83d20cbb111..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/service/entry/define/ServiceEntryH2TableDefine.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.service.entry.define;
-
-import org.skywalking.apm.collector.storage.base.define.service.ServiceEntryTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceEntryH2TableDefine extends H2TableDefine {
-
- public ServiceEntryH2TableDefine() {
- super(ServiceEntryTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_ENTRY_SERVICE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_ENTRY_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_REGISTER_TIME, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceEntryTable.COLUMN_NEWEST_TIME, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceAggregationWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceAggregationWorker.java
deleted file mode 100644
index d5e5d3eb6ceb8ac35590210dbfed31cf0e08c05c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceAggregationWorker.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerRefs;
-import org.skywalking.apm.collector.stream.worker.impl.AggregationWorker;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceAggregationWorker extends AggregationWorker {
-
- public ServiceReferenceAggregationWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected WorkerRefs nextWorkRef(String id) throws WorkerNotFoundException {
- return getClusterContext().lookup(ServiceReferenceRemoteWorker.WorkerRole.INSTANCE);
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceReferenceAggregationWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceReferenceAggregationWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceReferenceAggregationWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferencePersistenceWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferencePersistenceWorker.java
deleted file mode 100644
index 8bd2ab9e72e558fa668104300072c1b57bfacf93..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferencePersistenceWorker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref;
-
-import org.skywalking.apm.collector.agentstream.worker.serviceref.dao.IServiceReferenceDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractLocalAsyncWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferencePersistenceWorker extends PersistenceWorker {
-
- public ServiceReferencePersistenceWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
- super.preStart();
- }
-
- @Override protected boolean needMergeDBData() {
- return true;
- }
-
- @Override protected IPersistenceDAO persistenceDAO() {
- return (IPersistenceDAO)DAOContainer.INSTANCE.get(IServiceReferenceDAO.class.getName());
- }
-
- public static class Factory extends AbstractLocalAsyncWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceReferencePersistenceWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceReferencePersistenceWorker(role(), clusterContext);
- }
-
- @Override
- public int queueSize() {
- return 1024;
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceReferencePersistenceWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceRemoteWorker.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceRemoteWorker.java
deleted file mode 100644
index 7aa6e97f7f16b12db88fd611d4e56d71b4f3bd37..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceRemoteWorker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref;
-
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceDataDefine;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorker;
-import org.skywalking.apm.collector.stream.worker.AbstractRemoteWorkerProvider;
-import org.skywalking.apm.collector.stream.worker.ClusterWorkerContext;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.Role;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.selector.HashCodeSelector;
-import org.skywalking.apm.collector.stream.worker.selector.WorkerSelector;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceRemoteWorker extends AbstractRemoteWorker {
-
- protected ServiceReferenceRemoteWorker(Role role, ClusterWorkerContext clusterContext) {
- super(role, clusterContext);
- }
-
- @Override public void preStart() throws ProviderNotFoundException {
-
- }
-
- @Override protected void onWork(Object message) throws WorkerException {
- getClusterContext().lookup(ServiceReferencePersistenceWorker.WorkerRole.INSTANCE).tell(message);
- }
-
- public static class Factory extends AbstractRemoteWorkerProvider {
- @Override
- public Role role() {
- return WorkerRole.INSTANCE;
- }
-
- @Override
- public ServiceReferenceRemoteWorker workerInstance(ClusterWorkerContext clusterContext) {
- return new ServiceReferenceRemoteWorker(role(), clusterContext);
- }
- }
-
- public enum WorkerRole implements Role {
- INSTANCE;
-
- @Override
- public String roleName() {
- return ServiceReferenceRemoteWorker.class.getSimpleName();
- }
-
- @Override
- public WorkerSelector workerSelector() {
- return new HashCodeSelector();
- }
-
- @Override public DataDefine dataDefine() {
- return new ServiceReferenceDataDefine();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceSpanListener.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceSpanListener.java
deleted file mode 100644
index 0115fc58e5fab77a069af0a6f7a6c0903f2c1535..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceSpanListener.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.agentstream.worker.segment.EntrySpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.FirstSpanListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.RefsListener;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.ReferenceDecorator;
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SpanDecorator;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceDataDefine;
-import org.skywalking.apm.collector.stream.StreamModuleContext;
-import org.skywalking.apm.collector.stream.StreamModuleGroupDefine;
-import org.skywalking.apm.collector.stream.worker.WorkerInvokeException;
-import org.skywalking.apm.collector.stream.worker.WorkerNotFoundException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceSpanListener implements FirstSpanListener, EntrySpanListener, RefsListener {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceReferenceSpanListener.class);
-
- private List referenceServices = new LinkedList<>();
- private int serviceId = 0;
- private long startTime = 0;
- private long endTime = 0;
- private boolean isError = false;
- private long timeBucket;
- private boolean hasEntry = false;
-
- @Override
- public void parseFirst(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime());
- }
-
- @Override public void parseRef(ReferenceDecorator referenceDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- referenceServices.add(referenceDecorator);
- }
-
- @Override
- public void parseEntry(SpanDecorator spanDecorator, int applicationId, int applicationInstanceId,
- String segmentId) {
- serviceId = spanDecorator.getOperationNameId();
- startTime = spanDecorator.getStartTime();
- endTime = spanDecorator.getEndTime();
- isError = spanDecorator.getIsError();
- this.hasEntry = true;
- }
-
- private void calculateCost(ServiceReferenceDataDefine.ServiceReference serviceReference, long startTime,
- long endTime,
- boolean isError) {
- long cost = endTime - startTime;
- if (cost <= 1000 && !isError) {
- serviceReference.setS1Lte(1);
- } else if (1000 < cost && cost <= 3000 && !isError) {
- serviceReference.setS3Lte(1);
- } else if (3000 < cost && cost <= 5000 && !isError) {
- serviceReference.setS5Lte(1);
- } else if (5000 < cost && !isError) {
- serviceReference.setS5Gt(1);
- } else {
- serviceReference.setError(1);
- }
- serviceReference.setSummary(1);
- serviceReference.setCostSummary(cost);
- }
-
- @Override public void build() {
- logger.debug("service reference listener build");
- if (hasEntry) {
- StreamModuleContext context = (StreamModuleContext)CollectorContextHelper.INSTANCE.getContext(StreamModuleGroupDefine.GROUP_NAME);
-
- if (referenceServices.size() > 0) {
- referenceServices.forEach(reference -> {
- ServiceReferenceDataDefine.ServiceReference serviceReference = new ServiceReferenceDataDefine.ServiceReference();
- int entryServiceId = reference.getEntryServiceId();
- int frontServiceId = reference.getParentServiceId();
- int behindServiceId = serviceId;
- calculateCost(serviceReference, startTime, endTime, isError);
-
- logger.debug("has reference, entryServiceId: {}", entryServiceId);
- sendToAggregationWorker(context, serviceReference, entryServiceId, frontServiceId, behindServiceId);
- });
- } else {
- ServiceReferenceDataDefine.ServiceReference serviceReference = new ServiceReferenceDataDefine.ServiceReference();
- int entryServiceId = serviceId;
- int frontServiceId = Const.NONE_SERVICE_ID;
- int behindServiceId = serviceId;
-
- calculateCost(serviceReference, startTime, endTime, isError);
- sendToAggregationWorker(context, serviceReference, entryServiceId, frontServiceId, behindServiceId);
- }
- }
- }
-
- private void sendToAggregationWorker(StreamModuleContext context,
- ServiceReferenceDataDefine.ServiceReference serviceReference, int entryServiceId, int frontServiceId,
- int behindServiceId) {
- StringBuilder idBuilder = new StringBuilder();
- idBuilder.append(timeBucket).append(Const.ID_SPLIT);
-
- idBuilder.append(entryServiceId).append(Const.ID_SPLIT);
- serviceReference.setEntryServiceId(entryServiceId);
- serviceReference.setEntryServiceName(Const.EMPTY_STRING);
-
- idBuilder.append(frontServiceId).append(Const.ID_SPLIT);
- serviceReference.setFrontServiceId(frontServiceId);
- serviceReference.setFrontServiceName(Const.EMPTY_STRING);
-
- idBuilder.append(behindServiceId);
- serviceReference.setBehindServiceId(behindServiceId);
- serviceReference.setBehindServiceName(Const.EMPTY_STRING);
-
- serviceReference.setId(idBuilder.toString());
- serviceReference.setTimeBucket(timeBucket);
- try {
- logger.debug("send to service reference aggregation worker, id: {}", serviceReference.getId());
- context.getClusterWorkerContext().lookup(ServiceReferenceAggregationWorker.WorkerRole.INSTANCE).tell(serviceReference.toData());
- } catch (WorkerInvokeException | WorkerNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/IServiceReferenceDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/IServiceReferenceDAO.java
deleted file mode 100644
index 15c9e4a4a08e94b56a4dcee2747b77b6750abeb6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/IServiceReferenceDAO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IServiceReferenceDAO {
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceEsDAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceEsDAO.java
deleted file mode 100644
index e60d1eed9423a68c0a3ec51e6908e343b7e7db73..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceEsDAO.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref.dao;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO, IPersistenceDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceReferenceEsDAO.class);
-
- @Override public Data get(String id, DataDefine dataDefine) {
- GetResponse getResponse = getClient().prepareGet(ServiceReferenceTable.TABLE, id).get();
- if (getResponse.isExists()) {
- Data data = dataDefine.build(id);
- Map source = getResponse.getSource();
- data.setDataInteger(0, ((Number)source.get(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID)).intValue());
- data.setDataString(1, (String)source.get(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME));
- data.setDataInteger(1, ((Number)source.get(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID)).intValue());
- data.setDataString(2, (String)source.get(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME));
- data.setDataInteger(2, ((Number)source.get(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID)).intValue());
- data.setDataString(3, (String)source.get(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME));
- data.setDataLong(0, ((Number)source.get(ServiceReferenceTable.COLUMN_S1_LTE)).longValue());
- data.setDataLong(1, ((Number)source.get(ServiceReferenceTable.COLUMN_S3_LTE)).longValue());
- data.setDataLong(2, ((Number)source.get(ServiceReferenceTable.COLUMN_S5_LTE)).longValue());
- data.setDataLong(3, ((Number)source.get(ServiceReferenceTable.COLUMN_S5_GT)).longValue());
- data.setDataLong(4, ((Number)source.get(ServiceReferenceTable.COLUMN_SUMMARY)).longValue());
- data.setDataLong(5, ((Number)source.get(ServiceReferenceTable.COLUMN_ERROR)).longValue());
- data.setDataLong(6, ((Number)source.get(ServiceReferenceTable.COLUMN_COST_SUMMARY)).longValue());
- data.setDataLong(7, ((Number)source.get(ServiceReferenceTable.COLUMN_TIME_BUCKET)).longValue());
- return data;
- } else {
- return null;
- }
- }
-
- @Override public IndexRequestBuilder prepareBatchInsert(Data data) {
- Map source = new HashMap<>();
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(0));
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, data.getDataString(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, data.getDataInteger(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, data.getDataString(3));
- source.put(ServiceReferenceTable.COLUMN_S1_LTE, data.getDataLong(0));
- source.put(ServiceReferenceTable.COLUMN_S3_LTE, data.getDataLong(1));
- source.put(ServiceReferenceTable.COLUMN_S5_LTE, data.getDataLong(2));
- source.put(ServiceReferenceTable.COLUMN_S5_GT, data.getDataLong(3));
- source.put(ServiceReferenceTable.COLUMN_SUMMARY, data.getDataLong(4));
- source.put(ServiceReferenceTable.COLUMN_ERROR, data.getDataLong(5));
- source.put(ServiceReferenceTable.COLUMN_COST_SUMMARY, data.getDataLong(6));
- source.put(ServiceReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(7));
-
- return getClient().prepareIndex(ServiceReferenceTable.TABLE, data.getDataString(0)).setSource(source);
- }
-
- @Override public UpdateRequestBuilder prepareBatchUpdate(Data data) {
- Map source = new HashMap<>();
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(0));
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, data.getDataString(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, data.getDataInteger(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, data.getDataString(3));
- source.put(ServiceReferenceTable.COLUMN_S1_LTE, data.getDataLong(0));
- source.put(ServiceReferenceTable.COLUMN_S3_LTE, data.getDataLong(1));
- source.put(ServiceReferenceTable.COLUMN_S5_LTE, data.getDataLong(2));
- source.put(ServiceReferenceTable.COLUMN_S5_GT, data.getDataLong(3));
- source.put(ServiceReferenceTable.COLUMN_SUMMARY, data.getDataLong(4));
- source.put(ServiceReferenceTable.COLUMN_ERROR, data.getDataLong(5));
- source.put(ServiceReferenceTable.COLUMN_COST_SUMMARY, data.getDataLong(6));
- source.put(ServiceReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(7));
-
- return getClient().prepareUpdate(ServiceReferenceTable.TABLE, data.getDataString(0)).setDoc(source);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceH2DAO.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceH2DAO.java
deleted file mode 100644
index 2095f4958df7e039514b2b96d1ab79c2c858f64d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/dao/ServiceReferenceH2DAO.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.stream.Data;
-import org.skywalking.apm.collector.storage.base.define.DataDefine;
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
-import org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ServiceReferenceH2DAO extends H2DAO implements IServiceReferenceDAO, IPersistenceDAO {
- private final Logger logger = LoggerFactory.getLogger(ServiceReferenceH2DAO.class);
- private static final String GET_SQL = "select * from {0} where {1} = ?";
-
- @Override
- public Data get(String id, DataDefine dataDefine) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SQL, ServiceReferenceTable.TABLE, ServiceReferenceTable.COLUMN_ID);
- Object[] params = new Object[] {id};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- Data data = dataDefine.build(id);
- data.setDataInteger(0, rs.getInt(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID));
- data.setDataString(1, rs.getString(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME));
- data.setDataInteger(1, rs.getInt(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID));
- data.setDataString(2, rs.getString(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME));
- data.setDataInteger(2, rs.getInt(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID));
- data.setDataString(3, rs.getString(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME));
- data.setDataLong(0, rs.getLong(ServiceReferenceTable.COLUMN_S1_LTE));
- data.setDataLong(1, rs.getLong(ServiceReferenceTable.COLUMN_S3_LTE));
- data.setDataLong(2, rs.getLong(ServiceReferenceTable.COLUMN_S5_LTE));
- data.setDataLong(3, rs.getLong(ServiceReferenceTable.COLUMN_S5_GT));
- data.setDataLong(4, rs.getLong(ServiceReferenceTable.COLUMN_SUMMARY));
- data.setDataLong(5, rs.getLong(ServiceReferenceTable.COLUMN_ERROR));
- data.setDataLong(6, rs.getLong(ServiceReferenceTable.COLUMN_COST_SUMMARY));
- data.setDataLong(7, rs.getLong(ServiceReferenceTable.COLUMN_TIME_BUCKET));
- return data;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
-
- @Override
- public H2SqlEntity prepareBatchInsert(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(ServiceReferenceTable.COLUMN_ID, data.getDataString(0));
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(0));
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, data.getDataString(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, data.getDataInteger(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, data.getDataString(3));
- source.put(ServiceReferenceTable.COLUMN_S1_LTE, data.getDataLong(0));
- source.put(ServiceReferenceTable.COLUMN_S3_LTE, data.getDataLong(1));
- source.put(ServiceReferenceTable.COLUMN_S5_LTE, data.getDataLong(2));
- source.put(ServiceReferenceTable.COLUMN_S5_GT, data.getDataLong(3));
- source.put(ServiceReferenceTable.COLUMN_SUMMARY, data.getDataLong(4));
- source.put(ServiceReferenceTable.COLUMN_ERROR, data.getDataLong(5));
- source.put(ServiceReferenceTable.COLUMN_COST_SUMMARY, data.getDataLong(6));
- source.put(ServiceReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(7));
-
- String sql = SqlBuilder.buildBatchInsertSql(ServiceReferenceTable.TABLE, source.keySet());
- entity.setSql(sql);
- entity.setParams(source.values().toArray(new Object[0]));
- return entity;
- }
-
- @Override
- public H2SqlEntity prepareBatchUpdate(Data data) {
- H2SqlEntity entity = new H2SqlEntity();
- Map source = new HashMap<>();
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, data.getDataInteger(0));
- source.put(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, data.getDataString(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, data.getDataInteger(1));
- source.put(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, data.getDataString(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, data.getDataInteger(2));
- source.put(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, data.getDataString(3));
- source.put(ServiceReferenceTable.COLUMN_S1_LTE, data.getDataLong(0));
- source.put(ServiceReferenceTable.COLUMN_S3_LTE, data.getDataLong(1));
- source.put(ServiceReferenceTable.COLUMN_S5_LTE, data.getDataLong(2));
- source.put(ServiceReferenceTable.COLUMN_S5_GT, data.getDataLong(3));
- source.put(ServiceReferenceTable.COLUMN_SUMMARY, data.getDataLong(4));
- source.put(ServiceReferenceTable.COLUMN_ERROR, data.getDataLong(5));
- source.put(ServiceReferenceTable.COLUMN_COST_SUMMARY, data.getDataLong(6));
- source.put(ServiceReferenceTable.COLUMN_TIME_BUCKET, data.getDataLong(7));
-
- String id = data.getDataString(0);
- String sql = SqlBuilder.buildBatchUpdateSql(ServiceReferenceTable.TABLE, source.keySet(), ServiceReferenceTable.COLUMN_ID);
- entity.setSql(sql);
- List values = new ArrayList<>(source.values());
- values.add(id);
- entity.setParams(values.toArray(new Object[0]));
- return entity;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceEsTableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceEsTableDefine.java
deleted file mode 100644
index bcd04c2d2ffc48c921d56e637ddf8386e7d510cb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceEsTableDefine.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref.define;
-
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceEsTableDefine extends ElasticSearchTableDefine {
-
- public ServiceReferenceEsTableDefine() {
- super(ServiceReferenceTable.TABLE);
- }
-
- @Override public int refreshInterval() {
- return 2;
- }
-
- @Override public void initialize() {
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_AGG, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, ElasticSearchColumnDefine.Type.Keyword.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_S1_LTE, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_S3_LTE, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_S5_LTE, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_S5_GT, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_SUMMARY, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_ERROR, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_COST_SUMMARY, ElasticSearchColumnDefine.Type.Long.name()));
- addColumn(new ElasticSearchColumnDefine(ServiceReferenceTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceH2TableDefine.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceH2TableDefine.java
deleted file mode 100644
index fc344793fe0ce2eecb8cec2837bc21e38a8bc144..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/define/ServiceReferenceH2TableDefine.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.serviceref.define;
-
-import org.skywalking.apm.collector.storage.base.define.serviceref.ServiceReferenceTable;
-import org.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
-import org.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceReferenceH2TableDefine extends H2TableDefine {
-
- public ServiceReferenceH2TableDefine() {
- super(ServiceReferenceTable.TABLE);
- }
-
- @Override public void initialize() {
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_ENTRY_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_FRONT_SERVICE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_FRONT_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_BEHIND_SERVICE_NAME, H2ColumnDefine.Type.Varchar.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_S1_LTE, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_S3_LTE, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_S5_LTE, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_S5_GT, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_SUMMARY, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_ERROR, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_COST_SUMMARY, H2ColumnDefine.Type.Bigint.name()));
- addColumn(new H2ColumnDefine(ServiceReferenceTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/storage/PersistenceTimer.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/storage/PersistenceTimer.java
deleted file mode 100644
index 475a339619293239b5591cd6894c8ed5582a13f3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/storage/PersistenceTimer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.storage;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import org.skywalking.apm.collector.core.framework.Starter;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.dao.IBatchDAO;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.collector.stream.worker.impl.FlushAndSwitch;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
-import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorkerContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class PersistenceTimer implements Starter {
-
- private final Logger logger = LoggerFactory.getLogger(PersistenceTimer.class);
-
- public void start() {
- logger.info("persistence timer start");
- //TODO timer value config
-// final long timeInterval = EsConfig.Es.Persistence.Timer.VALUE * 1000;
- final long timeInterval = 3;
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> extractDataAndSave(), 1, timeInterval, TimeUnit.SECONDS);
- }
-
- private void extractDataAndSave() {
- try {
- List workers = PersistenceWorkerContainer.INSTANCE.getPersistenceWorkers();
- List batchAllCollection = new ArrayList<>();
- workers.forEach((PersistenceWorker worker) -> {
- logger.debug("extract {} worker data and save", worker.getRole().roleName());
- try {
- worker.allocateJob(new FlushAndSwitch());
- List> batchCollection = worker.buildBatchCollection();
- logger.debug("extract {} worker data size: {}", worker.getRole().roleName(), batchCollection.size());
- batchAllCollection.addAll(batchCollection);
- } catch (WorkerException e) {
- logger.error(e.getMessage(), e);
- }
- });
-
- IBatchDAO dao = (IBatchDAO)DAOContainer.INSTANCE.get(IBatchDAO.class.getName());
- dao.batchPersistence(batchAllCollection);
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- } finally {
- logger.debug("persistence data save finish");
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/util/FileUtils.java b/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/util/FileUtils.java
deleted file mode 100644
index 08e79cb6d424fd01db1cd3e6fe7cd813ec1bf3a0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/util/FileUtils.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import org.skywalking.apm.collector.core.util.Const;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum FileUtils {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(FileUtils.class);
-
- public String readLastLine(File file) {
- RandomAccessFile randomAccessFile = null;
- try {
- randomAccessFile = new RandomAccessFile(file, "r");
- long length = randomAccessFile.length();
- if (length == 0) {
- return Const.EMPTY_STRING;
- } else {
- long position = length - 1;
- randomAccessFile.seek(position);
- while (position >= 0) {
- if (randomAccessFile.read() == '\n') {
- return randomAccessFile.readLine();
- }
- randomAccessFile.seek(position);
- if (position == 0) {
- return randomAccessFile.readLine();
- }
- position--;
- }
- }
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- } finally {
- if (randomAccessFile != null) {
- try {
- randomAccessFile.close();
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
- return Const.EMPTY_STRING;
- }
-
- public void writeAppendToLast(File file, RandomAccessFile randomAccessFile, String value) {
- if (randomAccessFile == null) {
- try {
- randomAccessFile = new RandomAccessFile(file, "rwd");
- } catch (FileNotFoundException e) {
- logger.error(e.getMessage(), e);
- }
- }
- try {
- long length = randomAccessFile.length();
- randomAccessFile.seek(length);
- randomAccessFile.writeBytes(System.lineSeparator());
- randomAccessFile.writeBytes(value);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/es_dao.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/es_dao.define
deleted file mode 100644
index 5f55512c3364e05e3cbb3e9ea146b90fa2a6b7ca..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/es_dao.define
+++ /dev/null
@@ -1,9 +0,0 @@
-org.skywalking.apm.collector.agentstream.worker.node.component.dao.NodeComponentEsDAO
-org.skywalking.apm.collector.agentstream.worker.node.mapping.dao.NodeMappingEsDAO
-org.skywalking.apm.collector.agentstream.worker.noderef.dao.NodeReferenceEsDAO
-org.skywalking.apm.collector.agentstream.worker.segment.origin.dao.SegmentEsDAO
-org.skywalking.apm.collector.agentstream.worker.segment.cost.dao.SegmentCostEsDAO
-org.skywalking.apm.collector.agentstream.worker.global.dao.GlobalTraceEsDAO
-org.skywalking.apm.collector.agentstream.worker.service.entry.dao.ServiceEntryEsDAO
-org.skywalking.apm.collector.agentstream.worker.serviceref.dao.ServiceReferenceEsDAO
-org.skywalking.apm.collector.agentstream.worker.instance.performance.dao.InstPerformanceEsDAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/group.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/group.define
deleted file mode 100644
index 2c200d4845f531c0fc115f1c5ffde7cc67f4df1e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/group.define
+++ /dev/null
@@ -1 +0,0 @@
-org.skywalking.apm.collector.agentstream.AgentStreamModuleGroupDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/h2_dao.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/h2_dao.define
deleted file mode 100644
index b1064d603ca35a53bae68a01989ba13411f6c28c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/h2_dao.define
+++ /dev/null
@@ -1,9 +0,0 @@
-org.skywalking.apm.collector.agentstream.worker.node.component.dao.NodeComponentH2DAO
-org.skywalking.apm.collector.agentstream.worker.node.mapping.dao.NodeMappingH2DAO
-org.skywalking.apm.collector.agentstream.worker.noderef.dao.NodeReferenceH2DAO
-org.skywalking.apm.collector.agentstream.worker.segment.origin.dao.SegmentH2DAO
-org.skywalking.apm.collector.agentstream.worker.segment.cost.dao.SegmentCostH2DAO
-org.skywalking.apm.collector.agentstream.worker.global.dao.GlobalTraceH2DAO
-org.skywalking.apm.collector.agentstream.worker.service.entry.dao.ServiceEntryH2DAO
-org.skywalking.apm.collector.agentstream.worker.serviceref.dao.ServiceReferenceH2DAO
-org.skywalking.apm.collector.agentstream.worker.instance.performance.dao.InstPerformanceH2DAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/local_worker_provider.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/local_worker_provider.define
deleted file mode 100644
index 465adeac2503ce737b67594891d005e2ade0de8b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/local_worker_provider.define
+++ /dev/null
@@ -1,22 +0,0 @@
-org.skywalking.apm.collector.agentstream.worker.node.component.NodeComponentAggregationWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.node.component.NodeComponentPersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.node.mapping.NodeMappingAggregationWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.node.mapping.NodeMappingPersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.noderef.NodeReferenceAggregationWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.noderef.NodeReferencePersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.service.entry.ServiceEntryAggregationWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.service.entry.ServiceEntryPersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.serviceref.ServiceReferenceAggregationWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.serviceref.ServiceReferencePersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.segment.origin.SegmentPersistenceWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.segment.cost.SegmentCostPersistenceWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.segment.standardization.SegmentStandardizationWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.global.GlobalTracePersistenceWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.instance.performance.InstPerformancePersistenceWorker$Factory
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/module.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/module.define
deleted file mode 100644
index 7103f42191fb0735f99313641228a2df96e502eb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/module.define
+++ /dev/null
@@ -1,2 +0,0 @@
-org.skywalking.apm.collector.agentstream.grpc.AgentStreamGRPCModuleDefine
-org.skywalking.apm.collector.agentstream.jetty.AgentStreamJettyModuleDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/remote_worker_provider.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/remote_worker_provider.define
deleted file mode 100644
index 17a6ae7b5e32cc2c44d00c507a4b50ce6a8382fd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/remote_worker_provider.define
+++ /dev/null
@@ -1,6 +0,0 @@
-org.skywalking.apm.collector.agentstream.worker.node.component.NodeComponentRemoteWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.node.mapping.NodeMappingRemoteWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.noderef.NodeReferenceRemoteWorker$Factory
-
-org.skywalking.apm.collector.agentstream.worker.service.entry.ServiceEntryRemoteWorker$Factory
-org.skywalking.apm.collector.agentstream.worker.serviceref.ServiceReferenceRemoteWorker$Factory
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/storage.define b/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/storage.define
deleted file mode 100644
index 098e51e7a2be0512012754ec13872ec1e6f77471..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/main/resources/META-INF/defines/storage.define
+++ /dev/null
@@ -1,26 +0,0 @@
-org.skywalking.apm.collector.agentstream.worker.node.component.define.NodeComponentEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.node.component.define.NodeComponentH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.node.mapping.define.NodeMappingEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.node.mapping.define.NodeMappingH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.noderef.define.NodeReferenceEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.noderef.define.NodeReferenceH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.segment.origin.define.SegmentEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.segment.origin.define.SegmentH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.segment.cost.define.SegmentCostEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.segment.cost.define.SegmentCostH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.global.define.GlobalTraceEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.global.define.GlobalTraceH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.service.entry.define.ServiceEntryEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.service.entry.define.ServiceEntryH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.serviceref.define.ServiceReferenceEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.serviceref.define.ServiceReferenceH2TableDefine
-
-org.skywalking.apm.collector.agentstream.worker.instance.performance.define.InstPerformanceEsTableDefine
-org.skywalking.apm.collector.agentstream.worker.instance.performance.define.InstPerformanceH2TableDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/HttpClientTools.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/HttpClientTools.java
deleted file mode 100644
index d90269babcf0d3f02cf31d026bb47b18e11893ca..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/HttpClientTools.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.List;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum HttpClientTools {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(HttpClientTools.class);
-
- public String get(String url, List params) throws IOException {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- try {
- HttpGet httpget = new HttpGet(url);
- String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(params));
- httpget.setURI(new URI(httpget.getURI().toString() + "?" + paramStr));
- logger.debug("executing get request {}", httpget.getURI());
-
- try (CloseableHttpResponse response = httpClient.execute(httpget)) {
- HttpEntity entity = response.getEntity();
- if (entity != null) {
- return EntityUtils.toString(entity);
- }
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- } finally {
- try {
- httpClient.close();
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- }
- return null;
- }
-
- public String post(String url, String data) throws IOException {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- try {
- HttpPost httppost = new HttpPost(url);
- httppost.setEntity(new StringEntity(data, Consts.UTF_8));
- logger.debug("executing post request {}", httppost.getURI());
- try (CloseableHttpResponse response = httpClient.execute(httppost)) {
- HttpEntity entity = response.getEntity();
- if (entity != null) {
- return EntityUtils.toString(entity);
- }
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- } finally {
- try {
- httpClient.close();
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandlerTestCase.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandlerTestCase.java
deleted file mode 100644
index 9ae169960e49a5b2804073d42399a314a605c5a4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/grpc/handler/TraceSegmentServiceHandlerTestCase.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.grpc.handler;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import org.junit.Test;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.KeyWithStringValue;
-import org.skywalking.apm.network.proto.LogMessage;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentReference;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentServiceHandlerTestCase {
-
- private final Logger logger = LoggerFactory.getLogger(TraceSegmentServiceHandlerTestCase.class);
-
- private TraceSegmentServiceGrpc.TraceSegmentServiceStub stub;
-
- @Test
- public void testCollect() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build();
- stub = TraceSegmentServiceGrpc.newStub(channel);
-
- StreamObserver streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
-
- }
- });
-
- UpstreamSegment.Builder builder = UpstreamSegment.newBuilder();
- buildGlobalTraceIds(builder);
- buildSegment(builder);
-
- streamObserver.onNext(builder.build());
- streamObserver.onCompleted();
-
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- }
- }
-
- private void buildGlobalTraceIds(UpstreamSegment.Builder builder) {
- UniqueId.Builder builder1 = UniqueId.newBuilder();
- builder1.addIdParts(100);
- builder1.addIdParts(100);
- builder1.addIdParts(100);
- builder.addGlobalTraceIds(builder1.build());
- }
-
- private void buildSegment(UpstreamSegment.Builder builder) {
- long now = System.currentTimeMillis();
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(2);
- segmentBuilder.setApplicationInstanceId(2);
- segmentBuilder.setTraceSegmentId(UniqueId.newBuilder().addIdParts(200).addIdParts(200).addIdParts(200).build());
-
- SpanObject.Builder span0 = SpanObject.newBuilder();
- span0.setSpanId(0);
- span0.setOperationName("/dubbox-case/case/dubbox-rest");
- span0.setOperationNameId(0);
- span0.setParentSpanId(-1);
- span0.setSpanLayer(SpanLayer.Http);
- span0.setStartTime(now);
- span0.setEndTime(now + 100000);
- span0.setComponentId(ComponentsDefine.TOMCAT.getId());
- span0.setIsError(false);
- span0.setSpanType(SpanType.Entry);
- span0.setPeerId(2);
- span0.setPeer("localhost:8082");
-
- LogMessage.Builder log0 = LogMessage.newBuilder();
- log0.setTime(now);
- log0.addData(KeyWithStringValue.newBuilder().setKey("log1").setValue("value1"));
- log0.addData(KeyWithStringValue.newBuilder().setKey("log2").setValue("value2"));
- log0.addData(KeyWithStringValue.newBuilder().setKey("log3").setValue("value3"));
- span0.addLogs(log0.build());
-
- span0.addTags(KeyWithStringValue.newBuilder().setKey("tag1").setValue("value1"));
- span0.addTags(KeyWithStringValue.newBuilder().setKey("tag2").setValue("value2"));
- span0.addTags(KeyWithStringValue.newBuilder().setKey("tag3").setValue("value3"));
- segmentBuilder.addSpans(span0);
-
- TraceSegmentReference.Builder ref0 = TraceSegmentReference.newBuilder();
- ref0.setEntryServiceId(1);
- ref0.setEntryServiceName("ServiceName");
- ref0.setNetworkAddress("localhost:8081");
- ref0.setNetworkAddressId(1);
- ref0.setParentApplicationInstanceId(1);
- ref0.setParentServiceId(1);
- ref0.setParentServiceName("");
- ref0.setParentSpanId(2);
- ref0.setParentTraceSegmentId(UniqueId.newBuilder().addIdParts(100).addIdParts(100).addIdParts(100).build());
-// segmentBuilder.addRefs(ref_0);
-
- builder.setSegment(segmentBuilder.build().toByteString());
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReaderTestCase.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReaderTestCase.java
deleted file mode 100644
index 65ec356f85dbf1ee2c86788976cf1d2522089e8a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReaderTestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.jetty.handler.reader;
-
-import com.google.gson.JsonElement;
-import com.google.gson.stream.JsonReader;
-import java.io.IOException;
-import java.io.StringReader;
-import org.junit.Test;
-import org.skywalking.apm.collector.agentstream.mock.JsonFileReader;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceSegmentJsonReaderTestCase {
-
- @Test
- public void testRead() throws IOException {
- TraceSegmentJsonReader reader = new TraceSegmentJsonReader();
- JsonElement jsonElement = JsonFileReader.INSTANCE.read("json/segment/normal/dubbox-consumer.json");
-
- JsonReader jsonReader = new JsonReader(new StringReader(jsonElement.toString()));
- jsonReader.beginArray();
- while (jsonReader.hasNext()) {
- reader.read(jsonReader);
- }
- jsonReader.endArray();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/JsonFileReader.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/JsonFileReader.java
deleted file mode 100644
index a5b171af99dbd10f5604cbd2dd009e5755c7abd0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/JsonFileReader.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum JsonFileReader {
- INSTANCE;
-
- private final Logger logger = LoggerFactory.getLogger(JsonFileReader.class);
-
- public JsonElement read(String fileName) throws FileNotFoundException {
- String path = this.getClass().getClassLoader().getResource(fileName).getFile();
- logger.debug("path: {}", path);
- JsonParser jsonParser = new JsonParser();
- return jsonParser.parse(new FileReader(path));
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/SegmentPost.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/SegmentPost.java
deleted file mode 100644
index 0dd19e4ccb67affe0573512cd65288d7fe8bf986..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/SegmentPost.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.io.IOException;
-import org.skywalking.apm.collector.agentregister.worker.application.dao.IApplicationDAO;
-import org.skywalking.apm.collector.agentregister.worker.instance.dao.IInstanceDAO;
-import org.skywalking.apm.collector.agentregister.worker.servicename.dao.IServiceNameDAO;
-import org.skywalking.apm.collector.agentstream.HttpClientTools;
-import org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.config.SystemConfig;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceDataDefine;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameDataDefine;
-import org.skywalking.apm.collector.storage.elasticsearch.StorageElasticSearchModuleDefine;
-import org.skywalking.apm.collector.storage.h2.StorageH2ModuleDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentPost {
-
- public static void main(String[] args) throws IOException, InterruptedException, CollectorException {
- SystemConfig.DATA_PATH = "/Users/pengys5/code/sky-walking/sky-walking/apm-collector-3.2.3/data";
-
- ElasticSearchClient elasticSearchClient = new ElasticSearchClient("CollectorDBCluster", true, "127.0.0.1:9300");
- elasticSearchClient.initialize();
- StorageElasticSearchModuleDefine storageElasticSearchModuleDefine = new StorageElasticSearchModuleDefine();
- storageElasticSearchModuleDefine.injectClientIntoDAO(elasticSearchClient);
-
- H2Client h2Client = new H2Client("jdbc:h2:tcp://localhost/~/test", "sa", "");
- h2Client.initialize();
- StorageH2ModuleDefine storageH2ModuleDefine = new StorageH2ModuleDefine();
- storageH2ModuleDefine.injectClientIntoDAO(h2Client);
-
- long now = TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis());
-
- IInstanceDAO instanceDAO = (IInstanceDAO)DAOContainer.INSTANCE.get(IInstanceDAO.class.getName());
- InstanceDataDefine.Instance consumerInstance = new InstanceDataDefine.Instance("2", 2, "dubbox-consumer", now, 2, now, osInfo("consumer").toString());
- instanceDAO.save(consumerInstance);
- InstanceDataDefine.Instance providerInstance = new InstanceDataDefine.Instance("3", 3, "dubbox-provider", now, 3, now, osInfo("provider").toString());
- instanceDAO.save(providerInstance);
-
- IApplicationDAO applicationDAO = (IApplicationDAO)DAOContainer.INSTANCE.get(IApplicationDAO.class.getName());
-
- ApplicationDataDefine.Application userApplication = new ApplicationDataDefine.Application("1", "User", 1);
- applicationDAO.save(userApplication);
- ApplicationDataDefine.Application consumerApplication = new ApplicationDataDefine.Application("2", "dubbox-consumer", 2);
- applicationDAO.save(consumerApplication);
- ApplicationDataDefine.Application providerApplication = new ApplicationDataDefine.Application("3", "dubbox-provider", 3);
- applicationDAO.save(providerApplication);
- ApplicationDataDefine.Application peer = new ApplicationDataDefine.Application("4", "172.25.0.4:20880", 4);
- applicationDAO.save(peer);
-
- IServiceNameDAO serviceNameDAO = (IServiceNameDAO)DAOContainer.INSTANCE.get(IServiceNameDAO.class.getName());
-
- ServiceNameDataDefine.ServiceName serviceName1 = new ServiceNameDataDefine.ServiceName("1", "", 0, 1);
- serviceNameDAO.save(serviceName1);
- ServiceNameDataDefine.ServiceName serviceName2 = new ServiceNameDataDefine.ServiceName("2", "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", 2, 2);
- serviceNameDAO.save(serviceName2);
- ServiceNameDataDefine.ServiceName serviceName3 = new ServiceNameDataDefine.ServiceName("3", "/dubbox-case/case/dubbox-rest", 2, 3);
- serviceNameDAO.save(serviceName3);
- ServiceNameDataDefine.ServiceName serviceName4 = new ServiceNameDataDefine.ServiceName("4", "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", 3, 4);
- serviceNameDAO.save(serviceName4);
-
- while (true) {
- JsonElement consumer = JsonFileReader.INSTANCE.read("json/segment/normal/dubbox-consumer.json");
- modifyTime(consumer);
- HttpClientTools.INSTANCE.post("http://localhost:12800/segments", consumer.toString());
-
- JsonElement provider = JsonFileReader.INSTANCE.read("json/segment/normal/dubbox-provider.json");
- modifyTime(provider);
- HttpClientTools.INSTANCE.post("http://localhost:12800/segments", provider.toString());
-
- DIFF = 0;
- Thread.sleep(1000);
- break;
- }
- }
-
- private static long DIFF = 0;
-
- private static void modifyTime(JsonElement jsonElement) {
- JsonArray segmentArray = jsonElement.getAsJsonArray();
- for (JsonElement element : segmentArray) {
- JsonObject segmentObj = element.getAsJsonObject();
- JsonArray spans = segmentObj.get("sg").getAsJsonObject().get("ss").getAsJsonArray();
- for (JsonElement span : spans) {
- long startTime = span.getAsJsonObject().get("st").getAsLong();
- long endTime = span.getAsJsonObject().get("et").getAsLong();
-
- if (DIFF == 0) {
- DIFF = System.currentTimeMillis() - startTime;
- }
-
- span.getAsJsonObject().addProperty("st", startTime + DIFF);
- span.getAsJsonObject().addProperty("et", endTime + DIFF);
- }
- }
- }
-
- private static JsonObject osInfo(String hostName) {
- JsonObject osInfoJson = new JsonObject();
- osInfoJson.addProperty("osName", "Linux");
- osInfoJson.addProperty("hostName", hostName);
- osInfoJson.addProperty("processId", 1);
-
- JsonArray ipv4Array = new JsonArray();
- ipv4Array.add("123.123.123.123");
- ipv4Array.add("124.124.124.124");
- osInfoJson.add("ipv4s", ipv4Array);
-
- return osInfoJson;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ApplicationRegister.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ApplicationRegister.java
deleted file mode 100644
index 3a5a2788d0317845d246bdfbb57400373307a57f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ApplicationRegister.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import org.skywalking.apm.network.proto.Application;
-import org.skywalking.apm.network.proto.ApplicationMapping;
-import org.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationRegister {
-
- public static int register(ManagedChannel channel, String applicationCode) {
- ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub stub = ApplicationRegisterServiceGrpc.newBlockingStub(channel);
- Application application = Application.newBuilder().addApplicationCode(applicationCode).build();
- ApplicationMapping mapping = stub.register(application);
- int applicationId = mapping.getApplication(0).getValue();
-
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
- return applicationId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/GrpcSegmentPost.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/GrpcSegmentPost.java
deleted file mode 100644
index 6c38d44b9c19ac515896c77f49f7a89137c7836b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/GrpcSegmentPost.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import org.junit.Test;
-import org.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.KeyWithStringValue;
-import org.skywalking.apm.network.proto.LogMessage;
-import org.skywalking.apm.network.proto.RefType;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentReference;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class GrpcSegmentPost {
-
- private final Logger logger = LoggerFactory.getLogger(GrpcSegmentPost.class);
-
- private AtomicLong sequence = new AtomicLong(1);
-
- @Test
- public void init() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).maxInboundMessageSize(1024 * 1024 * 50).usePlaintext(true).build();
-
- int consumerApplicationId = 0;
- int providerApplicationId = 0;
- int consumerInstanceId = 0;
- int providerInstanceId = 0;
- int consumerEntryServiceId = 0;
- int consumerExitServiceId = 0;
- int consumerExitApplicationId = 0;
- int providerEntryServiceId = 0;
-
- while (consumerApplicationId == 0) {
- consumerApplicationId = ApplicationRegister.register(channel, "consumer");
- }
- while (consumerExitApplicationId == 0) {
- consumerExitApplicationId = ApplicationRegister.register(channel, "172.25.0.4:20880");
- }
- while (providerApplicationId == 0) {
- providerApplicationId = ApplicationRegister.register(channel, "provider");
- }
- while (consumerInstanceId == 0) {
- consumerInstanceId = InstanceRegister.register(channel, "ConsumerUUID", consumerApplicationId, "consumer_host_name", 1);
- }
- while (providerInstanceId == 0) {
- providerInstanceId = InstanceRegister.register(channel, "ProviderUUID", providerApplicationId, "provider_host_name", 2);
- }
- while (consumerEntryServiceId == 0) {
- consumerEntryServiceId = ServiceRegister.register(channel, consumerApplicationId, "/dubbox-case/case/dubbox-rest");
- }
- while (consumerExitServiceId == 0) {
- consumerExitServiceId = ServiceRegister.register(channel, consumerApplicationId, "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- }
- while (providerEntryServiceId == 0) {
- providerEntryServiceId = ServiceRegister.register(channel, providerApplicationId, "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- }
-
- Ids ids = new Ids();
- ids.setConsumerApplicationId(consumerApplicationId);
- ids.setProviderApplicationId(providerApplicationId);
- ids.setConsumerInstanceId(consumerInstanceId);
- ids.setProviderInstanceId(providerInstanceId);
- ids.setConsumerEntryServiceId(consumerEntryServiceId);
- ids.setConsumerExitServiceId(consumerExitServiceId);
- ids.setConsumerExitApplicationId(consumerExitApplicationId);
-
- long startTime = TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis());
- logger.info("start time: {}", startTime);
-
- int count = 10;
- ThreadCount threadCount = new ThreadCount(count);
- for (int i = 0; i < count; i++) {
- Status status = new Status();
- BuildNewSegment buildNewSegment = new BuildNewSegment(channel, ids, threadCount, i, status);
- Executors.newSingleThreadExecutor().execute(buildNewSegment);
- }
-
- while (threadCount.getCount() != 0) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- long endTime = TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis());
- logger.info("end time: {}", endTime);
-
- channel.shutdownNow();
- while (!channel.isTerminated()) {
- try {
- channel.awaitTermination(100, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-
- class BuildNewSegment implements Runnable {
- private final ManagedChannel segmentChannel;
- private final Ids ids;
- private final ThreadCount threadCount;
- private final int procNo;
- private final Status status;
- private StreamObserver streamObserver;
-
- public BuildNewSegment(ManagedChannel segmentChannel,
- Ids ids, ThreadCount threadCount, int procNo,
- Status status) {
- this.segmentChannel = segmentChannel;
- this.ids = ids;
- this.threadCount = threadCount;
- this.procNo = procNo;
- this.status = status;
- }
-
- @Override public void run() {
- statusChange();
- int i = 0;
- while (i < 50000) {
- send(streamObserver, ids);
-
- i++;
- if (i % 10000 == 0) {
- logger.info("process no: {}, send segment count: {}", procNo, i);
- streamObserver.onCompleted();
- while (!status.isFinish) {
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
- }
- status.setFinish(false);
- statusChange();
- }
- }
- this.threadCount.finishOne();
- }
-
- private void statusChange() {
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(segmentChannel);
- streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- status.setFinish(true);
- logger.info("process no: {}, server completed", procNo);
- }
- });
- }
- }
-
- public void send(StreamObserver streamObserver, Ids ids) {
- long now = System.currentTimeMillis();
- UniqueId consumerSegmentId = createSegmentId();
- UniqueId providerSegmentId = createSegmentId();
-
- streamObserver.onNext(createConsumerSegment(consumerSegmentId, ids, now));
- streamObserver.onNext(createProviderSegment(consumerSegmentId, providerSegmentId, ids, now));
- }
-
- private UpstreamSegment createConsumerSegment(UniqueId segmentId, Ids ids, long timestamp) {
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(ids.consumerApplicationId);
- segmentBuilder.setApplicationInstanceId(ids.consumerInstanceId);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.Http);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(timestamp);
- entrySpan.setEndTime(timestamp + 3000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(ids.getConsumerEntryServiceId());
- entrySpan.setIsError(false);
-
- LogMessage.Builder entryLogMessage = LogMessage.newBuilder();
- entryLogMessage.setTime(timestamp);
-
- KeyWithStringValue.Builder data1 = KeyWithStringValue.newBuilder();
- data1.setKey("url");
- data1.setValue("http://localhost:18080/dubbox-case/case/dubbox-rest");
- entryLogMessage.addData(data1);
-
- KeyWithStringValue.Builder data2 = KeyWithStringValue.newBuilder();
- data2.setKey("http.method");
- data2.setValue("GET");
- entryLogMessage.addData(data2);
- entrySpan.addLogs(entryLogMessage);
- segmentBuilder.addSpans(entrySpan);
-
- SpanObject.Builder exitSpan = SpanObject.newBuilder();
- exitSpan.setSpanId(1);
- exitSpan.setSpanType(SpanType.Exit);
- exitSpan.setSpanLayer(SpanLayer.RPCFramework);
- exitSpan.setParentSpanId(0);
- exitSpan.setStartTime(timestamp + 500);
- exitSpan.setEndTime(timestamp + 2500);
- exitSpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- exitSpan.setOperationNameId(ids.getConsumerExitServiceId());
- exitSpan.setPeerId(ids.consumerExitApplicationId);
- exitSpan.setIsError(false);
-
- LogMessage.Builder exitLogMessage = LogMessage.newBuilder();
- exitLogMessage.setTime(timestamp);
-
- KeyWithStringValue.Builder data = KeyWithStringValue.newBuilder();
- data.setKey("url");
- data.setValue("rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- exitLogMessage.addData(data);
- exitSpan.addLogs(exitLogMessage);
- segmentBuilder.addSpans(exitSpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
- return upstream.build();
- }
-
- private UpstreamSegment createProviderSegment(UniqueId consumerSegmentId, UniqueId providerSegmentId, Ids ids,
- long timestamp) {
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(consumerSegmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(ids.providerApplicationId);
- segmentBuilder.setApplicationInstanceId(ids.providerInstanceId);
- segmentBuilder.setTraceSegmentId(providerSegmentId);
-
- TraceSegmentReference.Builder referenceBuilder = TraceSegmentReference.newBuilder();
- referenceBuilder.setParentTraceSegmentId(consumerSegmentId);
- referenceBuilder.setParentApplicationInstanceId(ids.getConsumerInstanceId());
- referenceBuilder.setParentSpanId(1);
- referenceBuilder.setParentServiceId(ids.getConsumerExitServiceId());
- referenceBuilder.setEntryApplicationInstanceId(ids.getConsumerInstanceId());
- referenceBuilder.setEntryServiceId(ids.getConsumerEntryServiceId());
- referenceBuilder.setNetworkAddressId(ids.consumerExitApplicationId);
- referenceBuilder.setRefType(RefType.CrossProcess);
- segmentBuilder.addRefs(referenceBuilder);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.RPCFramework);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(timestamp + 1000);
- entrySpan.setEndTime(timestamp + 2000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(ids.getProviderEntryServiceId());
- entrySpan.setIsError(false);
-
- LogMessage.Builder entryLogMessage = LogMessage.newBuilder();
- entryLogMessage.setTime(timestamp);
-
- KeyWithStringValue.Builder data1 = KeyWithStringValue.newBuilder();
- data1.setKey("url");
- data1.setValue("rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- entryLogMessage.addData(data1);
-
- KeyWithStringValue.Builder data2 = KeyWithStringValue.newBuilder();
- data2.setKey("http.method");
- data2.setValue("GET");
- entryLogMessage.addData(data2);
- entrySpan.addLogs(entryLogMessage);
- segmentBuilder.addSpans(entrySpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
- return upstream.build();
- }
-
- private UniqueId createSegmentId() {
- long id = sequence.getAndIncrement();
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- return builder.build();
- }
-
- class Ids {
- private int consumerApplicationId = 0;
- private int providerApplicationId = 0;
- private int consumerInstanceId = 0;
- private int providerInstanceId = 0;
- private int consumerEntryServiceId = 0;
- private int consumerExitServiceId = 0;
- private int consumerExitApplicationId = 0;
- private int providerEntryServiceId = 0;
-
- public int getConsumerApplicationId() {
- return consumerApplicationId;
- }
-
- public void setConsumerApplicationId(int consumerApplicationId) {
- this.consumerApplicationId = consumerApplicationId;
- }
-
- public int getProviderApplicationId() {
- return providerApplicationId;
- }
-
- public void setProviderApplicationId(int providerApplicationId) {
- this.providerApplicationId = providerApplicationId;
- }
-
- public int getConsumerInstanceId() {
- return consumerInstanceId;
- }
-
- public void setConsumerInstanceId(int consumerInstanceId) {
- this.consumerInstanceId = consumerInstanceId;
- }
-
- public int getProviderInstanceId() {
- return providerInstanceId;
- }
-
- public void setProviderInstanceId(int providerInstanceId) {
- this.providerInstanceId = providerInstanceId;
- }
-
- public int getConsumerEntryServiceId() {
- return consumerEntryServiceId;
- }
-
- public void setConsumerEntryServiceId(int consumerEntryServiceId) {
- this.consumerEntryServiceId = consumerEntryServiceId;
- }
-
- public int getConsumerExitServiceId() {
- return consumerExitServiceId;
- }
-
- public void setConsumerExitServiceId(int consumerExitServiceId) {
- this.consumerExitServiceId = consumerExitServiceId;
- }
-
- public int getConsumerExitApplicationId() {
- return consumerExitApplicationId;
- }
-
- public void setConsumerExitApplicationId(int consumerExitApplicationId) {
- this.consumerExitApplicationId = consumerExitApplicationId;
- }
-
- public int getProviderEntryServiceId() {
- return providerEntryServiceId;
- }
-
- public void setProviderEntryServiceId(int providerEntryServiceId) {
- this.providerEntryServiceId = providerEntryServiceId;
- }
- }
-
- class ThreadCount {
- private int count;
-
- public ThreadCount(int count) {
- this.count = count;
- }
-
- public void finishOne() {
- count--;
- }
-
- public int getCount() {
- return count;
- }
- }
-
- class Status {
- private boolean isFinish = false;
-
- public boolean isFinish() {
- return isFinish;
- }
-
- public void setFinish(boolean finish) {
- isFinish = finish;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/InstanceRegister.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/InstanceRegister.java
deleted file mode 100644
index 6602d9d4f5f88231ba50f00b9c43a82820c4a4f9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/InstanceRegister.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import org.skywalking.apm.network.proto.ApplicationInstance;
-import org.skywalking.apm.network.proto.ApplicationInstanceMapping;
-import org.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc;
-import org.skywalking.apm.network.proto.OSInfo;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceRegister {
-
- public static int register(ManagedChannel channel, String agentUUId, Integer applicationId,
- String hostName, int processNo) {
- InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub stub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel);
- ApplicationInstance.Builder instance = ApplicationInstance.newBuilder();
- instance.setApplicationId(applicationId);
- instance.setRegisterTime(System.currentTimeMillis());
- instance.setAgentUUID(agentUUId);
-
- OSInfo.Builder osInfo = OSInfo.newBuilder();
- osInfo.setHostname(hostName);
- osInfo.setOsName("Linux");
- osInfo.setProcessNo(processNo);
- osInfo.addIpv4S("10.0.0.1");
- osInfo.addIpv4S("10.0.0.2");
- instance.setOsinfo(osInfo.build());
-
- ApplicationInstanceMapping mapping = stub.register(instance.build());
- int instanceId = mapping.getApplicationInstanceId();
-
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
- return instanceId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ServiceRegister.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ServiceRegister.java
deleted file mode 100644
index 6666eea65c406fa1755b22a1642115c126ea11d7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/ServiceRegister.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import org.skywalking.apm.network.proto.ServiceNameCollection;
-import org.skywalking.apm.network.proto.ServiceNameDiscoveryServiceGrpc;
-import org.skywalking.apm.network.proto.ServiceNameElement;
-import org.skywalking.apm.network.proto.ServiceNameMappingCollection;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceRegister {
-
- public static int register(ManagedChannel channel, int applicationId, String serviceName) {
- ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceBlockingStub stub = ServiceNameDiscoveryServiceGrpc.newBlockingStub(channel);
- ServiceNameCollection.Builder collection = ServiceNameCollection.newBuilder();
-
- ServiceNameElement.Builder element = ServiceNameElement.newBuilder();
- element.setApplicationId(applicationId);
- element.setServiceName(serviceName);
- collection.addElements(element);
-
- ServiceNameMappingCollection mappingCollection = stub.discovery(collection.build());
- int serviceId = mappingCollection.getElements(0).getServiceId();
-
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
- return serviceId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryHasExitNoRefSpan.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryHasExitNoRefSpan.java
deleted file mode 100644
index ee1917d4febb411a38e2439eee3ec5926f9582c9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryHasExitNoRefSpan.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SingleHasEntryHasExitNoRefSpan {
-
- public static void main(String[] args) {
- Post post = new Post();
- post.send();
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- }
- }
-
- static class Post {
- private final Logger logger = LoggerFactory.getLogger(Post.class);
-
- public void send() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).maxInboundMessageSize(1024 * 1024 * 50).usePlaintext(true).build();
-
- int applicationId = 0;
- int instanceId = 0;
- int entryServiceId = 0;
- while (applicationId == 0) {
- applicationId = ApplicationRegister.register(channel, "consumer");
- }
-
- while (instanceId == 0) {
- instanceId = InstanceRegister.register(channel, "ConsumerUUID", applicationId, "consumer_host_name", 1);
- }
-
- while (entryServiceId == 0) {
- entryServiceId = ServiceRegister.register(channel, applicationId, "/dubbox-case/case/dubbox-rest");
- }
-
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel);
- StreamObserver streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- }
- });
-
- long now = System.currentTimeMillis();
-
- int id = 1;
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- UniqueId segmentId = builder.build();
-
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(applicationId);
- segmentBuilder.setApplicationInstanceId(instanceId);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.Http);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(now);
- entrySpan.setEndTime(now + 3000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(entryServiceId);
- entrySpan.setIsError(false);
- segmentBuilder.addSpans(entrySpan);
-
- SpanObject.Builder exitSpan = SpanObject.newBuilder();
- exitSpan.setSpanId(1);
- exitSpan.setSpanType(SpanType.Exit);
- exitSpan.setSpanLayer(SpanLayer.Database);
- exitSpan.setParentSpanId(0);
- exitSpan.setStartTime(now);
- exitSpan.setEndTime(now + 3000);
- exitSpan.setComponentId(ComponentsDefine.MONGODB.getId());
- exitSpan.setOperationNameId(entryServiceId);
- exitSpan.setIsError(false);
- exitSpan.setPeer("localhost:8888");
- segmentBuilder.addSpans(exitSpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
-
- streamObserver.onNext(upstream.build());
- streamObserver.onCompleted();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitHasRefSpan.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitHasRefSpan.java
deleted file mode 100644
index 048dd9c1358b95dc18dcced8ee81911d672c3bc7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitHasRefSpan.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.RefType;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentReference;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SingleHasEntryNoExitHasRefSpan {
-
- public static void main(String[] args) {
- Post post = new Post();
- post.send();
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- }
- }
-
- static class Post {
- private final Logger logger = LoggerFactory.getLogger(Post.class);
-
- public void send() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).maxInboundMessageSize(1024 * 1024 * 50).usePlaintext(true).build();
-
- int consumerApplicationId = 0;
- int providerApplicationId = 0;
- int consumerInstanceId = 0;
- int providerInstanceId = 0;
- int consumerEntryServiceId = 0;
- int consumerExitServiceId = 0;
- int consumerExitApplicationId = 0;
- int providerEntryServiceId = 0;
-
- while (consumerApplicationId == 0) {
- consumerApplicationId = ApplicationRegister.register(channel, "consumer");
- }
- while (consumerExitApplicationId == 0) {
- consumerExitApplicationId = ApplicationRegister.register(channel, "172.25.0.4:20880");
- }
- while (providerApplicationId == 0) {
- providerApplicationId = ApplicationRegister.register(channel, "provider");
- }
- while (consumerInstanceId == 0) {
- consumerInstanceId = InstanceRegister.register(channel, "ConsumerUUID", consumerApplicationId, "consumer_host_name", 1);
- }
- while (providerInstanceId == 0) {
- providerInstanceId = InstanceRegister.register(channel, "ProviderUUID", providerApplicationId, "provider_host_name", 2);
- }
- while (consumerEntryServiceId == 0) {
- consumerEntryServiceId = ServiceRegister.register(channel, consumerApplicationId, "/dubbox-case/case/dubbox-rest");
- }
- while (consumerExitServiceId == 0) {
- consumerExitServiceId = ServiceRegister.register(channel, consumerApplicationId, "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- }
- while (providerEntryServiceId == 0) {
- providerEntryServiceId = ServiceRegister.register(channel, providerApplicationId, "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()");
- }
-
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel);
- StreamObserver streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- }
- });
-
- long now = System.currentTimeMillis();
-
- int id = 1;
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- UniqueId segmentId = builder.build();
-
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(consumerApplicationId);
- segmentBuilder.setApplicationInstanceId(consumerInstanceId);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- TraceSegmentReference.Builder referenceBuilder = TraceSegmentReference.newBuilder();
- referenceBuilder.setEntryApplicationInstanceId(providerInstanceId);
- referenceBuilder.setEntryServiceName("/rest/test");
- referenceBuilder.setParentApplicationInstanceId(providerInstanceId);
- referenceBuilder.setParentServiceName("/rest/test");
- referenceBuilder.setRefType(RefType.CrossProcess);
- referenceBuilder.setNetworkAddress("localhost:8080");
- segmentBuilder.addRefs(referenceBuilder);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.Http);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(now);
- entrySpan.setEndTime(now + 3000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(consumerEntryServiceId);
- entrySpan.setIsError(false);
- segmentBuilder.addSpans(entrySpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
-
- streamObserver.onNext(upstream.build());
- streamObserver.onCompleted();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitNoRefSpan.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitNoRefSpan.java
deleted file mode 100644
index 0d2db0b0ae99336357b550cbf02495b084d43479..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleHasEntryNoExitNoRefSpan.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SingleHasEntryNoExitNoRefSpan {
-
- public static void main(String[] args) {
- Post post = new Post();
- post.send();
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- }
- }
-
- static class Post {
- private final Logger logger = LoggerFactory.getLogger(Post.class);
-
- public void send() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).maxInboundMessageSize(1024 * 1024 * 50).usePlaintext(true).build();
-
- int applicationId = 0;
- int instanceId = 0;
- int entryServiceId = 0;
- while (applicationId == 0) {
- applicationId = ApplicationRegister.register(channel, "consumer");
- }
-
- while (instanceId == 0) {
- instanceId = InstanceRegister.register(channel, "ConsumerUUID", applicationId, "consumer_host_name", 1);
- }
-
- while (entryServiceId == 0) {
- entryServiceId = ServiceRegister.register(channel, applicationId, "/dubbox-case/case/dubbox-rest");
- }
-
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel);
- StreamObserver streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- }
- });
-
- long now = System.currentTimeMillis();
-
- int id = 1;
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- UniqueId segmentId = builder.build();
-
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(applicationId);
- segmentBuilder.setApplicationInstanceId(instanceId);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.Http);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(now);
- entrySpan.setEndTime(now + 3000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(entryServiceId);
- entrySpan.setIsError(false);
- segmentBuilder.addSpans(entrySpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
-
- streamObserver.onNext(upstream.build());
- streamObserver.onCompleted();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleNoEntryHasExitNoRefSpan.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleNoEntryHasExitNoRefSpan.java
deleted file mode 100644
index cad21030aff10d343dfb68b7761b14195e5f34d2..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/mock/grpc/SingleNoEntryHasExitNoRefSpan.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.mock.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.stub.StreamObserver;
-import org.skywalking.apm.network.proto.Downstream;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.TraceSegmentServiceGrpc;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SingleNoEntryHasExitNoRefSpan {
-
- public static void main(String[] args) {
- Post post = new Post();
- post.send();
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- }
- }
-
- static class Post {
- private final Logger logger = LoggerFactory.getLogger(Post.class);
-
- public void send() {
- ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).maxInboundMessageSize(1024 * 1024 * 50).usePlaintext(true).build();
-
- int applicationId = 0;
- int instanceId = 0;
- int entryServiceId = 0;
- while (applicationId == 0) {
- applicationId = ApplicationRegister.register(channel, "consumer");
- }
-
- while (instanceId == 0) {
- instanceId = InstanceRegister.register(channel, "ConsumerUUID", applicationId, "consumer_host_name", 1);
- }
-
- while (entryServiceId == 0) {
- entryServiceId = ServiceRegister.register(channel, applicationId, "/dubbox-case/case/dubbox-rest");
- }
-
- TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel);
- StreamObserver streamObserver = stub.collect(new StreamObserver() {
- @Override public void onNext(Downstream downstream) {
- }
-
- @Override public void onError(Throwable throwable) {
- logger.error(throwable.getMessage(), throwable);
- }
-
- @Override public void onCompleted() {
- }
- });
-
- long now = System.currentTimeMillis();
-
- int id = 1;
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- UniqueId segmentId = builder.build();
-
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(applicationId);
- segmentBuilder.setApplicationInstanceId(instanceId);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- SpanObject.Builder exitSpan = SpanObject.newBuilder();
- exitSpan.setSpanId(0);
- exitSpan.setSpanType(SpanType.Exit);
- exitSpan.setSpanLayer(SpanLayer.Database);
- exitSpan.setParentSpanId(-1);
- exitSpan.setStartTime(now);
- exitSpan.setEndTime(now + 3000);
- exitSpan.setComponentId(ComponentsDefine.MONGODB.getId());
- exitSpan.setOperationNameId(entryServiceId);
- exitSpan.setIsError(false);
- exitSpan.setPeer("localhost:8888");
- segmentBuilder.addSpans(exitSpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
-
- streamObserver.onNext(upstream.build());
- streamObserver.onCompleted();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferWriteWorkerTestCase.java b/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferWriteWorkerTestCase.java
deleted file mode 100644
index 79b2309a78655f2dccfc6a046b69f8b8c6b06067..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/java/org/skywalking/apm/collector/agentstream/worker/segment/buffer/SegmentBufferWriteWorkerTestCase.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.agentstream.worker.segment.buffer;
-
-import org.skywalking.apm.collector.agentstream.worker.segment.standardization.SegmentStandardizationWorker;
-import org.skywalking.apm.collector.stream.worker.ProviderNotFoundException;
-import org.skywalking.apm.collector.stream.worker.WorkerException;
-import org.skywalking.apm.network.proto.SpanLayer;
-import org.skywalking.apm.network.proto.SpanObject;
-import org.skywalking.apm.network.proto.SpanType;
-import org.skywalking.apm.network.proto.TraceSegmentObject;
-import org.skywalking.apm.network.proto.UniqueId;
-import org.skywalking.apm.network.proto.UpstreamSegment;
-import org.skywalking.apm.network.trace.component.ComponentsDefine;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentBufferWriteWorkerTestCase {
-
- public static void main(String[] args) throws WorkerException, ProviderNotFoundException {
-
- SegmentBufferConfig.BUFFER_PATH = "/Users/peng-yongsheng/code/sky-walking/sky-walking/apm-collector/buffer/";
- SegmentStandardizationWorker worker = new SegmentStandardizationWorker(null, null);
- worker.preStart();
- worker.allocateJob(buildSegment());
- worker.allocateJob(buildSegment());
- worker.allocateJob(buildSegment());
- worker.allocateJob(buildSegment());
- worker.allocateJob(buildSegment());
- }
-
- private static UpstreamSegment buildSegment() {
- long now = System.currentTimeMillis();
-
- int id = 1;
- UniqueId.Builder builder = UniqueId.newBuilder();
- builder.addIdParts(id);
- builder.addIdParts(id);
- builder.addIdParts(id);
- UniqueId segmentId = builder.build();
-
- UpstreamSegment.Builder upstream = UpstreamSegment.newBuilder();
- upstream.addGlobalTraceIds(segmentId);
-
- TraceSegmentObject.Builder segmentBuilder = TraceSegmentObject.newBuilder();
- segmentBuilder.setApplicationId(1);
- segmentBuilder.setApplicationInstanceId(1);
- segmentBuilder.setTraceSegmentId(segmentId);
-
- SpanObject.Builder entrySpan = SpanObject.newBuilder();
- entrySpan.setSpanId(0);
- entrySpan.setSpanType(SpanType.Entry);
- entrySpan.setSpanLayer(SpanLayer.Http);
- entrySpan.setParentSpanId(-1);
- entrySpan.setStartTime(now);
- entrySpan.setEndTime(now + 3000);
- entrySpan.setComponentId(ComponentsDefine.TOMCAT.getId());
- entrySpan.setOperationNameId(1);
- entrySpan.setIsError(false);
- segmentBuilder.addSpans(entrySpan);
-
- SpanObject.Builder exitSpan = SpanObject.newBuilder();
- exitSpan.setSpanId(1);
- exitSpan.setSpanType(SpanType.Exit);
- exitSpan.setSpanLayer(SpanLayer.Database);
- exitSpan.setParentSpanId(0);
- exitSpan.setStartTime(now);
- exitSpan.setEndTime(now + 3000);
- exitSpan.setComponentId(ComponentsDefine.MONGODB.getId());
- exitSpan.setOperationNameId(2);
- exitSpan.setIsError(false);
- exitSpan.setPeer("localhost:8888");
- segmentBuilder.addSpans(exitSpan);
-
- upstream.setSegment(segmentBuilder.build().toByteString());
- return upstream.build();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/application-register.json b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/application-register.json
deleted file mode 100644
index eb829c2cb4c375b6ce163c4751b26b8dac061769..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/application-register.json
+++ /dev/null
@@ -1,4 +0,0 @@
-[
- "dubbox-consumer",
- "dubbox-provider"
-]
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-consumer.json b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-consumer.json
deleted file mode 100644
index 57c79c9c31249edd4abea9bdd960e4975452af6e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-consumer.json
+++ /dev/null
@@ -1,71 +0,0 @@
-[
- {
- "gt": [
- [
- 230150,
- 185809,
- 24040000
- ]
- ],
- "sg": {
- "ts": [
- 230150,
- 185809,
- 24040000
- ],
- "ai": 2,
- "ii": 2,
- "rs": [],
- "ss": [
- {
- "si": 1,
- "tv": 1,
- "lv": 1,
- "ps": 0,
- "st": 1501858094526,
- "et": 1501858097004,
- "ci": 3,
- "cn": "",
- "oi": 0,
- "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()",
- "pi": 0,
- "pn": "172.25.0.4:20880",
- "ie": false,
- "to": [
- {
- "k": "url",
- "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- }
- ],
- "lo": []
- },
- {
- "si": 0,
- "tv": 0,
- "lv": 2,
- "ps": -1,
- "st": 1501858092409,
- "et": 1501858097033,
- "ci": 1,
- "cn": "",
- "oi": 0,
- "on": "/dubbox-case/case/dubbox-rest",
- "pi": 0,
- "pn": "",
- "ie": false,
- "to": [
- {
- "k": "url",
- "v": "http://localhost:18080/dubbox-case/case/dubbox-rest"
- },
- {
- "k": "http.method",
- "v": "GET"
- }
- ],
- "lo": []
- }
- ]
- }
- }
-]
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-provider.json b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-provider.json
deleted file mode 100644
index 28a61aee084733b887b41b46e3ca834920538665..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/dubbox-provider.json
+++ /dev/null
@@ -1,67 +0,0 @@
-[
- {
- "gt": [
- [
- 230150,
- 185809,
- 24040000
- ]
- ],
- "sg": {
- "ts": [
- 137150,
- 185809,
- 48780000
- ],
- "ai": 3,
- "ii": 3,
- "rs": [
- {
- "ts": [
- 230150,
- 185809,
- 24040000
- ],
- "ai": 2,
- "si": 1,
- "vi": 0,
- "vn": "/dubbox-case/case/dubbox-rest",
- "ni": 0,
- "nn": "172.25.0.4:20880",
- "ea": 2,
- "ei": 0,
- "en": "/dubbox-case/case/dubbox-rest",
- "rn": 0
- }
- ],
- "ss": [
- {
- "si": 0,
- "tv": 0,
- "lv": 2,
- "ps": -1,
- "st": 1501858094726,
- "et": 1501858096804,
- "ci": 3,
- "cn": "",
- "oi": 0,
- "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()",
- "pi": 0,
- "pn": "",
- "ie": false,
- "to": [
- {
- "k": "url",
- "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
- },
- {
- "k": "http.method",
- "v": "GET"
- }
- ],
- "lo": []
- }
- ]
- }
- }
-]
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/instance-register.json b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/instance-register.json
deleted file mode 100644
index f29ab121d7f2594f53d4c2291ee55d4bdd971e39..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/json/segment/normal/instance-register.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "ai": 0,
- "au": "dubbox-consumer",
- "rt": 1501858094526
-}
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/log4j2.xml b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/log4j2.xml
deleted file mode 100644
index d36a4408f43f060b1694b84af3c5c5edad097e67..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/logback.xml b/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/logback.xml
deleted file mode 100644
index 9fc407992b61397b0bfbc870cfaf5184c0fcb839..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-agentstream/src/test/resources/logback.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
- %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.bat b/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.bat
deleted file mode 100644
index eb58f7ebcc68eb25de0f004ddd342276f92048ef..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-setlocal
-set COLLECOTR_PROCESS_TITLE=Skywalking-Collector
-set COLLECTOR_BASE_PATH=%~dp0%..
-set COLLECTOR_RUNTIME_OPTIONS="-Xms256M -Xmx512M -Dcollector.logDir=%COLLECTOR_BASE_PATH%\logs"
-
-set CLASSPATH=%COLLECTOR_BASE_PATH%\config;
-SET CLASSPATH=%COLLECTOR_BASE_PATH%\libs\*;%CLASSPATH%
-
-if defined JAVA_HOME (
- set _EXECJAVA="%JAVA_HOME:"=%"\bin\java
-)
-
-if not defined JAVA_HOME (
- echo "JAVA_HOME not set."
- set _EXECJAVA=java
-)
-
-start /MIN "%COLLECOTR_PROCESS_TITLE%" %_EXECJAVA% "%COLLECTOR_RUNTIME_OPTIONS%" -cp "%CLASSPATH%" org.skywalking.apm.collector.boot.CollectorBootStartUp &
-echo Collector started successfully!
-
-endlocal
diff --git a/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.sh b/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.sh
deleted file mode 100644
index 993fa0217cf553d99e4c9a7e21f416dc83d10341..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/bin/collector-service.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-
-PRG="$0"
-PRGDIR=`dirname "$PRG"`
-[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
-
-COLLECTOR_LOGS_DIR="${COLLECTOR_HOME}/logs"
-JAVA_OPTS=" -Xms256M -Xmx512M"
-
-if [ ! -d "${COLLECTOR_HOME}/logs" ]; then
- mkdir -p "${COLLECTOR_LOGS_DIR}"
-fi
-
-_RUNJAVA=${JAVA_HOME}/bin/java
-[ -z "$JAVA_HOME" ] && _RUNJAVA=java
-
-CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH"
-for i in "$COLLECTOR_HOME"/libs/*.jar
-do
- CLASSPATH="$i:$CLASSPATH"
-done
-COLLECTOR_OPTIONS=" -Dcollector.logDir=$COLLECTOR_LOGS_DIR"
-echo "Starting collector...."
-
-eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} ${COLLECTOR_OPTIONS} -classpath $CLASSPATH org.skywalking.apm.collector.boot.CollectorBootStartUp \
- 2>${COLLECTOR_LOGS_DIR}/collector.log 1> /dev/null &"
-
-retval=$?
-pid=$!
-FAIL_MSG="Collector started failure!"
-SUCCESS_MSG="Collector started successfully!"
-[ ${retval} -eq 0 ] || (echo ${FAIL_MSG}; exit ${retval})
-sleep 1
-if ! ps -p ${pid} > /dev/null ; then
- echo ${FAIL_MSG}
- exit 1
-fi
-echo ${SUCCESS_MSG}
diff --git a/apm-collector-3.2.3/apm-collector-boot/bin/startup.bat b/apm-collector-3.2.3/apm-collector-boot/bin/startup.bat
deleted file mode 100644
index 22023060dedebf3f4f191bb1cd7a91cbcfbb1f4e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/bin/startup.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-
-setlocal
-call "%~dp0"\collector-service.bat start
-endlocal
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-boot/bin/startup.sh b/apm-collector-3.2.3/apm-collector-boot/bin/startup.sh
deleted file mode 100644
index 7f9c0d3abe0074c15f3b5da24a6b3811b4ab9e71..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/bin/startup.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-PRG="$0"
-PRGDIR=`dirname "$PRG"`
-EXECUTABLE=collector-service.sh
-
-exec "$PRGDIR"/"$EXECUTABLE" start
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-boot/docker/Dockerfile b/apm-collector-3.2.3/apm-collector-boot/docker/Dockerfile
deleted file mode 100644
index 8e5539028f6f9da0ccf5d0faf70a39ad2ddb3eb6..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/docker/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-FROM openjdk:8u111-jdk
-
-ENV ZK_ADDRESSES=127.0.0.1:2181 \
- ES_CLUSTER_NAME=CollectorDBCluster \
- ES_ADDRESSES=localhost:9300 \
- BIND_HOST=localhost \
- CLUSTER_BIND_HOST=localhost \
- CLUSTER_BIND_PORT=11800 \
- UI_BIND_HOST=localhost \
- UI_BIND_PORT=12800 \
- GRPC_BIND_PORT=11800 \
- AGENT_SERVER_BIND_PORT=10800 \
- AGENT_STREAM_JETTY_BIND_PORT=12800
-
-ADD skywalking-collector.tar.gz /usr/local
-COPY collector-service.sh /usr/local/skywalking-collector/bin
-COPY log4j2.xml /usr/local/skywalking-collector/config
-COPY application.yml /usr/local/skywalking-collector/config
-COPY docker-entrypoint.sh /
-
-RUN chmod +x /usr/local/skywalking-collector/bin/collector-service.sh && chmod +x /docker-entrypoint.sh
-
-EXPOSE 10800
-EXPOSE 11800
-EXPOSE 12800
-
-ENTRYPOINT ["/docker-entrypoint.sh"]
-CMD ["/usr/local/skywalking-collector/bin/collector-service.sh"]
diff --git a/apm-collector-3.2.3/apm-collector-boot/docker/application.yml b/apm-collector-3.2.3/apm-collector-boot/docker/application.yml
deleted file mode 100644
index a8ab6e69a2c4cd1c10abe8cc8ff7b4faae3d60bc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/docker/application.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-cluster:
- zookeeper:
- hostPort: {ZK_ADDRESSES}
- sessionTimeout: 100000
-agent_server:
- jetty:
- host: {BIND_HOST}
- port: {AGENT_SERVER_BIND_PORT}
- context_path: /
-agent_stream:
- grpc:
- host: {BIND_HOST}
- port: {GRPC_BIND_PORT}
- jetty:
- host: {UI_BIND_HOST}
- port: {UI_BIND_PORT}
- context_path: /
-ui:
- jetty:
- host: {UI_BIND_HOST}
- port: {UI_BIND_PORT}
- context_path: /
-collector_inside:
- grpc:
- host: {CLUSTER_BIND_HOST}
- port: {CLUSTER_BIND_PORT}
-storage:
- elasticsearch:
- cluster_name: {ES_CLUSTER_NAME}
- cluster_transport_sniffer: true
- cluster_nodes: {ES_ADDRESSES}
- index_shards_number: 2
- index_replicas_number: 0
diff --git a/apm-collector-3.2.3/apm-collector-boot/docker/collector-service.sh b/apm-collector-3.2.3/apm-collector-boot/docker/collector-service.sh
deleted file mode 100644
index 67baa12a75845959522d9ff9be344db989717e18..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/docker/collector-service.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-PRG="$0"
-PRGDIR=`dirname "$PRG"`
-[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
-
-CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH"
-for i in "$COLLECTOR_HOME"/libs/*.jar
-do
- CLASSPATH="$i:$CLASSPATH"
-done
-
-java ${JAVA_OPTS} ${COLLECTOR_OPTIONS} -classpath $CLASSPATH org.skywalking.apm.collector.boot.CollectorBootStartUp
diff --git a/apm-collector-3.2.3/apm-collector-boot/docker/docker-entrypoint.sh b/apm-collector-3.2.3/apm-collector-boot/docker/docker-entrypoint.sh
deleted file mode 100644
index 222d2feda4af8a5a68f78cbb17ed01ec45270ec1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/docker/docker-entrypoint.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-echo "replace {ZK_ADDRESSES} to ${ZK_ADDRESSES}"
-eval sed -i -e 's/\{ZK_ADDRESSES\}/${ZK_ADDRESSES}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {ES_CLUSTER_NAME} to ${ES_CLUSTER_NAME}"
-eval sed -i -e 's/\{ES_CLUSTER_NAME\}/${ES_CLUSTER_NAME}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {ES_ADDRESSES} to ${ES_ADDRESSES}"
-eval sed -i -e 's/\{ES_ADDRESSES\}/${ES_ADDRESSES}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {BIND_HOST} to ${BIND_HOST}"
-eval sed -i -e 's/\{BIND_HOST\}/${BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {GRPC_BIND_PORT} to ${GRPC_BIND_PORT}"
-eval sed -i -e 's/\{GRPC_BIND_PORT\}/${GRPC_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {AGENT_SERVER_BIND_PORT} to ${AGENT_SERVER_BIND_PORT}"
-eval sed -i -e 's/\{AGENT_SERVER_BIND_PORT\}/${AGENT_SERVER_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {AGENT_STREAM_JETTY_BIND_PORT} to ${AGENT_STREAM_JETTY_BIND_PORT}"
-eval sed -i -e 's/\{AGENT_STREAM_JETTY_BIND_PORT\}/${AGENT_STREAM_JETTY_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {UI_BIND_HOST} to ${UI_BIND_HOST}"
-eval sed -i -e 's/\{UI_BIND_HOST\}/${UI_BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {UI_BIND_PORT} to ${UI_BIND_PORT}"
-eval sed -i -e 's/\{UI_BIND_PORT\}/${UI_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {CLUSTER_BIND_HOST} to ${CLUSTER_BIND_HOST}"
-eval sed -i -e 's/\{CLUSTER_BIND_HOST\}/${CLUSTER_BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml
-
-echo "replace {CLUSTER_BIND_PORT} to ${CLUSTER_BIND_PORT}"
-eval sed -i -e 's/\{CLUSTER_BIND_PORT\}/${CLUSTER_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml
-
-
-exec "$@"
diff --git a/apm-collector-3.2.3/apm-collector-boot/docker/log4j2.xml b/apm-collector-3.2.3/apm-collector-boot/docker/log4j2.xml
deleted file mode 100644
index 44e2c384f47295a113ccbda3e5d1635a40dca6d3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/docker/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-boot/pom.xml b/apm-collector-3.2.3/apm-collector-boot/pom.xml
deleted file mode 100644
index ae19d6fffdead9615b7c1ec29457eaeddf5b11ba..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/pom.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-boot
- jar
-
-
- org.skywalking.apm.collector.boot.CollectorBootStartUp
- UTF-8
- skywalking/skywalking-collector
- ${version}
-
-
-
-
- org.skywalking
- apm-collector-3.2.3-cluster
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-queue
- ${project.version}
-
-
- org.skywalking
- apm-collector-storage
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-ui
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentserver
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentstream
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentregister
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-agentjvm
- ${project.version}
-
-
-
-
- skywalking-collector
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.3.2
-
-
- *.xml
- *.config
- *.yml
-
-
-
- ${main.class}
-
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- assembly
- package
-
- single
-
-
-
- src/main/assembly/assembly.xml
-
- ${project.basedir}/../../packages
-
-
-
-
-
- com.spotify
- docker-maven-plugin
- ${docker.plugin.version}
-
- false
- ${docker.image.name}
-
- ${docker.image.version}
-
- ${project.basedir}/docker
-
-
- /
- ${project.basedir}/../../packages
- ${build.finalName}.tar.gz
-
-
-
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 2.4.3
-
- ${project.build.sourceEncoding}
-
-
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/assembly.xml b/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/assembly.xml
deleted file mode 100644
index b1e6e3ec11bc3a98e67eb01b694ecd50b7e9914d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/assembly.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- tar.gz
- zip
-
-
-
- /libs
- runtime
-
-
-
-
- ${project.basedir}/bin
- /bin
-
- *.sh
- *.bat
-
- 0755
-
-
- src/main/resources
-
- application.yml
-
-
- /config
-
-
- src/main/assembly
-
- log4j2.xml
-
- /config
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/log4j2.xml b/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/log4j2.xml
deleted file mode 100644
index 265dd33583ca3faafd285b1726cf62a76b05e3ce..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/assembly/log4j2.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- ${sys:collector.logDir}
-
-
-
-
- %d - %c -%-4r [%t] %-5p %x - %m%n
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorBootStartUp.java b/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorBootStartUp.java
deleted file mode 100644
index f4746bf2f5363e5c67debafb32efed1f4986aa2b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorBootStartUp.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.boot;
-
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.config.SystemConfigParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class CollectorBootStartUp {
-
- private static final Logger logger = LoggerFactory.getLogger(CollectorBootStartUp.class);
-
- public static void main(String[] args) throws CollectorException {
- logger.info("collector starting...");
- SystemConfigParser.INSTANCE.parse();
- CollectorStarter starter = new CollectorStarter();
- starter.start();
- logger.info("collector start successful.");
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorStarter.java b/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorStarter.java
deleted file mode 100644
index b8902cc81fc7d3e51125a34e3341f45c2f8e3716..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/java/org/skywalking/apm/collector/boot/CollectorStarter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.boot;
-
-import java.util.Map;
-import org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.framework.Starter;
-import org.skywalking.apm.collector.core.module.ModuleConfigLoader;
-import org.skywalking.apm.collector.core.module.ModuleDefine;
-import org.skywalking.apm.collector.core.module.ModuleDefineLoader;
-import org.skywalking.apm.collector.core.module.ModuleGroupDefine;
-import org.skywalking.apm.collector.core.module.ModuleGroupDefineLoader;
-import org.skywalking.apm.collector.core.server.ServerException;
-import org.skywalking.apm.collector.core.server.ServerHolder;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class CollectorStarter implements Starter {
-
- private final Logger logger = LoggerFactory.getLogger(CollectorStarter.class);
- private Map moduleGroupDefineMap;
-
- @Override public void start() throws CollectorException {
- ModuleConfigLoader configLoader = new ModuleConfigLoader();
- Map configuration = configLoader.load();
-
- ModuleGroupDefineLoader groupDefineLoader = new ModuleGroupDefineLoader();
- moduleGroupDefineMap = groupDefineLoader.load();
-
- ModuleDefineLoader defineLoader = new ModuleDefineLoader();
- Map> moduleDefineMap = defineLoader.load();
-
- ServerHolder serverHolder = new ServerHolder();
- for (ModuleGroupDefine moduleGroupDefine : moduleGroupDefineMap.values()) {
- if (moduleGroupDefine.groupConfigParser() != null) {
- moduleGroupDefine.groupConfigParser().parse(configuration.get(moduleGroupDefine.name()));
- }
- moduleGroupDefine.moduleInstaller().injectConfiguration(configuration.get(moduleGroupDefine.name()), moduleDefineMap.get(moduleGroupDefine.name()));
- moduleGroupDefine.moduleInstaller().injectServerHolder(serverHolder);
- moduleGroupDefine.moduleInstaller().preInstall();
- }
-
- moduleGroupDefineMap.get(ClusterModuleGroupDefine.GROUP_NAME).moduleInstaller().install();
-
- for (ModuleGroupDefine moduleGroupDefine : moduleGroupDefineMap.values()) {
- if (!(moduleGroupDefine instanceof ClusterModuleGroupDefine)) {
- moduleGroupDefine.moduleInstaller().install();
- }
- }
-
- serverHolder.getServers().forEach(server -> {
- try {
- server.start();
- } catch (ServerException e) {
- logger.error(e.getMessage(), e);
- }
- });
-
- dependenceAfterInstall();
- }
-
- private void dependenceAfterInstall() throws CollectorException {
- for (ModuleGroupDefine moduleGroupDefine : moduleGroupDefineMap.values()) {
- moduleInstall(moduleGroupDefine);
- }
- }
-
- private void moduleInstall(ModuleGroupDefine moduleGroupDefine) throws CollectorException {
- if (CollectionUtils.isNotEmpty(moduleGroupDefine.moduleInstaller().dependenceModules())) {
- for (String groupName : moduleGroupDefine.moduleInstaller().dependenceModules()) {
- moduleInstall(moduleGroupDefineMap.get(groupName));
- }
- logger.info("after install module group: {}", moduleGroupDefine.name());
- moduleGroupDefine.moduleInstaller().afterInstall();
- } else {
- logger.info("after install module group: {}", moduleGroupDefine.name());
- moduleGroupDefine.moduleInstaller().afterInstall();
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/resources/application.yml b/apm-collector-3.2.3/apm-collector-boot/src/main/resources/application.yml
deleted file mode 100644
index 8a4f7b3b6f0026b750261f89080d39f9a63096d3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/resources/application.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-#cluster:
-# zookeeper:
-# hostPort: localhost:2181
-# sessionTimeout: 100000
-agent_server:
- jetty:
- host: localhost
- port: 10800
- context_path: /
-agent_stream:
- grpc:
- host: localhost
- port: 11800
- jetty:
- host: localhost
- port: 12800
- context_path: /
- config:
- buffer_offset_max_file_size: 10M
- buffer_segment_max_file_size: 500M
-ui:
- jetty:
- host: localhost
- port: 12800
- context_path: /
-collector_inside:
- grpc:
- host: localhost
- port: 11800
-#storage:
-# elasticsearch:
-# cluster_name: CollectorDBCluster
-# cluster_transport_sniffer: true
-# cluster_nodes: localhost:9300
-# index_shards_number: 2
-# index_replicas_number: 0
-#storage:
-# h2:
-# url: jdbc:h2:tcp://localhost/~/test
-# user_name: sa
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-boot/src/main/resources/log4j2.xml b/apm-collector-3.2.3/apm-collector-boot/src/main/resources/log4j2.xml
deleted file mode 100644
index a76ab8c13034643898799c80431670a2550fcb20..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-boot/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-cache/pom.xml b/apm-collector-3.2.3/apm-collector-cache/pom.xml
deleted file mode 100644
index 0b1dfbb0af3a214b341d374894953e61a7a23f63..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/pom.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-cache
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-core
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-storage
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ApplicationCache.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ApplicationCache.java
deleted file mode 100644
index 1c1498a432151127e2b89932d1d2500ecdbaf3c4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ApplicationCache.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import org.skywalking.apm.collector.cache.dao.IApplicationCacheDAO;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationCache {
-
- private static final Logger logger = LoggerFactory.getLogger(ApplicationCache.class);
-
- private static Cache CODE_CACHE = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(1000).build();
-
- public static int get(String applicationCode) {
- IApplicationCacheDAO dao = (IApplicationCacheDAO)DAOContainer.INSTANCE.get(IApplicationCacheDAO.class.getName());
-
- int applicationId = 0;
- try {
- applicationId = CODE_CACHE.get(applicationCode, () -> dao.getApplicationId(applicationCode));
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- }
-
- if (applicationId == 0) {
- applicationId = dao.getApplicationId(applicationCode);
- if (applicationId != 0) {
- CODE_CACHE.put(applicationCode, applicationId);
- }
- }
- return applicationId;
- }
-
- private static Cache ID_CACHE = CacheBuilder.newBuilder().maximumSize(1000).build();
-
- public static String get(int applicationId) {
- IApplicationCacheDAO dao = (IApplicationCacheDAO)DAOContainer.INSTANCE.get(IApplicationCacheDAO.class.getName());
-
- String applicationCode = Const.EMPTY_STRING;
- try {
- applicationCode = ID_CACHE.get(applicationId, () -> dao.getApplicationCode(applicationId));
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- }
-
- if (StringUtils.isEmpty(applicationCode)) {
- applicationCode = dao.getApplicationCode(applicationId);
- if (StringUtils.isNotEmpty(applicationCode)) {
- CODE_CACHE.put(applicationCode, applicationId);
- }
- }
- return applicationCode;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/InstanceCache.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/InstanceCache.java
deleted file mode 100644
index 245f0db087dc7ed30a0ba1603c85f1708b907a78..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/InstanceCache.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import org.skywalking.apm.collector.cache.dao.IInstanceCacheDAO;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceCache {
-
- private static final Logger logger = LoggerFactory.getLogger(InstanceCache.class);
-
- private static Cache INSTANCE_CACHE = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build();
-
- public static int get(int applicationInstanceId) {
- IInstanceCacheDAO dao = (IInstanceCacheDAO)DAOContainer.INSTANCE.get(IInstanceCacheDAO.class.getName());
-
- int applicationId = 0;
- try {
- applicationId = INSTANCE_CACHE.get(applicationInstanceId, () -> dao.getApplicationId(applicationInstanceId));
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- }
-
- if (applicationId == 0) {
- applicationId = dao.getApplicationId(applicationInstanceId);
- if (applicationId != 0) {
- INSTANCE_CACHE.put(applicationInstanceId, applicationId);
- }
- }
- return applicationId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceIdCache.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceIdCache.java
deleted file mode 100644
index 171182782b5ac73a64b3d9c288673b7ad0830e72..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceIdCache.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import org.skywalking.apm.collector.cache.dao.IServiceNameCacheDAO;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceIdCache {
-
- private static final Logger logger = LoggerFactory.getLogger(ServiceIdCache.class);
-
- //TODO size configuration
- private static Cache SERVICE_CACHE = CacheBuilder.newBuilder().maximumSize(1000).build();
-
- public static int get(int applicationId, String serviceName) {
- IServiceNameCacheDAO dao = (IServiceNameCacheDAO)DAOContainer.INSTANCE.get(IServiceNameCacheDAO.class.getName());
-
- int serviceId = 0;
- try {
- serviceId = SERVICE_CACHE.get(applicationId + Const.ID_SPLIT + serviceName, () -> dao.getServiceId(applicationId, serviceName));
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- }
-
- if (serviceId == 0) {
- serviceId = dao.getServiceId(applicationId, serviceName);
- if (serviceId != 0) {
- SERVICE_CACHE.put(applicationId + Const.ID_SPLIT + serviceName, serviceId);
- }
- }
- return serviceId;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceNameCache.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceNameCache.java
deleted file mode 100644
index 5197486d14f9efa1f22dea48b12fcb76bdca9bcf..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/ServiceNameCache.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import org.skywalking.apm.collector.cache.dao.IServiceNameCacheDAO;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.core.util.StringUtils;
-import org.skywalking.apm.collector.storage.base.dao.DAOContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameCache {
-
- private static final Logger logger = LoggerFactory.getLogger(ServiceNameCache.class);
-
- //TODO size configuration
- private static Cache CACHE = CacheBuilder.newBuilder().maximumSize(10000).build();
-
- public static String get(int serviceId) {
- IServiceNameCacheDAO dao = (IServiceNameCacheDAO)DAOContainer.INSTANCE.get(IServiceNameCacheDAO.class.getName());
-
- String serviceName = Const.EMPTY_STRING;
- try {
- serviceName = CACHE.get(serviceId, () -> dao.getServiceName(serviceId));
- } catch (Throwable e) {
- logger.error(e.getMessage(), e);
- }
-
- if (StringUtils.isEmpty(serviceName)) {
- serviceName = dao.getServiceName(serviceId);
- if (StringUtils.isNotEmpty(serviceName)) {
- CACHE.put(serviceId, serviceName);
- }
- }
-
- return serviceName;
- }
-
- public static String getSplitServiceName(String serviceName) {
- if (StringUtils.isNotEmpty(serviceName)) {
- String[] serviceNames = serviceName.split(Const.ID_SPLIT);
- if (serviceNames.length == 2) {
- return serviceNames[1];
- } else {
- return Const.EMPTY_STRING;
- }
- } else {
- return Const.EMPTY_STRING;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationEsCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationEsCacheDAO.java
deleted file mode 100644
index 1a7939eb3d548146801117c02de2d7ea80a4700b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationEsCacheDAO.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import org.elasticsearch.action.get.GetRequestBuilder;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.search.SearchRequestBuilder;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchType;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.SearchHit;
-import org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationEsCacheDAO extends EsDAO implements IApplicationCacheDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationEsCacheDAO.class);
-
- @Override public int getApplicationId(String applicationCode) {
- ElasticSearchClient client = getClient();
-
- SearchRequestBuilder searchRequestBuilder = client.prepareSearch(ApplicationTable.TABLE);
- searchRequestBuilder.setTypes("type");
- searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH);
- searchRequestBuilder.setQuery(QueryBuilders.termQuery(ApplicationTable.COLUMN_APPLICATION_CODE, applicationCode));
- searchRequestBuilder.setSize(1);
-
- SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
- if (searchResponse.getHits().totalHits > 0) {
- SearchHit searchHit = searchResponse.getHits().iterator().next();
- return (int)searchHit.getSource().get(ApplicationTable.COLUMN_APPLICATION_ID);
- }
- return 0;
- }
-
- @Override public String getApplicationCode(int applicationId) {
- logger.debug("get application code, applicationId: {}", applicationId);
- ElasticSearchClient client = getClient();
- GetRequestBuilder getRequestBuilder = client.prepareGet(ApplicationTable.TABLE, String.valueOf(applicationId));
-
- GetResponse getResponse = getRequestBuilder.get();
- if (getResponse.isExists()) {
- return (String)getResponse.getSource().get(ApplicationTable.COLUMN_APPLICATION_CODE);
- }
- return Const.EMPTY_STRING;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationH2CacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationH2CacheDAO.java
deleted file mode 100644
index 20f66dda5a16f5c04f99ff1b0bacb47081974746..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ApplicationH2CacheDAO.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.define.register.ApplicationTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ApplicationH2CacheDAO extends H2DAO implements IApplicationCacheDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationH2CacheDAO.class);
- private static final String GET_APPLICATION_ID_OR_CODE_SQL = "select {0} from {1} where {2} = ?";
-
- @Override
- public int getApplicationId(String applicationCode) {
- logger.info("get the application id with application code = {}", applicationCode);
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_OR_CODE_SQL, ApplicationTable.COLUMN_APPLICATION_ID, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_CODE);
-
- Object[] params = new Object[] {applicationCode};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- return rs.getInt(1);
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return 0;
- }
-
- @Override public String getApplicationCode(int applicationId) {
- logger.debug("get application code, applicationId: {}", applicationId);
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_OR_CODE_SQL, ApplicationTable.COLUMN_APPLICATION_CODE, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
- Object[] params = new Object[] {applicationId};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- return rs.getString(1);
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return Const.EMPTY_STRING;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IApplicationCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IApplicationCacheDAO.java
deleted file mode 100644
index 65449fd937c073780241e723ad4712b41f367f8a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IApplicationCacheDAO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IApplicationCacheDAO {
- int getApplicationId(String applicationCode);
-
- String getApplicationCode(int applicationId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IInstanceCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IInstanceCacheDAO.java
deleted file mode 100644
index 97e39850249280ee1b92d18e596bd37e1e668752..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IInstanceCacheDAO.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IInstanceCacheDAO {
- int getApplicationId(int applicationInstanceId);
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IServiceNameCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IServiceNameCacheDAO.java
deleted file mode 100644
index 13aa6201089ff44e362dd47db389c46c6c968ba7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/IServiceNameCacheDAO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-/**
- * @author peng-yongsheng
- */
-public interface IServiceNameCacheDAO {
- String getServiceName(int serviceId);
-
- int getServiceId(int applicationId, String serviceName);
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceEsCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceEsCacheDAO.java
deleted file mode 100644
index e47ab8340da677377816f9c25b9eccd7b60b90f0..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceEsCacheDAO.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import org.elasticsearch.action.get.GetResponse;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceEsCacheDAO extends EsDAO implements IInstanceCacheDAO {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceEsCacheDAO.class);
-
- @Override public int getApplicationId(int applicationInstanceId) {
- GetResponse response = getClient().prepareGet(InstanceTable.TABLE, String.valueOf(applicationInstanceId)).get();
- if (response.isExists()) {
- return (int)response.getSource().get(InstanceTable.COLUMN_APPLICATION_ID);
- } else {
- return 0;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceH2CacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceH2CacheDAO.java
deleted file mode 100644
index 88b76705b46be4078ddca7d47d5a06a9a9629e69..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/InstanceH2CacheDAO.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.storage.base.define.register.InstanceTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceH2CacheDAO extends H2DAO implements IInstanceCacheDAO {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceH2CacheDAO.class);
-
- private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ?";
-
- @Override public int getApplicationId(int applicationInstanceId) {
- logger.info("get the application id with application id = {}", applicationInstanceId);
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, InstanceTable.COLUMN_APPLICATION_ID, InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
- Object[] params = new Object[] {applicationInstanceId};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- return rs.getInt(InstanceTable.COLUMN_APPLICATION_ID);
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return 0;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameEsCacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameEsCacheDAO.java
deleted file mode 100644
index 3b9367f4cd3f164cba0c649bf5d278dcd5e0a3e2..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameEsCacheDAO.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import org.elasticsearch.action.get.GetRequestBuilder;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.search.SearchRequestBuilder;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchType;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.SearchHit;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNameEsCacheDAO extends EsDAO implements IServiceNameCacheDAO {
-
- @Override public String getServiceName(int serviceId) {
- GetRequestBuilder getRequestBuilder = getClient().prepareGet(ServiceNameTable.TABLE, String.valueOf(serviceId));
-
- GetResponse getResponse = getRequestBuilder.get();
- if (getResponse.isExists()) {
- String serviceName = (String)getResponse.getSource().get(ServiceNameTable.COLUMN_SERVICE_NAME);
- int applicationId = ((Number)getResponse.getSource().get(ServiceNameTable.COLUMN_APPLICATION_ID)).intValue();
- return applicationId + Const.ID_SPLIT + serviceName;
- }
- return Const.EMPTY_STRING;
- }
-
- @Override public int getServiceId(int applicationId, String serviceName) {
- SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ServiceNameTable.TABLE);
- searchRequestBuilder.setTypes(ServiceNameTable.TABLE_TYPE);
- searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
-
- BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
- boolQuery.must().add(QueryBuilders.matchQuery(ServiceNameTable.COLUMN_APPLICATION_ID, applicationId));
- boolQuery.must().add(QueryBuilders.matchQuery(ServiceNameTable.COLUMN_SERVICE_NAME, serviceName));
- searchRequestBuilder.setQuery(boolQuery);
- searchRequestBuilder.setSize(1);
-
- SearchResponse searchResponse = searchRequestBuilder.get();
- if (searchResponse.getHits().totalHits > 0) {
- SearchHit searchHit = searchResponse.getHits().iterator().next();
- return (int)searchHit.getSource().get(ServiceNameTable.COLUMN_SERVICE_ID);
- }
- return 0;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameH2CacheDAO.java b/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameH2CacheDAO.java
deleted file mode 100644
index 3be6d4726185641ae8ad2bde5931605d69f14996..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/java/org/skywalking/apm/collector/cache/dao/ServiceNameH2CacheDAO.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cache.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.h2.H2ClientException;
-import org.skywalking.apm.collector.core.util.Const;
-import org.skywalking.apm.collector.storage.base.define.register.ServiceNameTable;
-import org.skywalking.apm.collector.storage.h2.SqlBuilder;
-import org.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng, clevertension
- */
-public class ServiceNameH2CacheDAO extends H2DAO implements IServiceNameCacheDAO {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceNameH2CacheDAO.class);
-
- private static final String GET_SERVICE_NAME_SQL = "select {0},{1} from {2} where {3} = ?";
- private static final String GET_SERVICE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? limit 1";
-
- @Override public String getServiceName(int serviceId) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SERVICE_NAME_SQL, ServiceNameTable.COLUMN_APPLICATION_ID, ServiceNameTable.COLUMN_SERVICE_NAME,
- ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
- Object[] params = new Object[] {serviceId};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- String serviceName = rs.getString(ServiceNameTable.COLUMN_SERVICE_NAME);
- int applicationId = rs.getInt(ServiceNameTable.COLUMN_APPLICATION_ID);
- return applicationId + Const.ID_SPLIT + serviceName;
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return Const.EMPTY_STRING;
- }
-
- @Override public int getServiceId(int applicationId, String serviceName) {
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_SERVICE_ID_SQL, ServiceNameTable.COLUMN_SERVICE_ID,
- ServiceNameTable.TABLE, ServiceNameTable.COLUMN_APPLICATION_ID, ServiceNameTable.COLUMN_SERVICE_NAME);
- Object[] params = new Object[] {applicationId, serviceName};
- try (ResultSet rs = client.executeQuery(sql, params)) {
- if (rs.next()) {
- return rs.getInt(ServiceNameTable.COLUMN_SERVICE_ID);
- }
- } catch (SQLException | H2ClientException e) {
- logger.error(e.getMessage(), e);
- }
- return 0;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/es_dao.define b/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/es_dao.define
deleted file mode 100644
index e2c7caea3643b86b95e4d661396b62749ef13cb7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/es_dao.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.cache.dao.ApplicationEsCacheDAO
-org.skywalking.apm.collector.cache.dao.InstanceEsCacheDAO
-org.skywalking.apm.collector.cache.dao.ServiceNameEsCacheDAO
diff --git a/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/h2_dao.define b/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/h2_dao.define
deleted file mode 100644
index 7e0ec1b7d60b7872440c1f19983ad19d78035312..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cache/src/main/resources/META-INF/defines/h2_dao.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.cache.dao.ApplicationH2CacheDAO
-org.skywalking.apm.collector.cache.dao.InstanceH2CacheDAO
-org.skywalking.apm.collector.cache.dao.ServiceNameH2CacheDAO
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-client/pom.xml b/apm-collector-3.2.3/apm-collector-client/pom.xml
deleted file mode 100644
index d6ea5c4f37824d9f8c1d8a943871ecfebb8c3084..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-client
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-core
- ${project.version}
-
-
- com.h2database
- h2
- 1.4.196
-
-
- redis.clients
- jedis
- 2.9.0
-
-
- org.elasticsearch.client
- transport
- 5.5.0
-
-
- snakeyaml
- org.yaml
-
-
-
-
- org.apache.zookeeper
- zookeeper
- 3.4.10
-
-
- slf4j-api
- org.slf4j
-
-
- slf4j-log4j12
- org.slf4j
-
-
-
-
- io.grpc
- grpc-core
- 1.4.0
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java
deleted file mode 100644
index 791199a17286b601a0550ceeae73125259d35a9a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.elasticsearch;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
-import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
-import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
-import org.elasticsearch.action.bulk.BulkRequestBuilder;
-import org.elasticsearch.action.get.GetRequestBuilder;
-import org.elasticsearch.action.get.MultiGetRequestBuilder;
-import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.search.SearchRequestBuilder;
-import org.elasticsearch.action.update.UpdateRequest;
-import org.elasticsearch.action.update.UpdateRequestBuilder;
-import org.elasticsearch.client.IndicesAdminClient;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.transport.InetSocketTransportAddress;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.transport.client.PreBuiltTransportClient;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ElasticSearchClient implements Client {
-
- private final Logger logger = LoggerFactory.getLogger(ElasticSearchClient.class);
-
- private org.elasticsearch.client.Client client;
-
- private final String clusterName;
-
- private final Boolean clusterTransportSniffer;
-
- private final String clusterNodes;
-
- public ElasticSearchClient(String clusterName, Boolean clusterTransportSniffer, String clusterNodes) {
- this.clusterName = clusterName;
- this.clusterTransportSniffer = clusterTransportSniffer;
- this.clusterNodes = clusterNodes;
- }
-
- @Override public void initialize() throws ClientException {
- Settings settings = Settings.builder()
- .put("cluster.name", clusterName)
- .put("client.transport.sniff", clusterTransportSniffer)
- .build();
-
- client = new PreBuiltTransportClient(settings);
-
- List pairsList = parseClusterNodes(clusterNodes);
- for (AddressPairs pairs : pairsList) {
- try {
- ((PreBuiltTransportClient)client).addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(pairs.host), pairs.port));
- } catch (UnknownHostException e) {
- throw new ElasticSearchClientException(e.getMessage(), e);
- }
- }
- }
-
- @Override public void shutdown() {
-
- }
-
- private List parseClusterNodes(String nodes) {
- List pairsList = new LinkedList<>();
- logger.info("elasticsearch cluster nodes: {}", nodes);
- String[] nodesSplit = nodes.split(",");
- for (int i = 0; i < nodesSplit.length; i++) {
- String node = nodesSplit[i];
- String host = node.split(":")[0];
- String port = node.split(":")[1];
- pairsList.add(new AddressPairs(host, Integer.valueOf(port)));
- }
-
- return pairsList;
- }
-
- class AddressPairs {
- private String host;
- private Integer port;
-
- public AddressPairs(String host, Integer port) {
- this.host = host;
- this.port = port;
- }
- }
-
- public boolean createIndex(String indexName, String indexType, Settings settings, XContentBuilder mappingBuilder) {
- IndicesAdminClient adminClient = client.admin().indices();
- CreateIndexResponse response = adminClient.prepareCreate(indexName).setSettings(settings).addMapping(indexType, mappingBuilder).get();
- logger.info("create {} index with type of {} finished, isAcknowledged: {}", indexName, indexType, response.isAcknowledged());
- return response.isShardsAcked();
- }
-
- public boolean deleteIndex(String indexName) {
- IndicesAdminClient adminClient = client.admin().indices();
- DeleteIndexResponse response = adminClient.prepareDelete(indexName).get();
- logger.info("delete {} index finished, isAcknowledged: {}", indexName, response.isAcknowledged());
- return response.isAcknowledged();
- }
-
- public boolean isExistsIndex(String indexName) {
- IndicesAdminClient adminClient = client.admin().indices();
- IndicesExistsResponse response = adminClient.prepareExists(indexName).get();
- return response.isExists();
- }
-
- public SearchRequestBuilder prepareSearch(String indexName) {
- return client.prepareSearch(indexName);
- }
-
- public IndexRequestBuilder prepareIndex(String indexName, String id) {
- return client.prepareIndex(indexName, "type", id);
- }
-
- public UpdateRequestBuilder prepareUpdate(String indexName, String id) {
- return client.prepareUpdate(indexName, "type", id);
- }
-
- public GetRequestBuilder prepareGet(String indexName, String id) {
- return client.prepareGet(indexName, "type", id);
- }
-
- public MultiGetRequestBuilder prepareMultiGet() {
- return client.prepareMultiGet();
- }
-
- public BulkRequestBuilder prepareBulk() {
- return client.prepareBulk();
- }
-
- public void update(UpdateRequest updateRequest) {
- try {
- client.update(updateRequest).get();
- } catch (InterruptedException | ExecutionException e) {
- logger.error(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java
deleted file mode 100644
index 24eb74459c2ae1a6650bed6d72041858d6b4a448..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.elasticsearch;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class ElasticSearchClientException extends ClientException {
- public ElasticSearchClientException(String message) {
- super(message);
- }
-
- public ElasticSearchClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClient.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClient.java
deleted file mode 100644
index 782148bbd09cd7fa910019015725238f0d10ed93..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClient.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class GRPCClient implements Client {
-
- private final String host;
-
- private final int port;
-
- private ManagedChannel channel;
-
- public GRPCClient(String host, int port) {
- this.host = host;
- this.port = port;
- }
-
- @Override public void initialize() throws ClientException {
- channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build();
- }
-
- @Override public void shutdown() {
- channel.shutdownNow();
- }
-
- public ManagedChannel getChannel() {
- return channel;
- }
-
- @Override public String toString() {
- return host + ":" + port;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClientException.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClientException.java
deleted file mode 100644
index a0322ea6abf0d510b7229850a4770d07b28d8139..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/grpc/GRPCClientException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.grpc;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class GRPCClientException extends ClientException {
-
- public GRPCClientException(String message) {
- super(message);
- }
-
- public GRPCClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2Client.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2Client.java
deleted file mode 100644
index 74dd9b92209754615807b12ff8e275de2df0dbfd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2Client.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.h2;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import org.h2.util.IOUtils;
-import org.skywalking.apm.collector.core.client.Client;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class H2Client implements Client {
-
- private final Logger logger = LoggerFactory.getLogger(H2Client.class);
-
- private Connection conn;
- private String url;
- private String userName;
- private String password;
-
- public H2Client() {
- this.url = "jdbc:h2:mem:collector";
- this.userName = "";
- this.password = "";
- }
-
- public H2Client(String url, String userName, String password) {
- this.url = url;
- this.userName = userName;
- this.password = password;
- }
-
- @Override public void initialize() throws H2ClientException {
- try {
- Class.forName("org.h2.Driver");
- conn = DriverManager.
- getConnection(this.url, this.userName, this.password);
- } catch (Exception e) {
- throw new H2ClientException(e.getMessage(), e);
- }
- }
-
- @Override public void shutdown() {
- IOUtils.closeSilently(conn);
- }
-
- public Connection getConnection() throws H2ClientException {
- return conn;
- }
-
- public void execute(String sql) throws H2ClientException {
- try (Statement statement = getConnection().createStatement()) {
- statement.execute(sql);
- statement.closeOnCompletion();
- } catch (SQLException e) {
- throw new H2ClientException(e.getMessage(), e);
- }
- }
-
- public ResultSet executeQuery(String sql, Object[] params) throws H2ClientException {
- logger.debug("execute query with result: {}", sql);
- ResultSet rs;
- PreparedStatement statement;
- try {
- statement = getConnection().prepareStatement(sql);
- if (params != null) {
- for (int i = 0; i < params.length; i++) {
- statement.setObject(i + 1, params[i]);
- }
- }
- rs = statement.executeQuery();
- statement.closeOnCompletion();
- } catch (SQLException e) {
- throw new H2ClientException(e.getMessage(), e);
- }
- return rs;
- }
-
- public boolean execute(String sql, Object[] params) throws H2ClientException {
- logger.debug("execute insert/update/delete: {}", sql);
- boolean flag;
- Connection conn = getConnection();
- try (PreparedStatement statement = conn.prepareStatement(sql)) {
- conn.setAutoCommit(true);
- if (params != null) {
- for (int i = 0; i < params.length; i++) {
- statement.setObject(i + 1, params[i]);
- }
- }
- flag = statement.execute();
- } catch (SQLException e) {
- throw new H2ClientException(e.getMessage(), e);
- }
- return flag;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2ClientException.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2ClientException.java
deleted file mode 100644
index 45e4828a8a516f7718483c0e97a807aaccc600cd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/h2/H2ClientException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.h2;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class H2ClientException extends ClientException {
-
- public H2ClientException(String message) {
- super(message);
- }
-
- public H2ClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClient.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClient.java
deleted file mode 100644
index e759547439c69fd6a264797d4afade94bee841e1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClient.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.redis;
-
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-import redis.clients.jedis.Jedis;
-
-/**
- * @author peng-yongsheng
- */
-public class RedisClient implements Client {
-
- private Jedis jedis;
-
- private final String host;
- private final int port;
-
- public RedisClient(String host, int port) {
- this.host = host;
- this.port = port;
- }
-
- @Override public void initialize() throws ClientException {
- jedis = new Jedis(host, port);
- }
-
- @Override public void shutdown() {
-
- }
-
- public void setex(String key, int seconds, String value) {
- jedis.setex(key, seconds, value);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClientException.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClientException.java
deleted file mode 100644
index 0e30172259e4b33efdf22042d0ab4cd4f2c745a1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/redis/RedisClientException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.redis;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class RedisClientException extends ClientException {
-
- public RedisClientException(String message) {
- super(message);
- }
-
- public RedisClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java
deleted file mode 100644
index a561e8b808866665e879d44eae83d7c653590f06..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.zookeeper;
-
-import java.io.IOException;
-import java.util.List;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.data.ACL;
-import org.apache.zookeeper.data.Stat;
-import org.skywalking.apm.collector.core.client.Client;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ZookeeperClient implements Client {
-
- private final Logger logger = LoggerFactory.getLogger(ZookeeperClient.class);
-
- private ZooKeeper zk;
-
- private final String hostPort;
- private final int sessionTimeout;
- private final Watcher watcher;
-
- public ZookeeperClient(String hostPort, int sessionTimeout, Watcher watcher) {
- this.hostPort = hostPort;
- this.sessionTimeout = sessionTimeout;
- this.watcher = watcher;
- }
-
- @Override public void initialize() throws ZookeeperClientException {
- try {
- zk = new ZooKeeper(hostPort, sessionTimeout, watcher);
- } catch (IOException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- @Override public void shutdown() {
-
- }
-
- public void create(final String path, byte data[], List acl,
- CreateMode createMode) throws ZookeeperClientException {
- try {
- zk.create(path, data, acl, createMode);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- public Stat exists(final String path, boolean watch) throws ZookeeperClientException {
- try {
- return zk.exists(path, watch);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- public void delete(final String path, int version) throws ZookeeperClientException {
- try {
- zk.delete(path, version);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- public byte[] getData(String path, boolean watch, Stat stat) throws ZookeeperClientException {
- try {
- return zk.getData(path, watch, stat);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- public Stat setData(final String path, byte data[], int version) throws ZookeeperClientException {
- try {
- return zk.setData(path, data, version);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-
- public List getChildren(final String path, boolean watch) throws ZookeeperClientException {
- try {
- return zk.getChildren(path, watch);
- } catch (KeeperException | InterruptedException e) {
- throw new ZookeeperClientException(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java
deleted file mode 100644
index cdf80f33f7961810e8bf43dae918f8e7c23ce251..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.zookeeper;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class ZookeeperClientException extends ClientException {
- public ZookeeperClientException(String message) {
- super(message);
- }
-
- public ZookeeperClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/util/PathUtils.java b/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/util/PathUtils.java
deleted file mode 100644
index ccf8d37e4496a5b866a5134d18a58035dc4d77dc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-client/src/main/java/org/skywalking/apm/collector/client/zookeeper/util/PathUtils.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.client.zookeeper.util;
-
-/**
- * @author peng-yongsheng
- */
-public class PathUtils {
-
- public static String convertKey2Path(String key) {
- String[] keys = key.split("\\.");
- StringBuilder pathBuilder = new StringBuilder();
- for (String subPath : keys) {
- pathBuilder.append("/").append(subPath);
- }
- return pathBuilder.toString();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/pom.xml b/apm-collector-3.2.3/apm-collector-cluster/pom.xml
deleted file mode 100644
index 77d472d420429cde8a0df4dbbbf9a04ea2425f22..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-cluster
- jar
-
-
-
- org.skywalking
- apm-collector-3.2.3-core
- ${project.version}
-
-
- org.skywalking
- apm-collector-3.2.3-client
- ${project.version}
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleDefine.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleDefine.java
deleted file mode 100644
index 1d372476cf424db1e0b28f8d422fab29a8d164a9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleDefine.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster;
-
-import java.util.List;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.framework.UnexpectedException;
-import org.skywalking.apm.collector.core.module.ModuleDefine;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.skywalking.apm.collector.core.server.Server;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ClusterModuleDefine extends ModuleDefine {
-
- public static final String BASE_CATALOG = "skywalking";
-
- private Client client;
-
- @Override protected void initializeOtherContext() {
- try {
- client = createClient();
- client.initialize();
- dataMonitor().setClient(client);
- ClusterModuleRegistrationReader reader = registrationReader();
-
- CollectorContextHelper.INSTANCE.getClusterModuleContext().setDataMonitor(dataMonitor());
- CollectorContextHelper.INSTANCE.getClusterModuleContext().setReader(reader);
- } catch (ClientException e) {
- throw new UnexpectedException(e.getMessage());
- }
- }
-
- public final Client getClient() {
- return this.client;
- }
-
- @Override public final Server server() {
- return null;
- }
-
- @Override public final List handlerList() {
- return null;
- }
-
- @Override protected final ModuleRegistration registration() {
- throw new UnsupportedOperationException("Cluster module do not need module registration.");
- }
-
- public abstract DataMonitor dataMonitor();
-
- public abstract ClusterModuleRegistrationReader registrationReader();
-
- public void startMonitor() throws CollectorException {
- dataMonitor().start();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleGroupDefine.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleGroupDefine.java
deleted file mode 100644
index 051947bf0667a5f8606d6d570e41005b55423ce4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleGroupDefine.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster;
-
-import org.skywalking.apm.collector.core.cluster.ClusterModuleContext;
-import org.skywalking.apm.collector.core.config.GroupConfigParser;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.module.ModuleGroupDefine;
-import org.skywalking.apm.collector.core.module.ModuleInstaller;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterModuleGroupDefine implements ModuleGroupDefine {
-
- public static final String GROUP_NAME = "cluster";
- private final ClusterModuleInstaller installer;
-
- public ClusterModuleGroupDefine() {
- installer = new ClusterModuleInstaller();
- }
-
- @Override public String name() {
- return GROUP_NAME;
- }
-
- @Override public Context groupContext() {
- return new ClusterModuleContext(GROUP_NAME);
- }
-
- @Override public ModuleInstaller moduleInstaller() {
- return installer;
- }
-
- @Override public GroupConfigParser groupConfigParser() {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleInstaller.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleInstaller.java
deleted file mode 100644
index 07c15b0217b23873bf28b8141e1b35b122de1347..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterModuleInstaller.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleContext;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.module.SingleModuleInstaller;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterModuleInstaller extends SingleModuleInstaller {
-
- @Override public String groupName() {
- return ClusterModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public Context moduleContext() {
- ClusterModuleContext clusterModuleContext = new ClusterModuleContext(ClusterModuleGroupDefine.GROUP_NAME);
- CollectorContextHelper.INSTANCE.putClusterContext(clusterModuleContext);
- return clusterModuleContext;
- }
-
- @Override public List dependenceModules() {
- List dependenceModules = new LinkedList<>();
- dependenceModules.add("collector_inside");
- return dependenceModules;
- }
-
- @Override public void onAfterInstall() throws CollectorException {
- ((ClusterModuleDefine)getModuleDefine()).startMonitor();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterNodeExistException.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterNodeExistException.java
deleted file mode 100644
index 35af2df6814639967b0627dd5e15645ca13cca32..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/ClusterNodeExistException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster;
-
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterNodeExistException extends ClientException {
-
- public ClusterNodeExistException(String message) {
- super(message);
- }
-
- public ClusterNodeExistException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfig.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfig.java
deleted file mode 100644
index c5c5e43e195eaab3bcd849945cb273565f0f0799..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.redis;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterRedisConfig {
- public static String HOST;
- public static int PORT;
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfigParser.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfigParser.java
deleted file mode 100644
index abc3e6cc1e9b14c9aa9bb8b2d53f633994c3befc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisConfigParser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.redis;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterRedisConfigParser implements ModuleConfigParser {
-
- private static final String HOST = "host";
- private static final String PORT = "port";
-
- @Override public void parse(Map config) throws ConfigParseException {
- ClusterRedisConfig.HOST = (String)config.get(HOST);
- ClusterRedisConfig.PORT = (Integer)config.get(PORT);
- if (StringUtils.isEmpty(ClusterRedisConfig.HOST) || ClusterRedisConfig.PORT == 0) {
- throw new ConfigParseException("");
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleDefine.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleDefine.java
deleted file mode 100644
index 7718448557fe709b5dfc47bcdb7897265d1c5bdb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleDefine.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.redis;
-
-import org.skywalking.apm.collector.client.redis.RedisClient;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterRedisModuleDefine extends ClusterModuleDefine {
-
- public static final String MODULE_NAME = "redis";
-
- @Override public String group() {
- return ClusterModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override public boolean defaultModule() {
- return false;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new ClusterRedisConfigParser();
- }
-
- @Override public DataMonitor dataMonitor() {
- return null;
- }
-
- @Override protected Client createClient() {
- return new RedisClient(ClusterRedisConfig.HOST, ClusterRedisConfig.PORT);
- }
-
- @Override public ClusterModuleRegistrationReader registrationReader() {
- return null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleRegistrationReader.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleRegistrationReader.java
deleted file mode 100644
index a05c28e2944fb32fd6373fc633742fc9b1a233ef..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/redis/ClusterRedisModuleRegistrationReader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.redis;
-
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterRedisModuleRegistrationReader extends ClusterModuleRegistrationReader {
-
- public ClusterRedisModuleRegistrationReader(DataMonitor dataMonitor) {
- super(dataMonitor);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneConfigParser.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneConfigParser.java
deleted file mode 100644
index 3aa9eb9f1e2c94a1af4b66aacfc48c422a949e1e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneConfigParser.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.standalone;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterStandaloneConfigParser implements ModuleConfigParser {
- @Override public void parse(Map config) throws ConfigParseException {
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java
deleted file mode 100644
index d99be53a77022aa0ba146c3e7affd9c9c379d705..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.standalone;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.client.zookeeper.util.PathUtils;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterStandaloneDataMonitor implements DataMonitor {
-
- private final Logger logger = LoggerFactory.getLogger(ClusterStandaloneDataMonitor.class);
-
- private H2Client client;
-
- private Map listeners;
- private Map registrations;
-
- public ClusterStandaloneDataMonitor() {
- listeners = new LinkedHashMap<>();
- registrations = new LinkedHashMap<>();
- }
-
- @Override public void setClient(Client client) {
- this.client = (H2Client)client;
- }
-
- @Override
- public void addListener(ClusterDataListener listener, ModuleRegistration registration) throws ClientException {
- String path = PathUtils.convertKey2Path(listener.path());
- logger.info("listener path: {}", path);
- listeners.put(path, listener);
- registrations.put(path, registration);
- }
-
- @Override public ClusterDataListener getListener(String path) {
- path = PathUtils.convertKey2Path(path);
- return listeners.get(path);
- }
-
- @Override public void createPath(String path) throws ClientException {
-
- }
-
- @Override public void setData(String path, String value) throws ClientException {
- if (listeners.containsKey(path)) {
- listeners.get(path).addAddress(value);
- listeners.get(path).serverJoinNotify(value);
- }
- }
-
- @Override public void start() throws CollectorException {
- Iterator> entryIterator = registrations.entrySet().iterator();
- while (entryIterator.hasNext()) {
- Map.Entry next = entryIterator.next();
- ModuleRegistration.Value value = next.getValue().buildValue();
- String contextPath = value.getContextPath() == null ? "" : value.getContextPath();
- setData(next.getKey(), value.getHostPort() + contextPath);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleDefine.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleDefine.java
deleted file mode 100644
index e5d334dcf9eb3d44d9b906b2c1694d8799b0bd38..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleDefine.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.standalone;
-
-import org.skywalking.apm.collector.client.h2.H2Client;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterStandaloneModuleDefine extends ClusterModuleDefine {
-
- public static final String MODULE_NAME = "standalone";
-
- private final ClusterStandaloneDataMonitor dataMonitor;
-
- public ClusterStandaloneModuleDefine() {
- this.dataMonitor = new ClusterStandaloneDataMonitor();
- }
-
- @Override public String group() {
- return ClusterModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override public boolean defaultModule() {
- return true;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new ClusterStandaloneConfigParser();
- }
-
- @Override public DataMonitor dataMonitor() {
- return dataMonitor;
- }
-
- @Override protected Client createClient() {
- return new H2Client();
- }
-
- @Override public ClusterModuleRegistrationReader registrationReader() {
- return new ClusterStandaloneModuleRegistrationReader(dataMonitor);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleRegistrationReader.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleRegistrationReader.java
deleted file mode 100644
index 9d20357d77a458fa1218d9ae8527f485b10a8ff7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/standalone/ClusterStandaloneModuleRegistrationReader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.standalone;
-
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterStandaloneModuleRegistrationReader extends ClusterModuleRegistrationReader {
-
- public ClusterStandaloneModuleRegistrationReader(DataMonitor dataMonitor) {
- super(dataMonitor);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfig.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfig.java
deleted file mode 100644
index 1b350b3d36442fb63aed584959ce5688735b9a8d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.zookeeper;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterZKConfig {
- public static String HOST_PORT;
- public static int SESSION_TIMEOUT;
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfigParser.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfigParser.java
deleted file mode 100644
index f407190f44939b28dc8eedf3d5c82bee4ffe8eec..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKConfigParser.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.zookeeper;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterZKConfigParser implements ModuleConfigParser {
-
- private static final String HOST_PORT = "hostPort";
- private static final String SESSION_TIMEOUT = "sessionTimeout";
-
- @Override public void parse(Map config) throws ConfigParseException {
- ClusterZKConfig.HOST_PORT = (String)config.get(HOST_PORT);
- ClusterZKConfig.SESSION_TIMEOUT = 3000;
-
- if (StringUtils.isEmpty(ClusterZKConfig.HOST_PORT)) {
- throw new ConfigParseException("");
- }
-
- if (!StringUtils.isEmpty(config.get(SESSION_TIMEOUT))) {
- ClusterZKConfig.SESSION_TIMEOUT = (Integer)config.get(SESSION_TIMEOUT);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java
deleted file mode 100644
index 2f4990ec3978bb4bef6526636f3a95c1be0885f5..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.zookeeper;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooDefs;
-import org.apache.zookeeper.data.Stat;
-import org.skywalking.apm.collector.client.zookeeper.ZookeeperClient;
-import org.skywalking.apm.collector.client.zookeeper.ZookeeperClientException;
-import org.skywalking.apm.collector.client.zookeeper.util.PathUtils;
-import org.skywalking.apm.collector.cluster.ClusterNodeExistException;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterZKDataMonitor implements DataMonitor, Watcher {
-
- private final Logger logger = LoggerFactory.getLogger(ClusterZKDataMonitor.class);
-
- private ZookeeperClient client;
-
- private Map listeners;
- private Map registrations;
-
- public ClusterZKDataMonitor() {
- listeners = new LinkedHashMap<>();
- registrations = new LinkedHashMap<>();
- }
-
- @Override public synchronized void process(WatchedEvent event) {
- logger.info("changed path {}, event type: {}", event.getPath(), event.getType().name());
- if (listeners.containsKey(event.getPath())) {
- List paths;
- try {
- paths = client.getChildren(event.getPath(), true);
- ClusterDataListener listener = listeners.get(event.getPath());
- Set remoteNodes = new HashSet<>();
- Set notifiedNodes = listener.getAddresses();
- if (CollectionUtils.isNotEmpty(paths)) {
- for (String serverPath : paths) {
- Stat stat = new Stat();
- byte[] data = client.getData(event.getPath() + "/" + serverPath, true, stat);
- String dataStr = new String(data);
- String addressValue = serverPath + dataStr;
- remoteNodes.add(addressValue);
- if (!notifiedNodes.contains(addressValue)) {
- logger.info("path children has been created, path: {}, data: {}", event.getPath() + "/" + serverPath, dataStr);
- listener.addAddress(addressValue);
- listener.serverJoinNotify(addressValue);
- }
- }
- }
-
- String[] notifiedNodeArray = notifiedNodes.toArray(new String[notifiedNodes.size()]);
- for (int i = notifiedNodeArray.length - 1; i >= 0; i--) {
- String address = notifiedNodeArray[i];
- if (remoteNodes.isEmpty() || !remoteNodes.contains(address)) {
- logger.info("path children has been remove, path and data: {}", event.getPath() + "/" + address);
- listener.removeAddress(address);
- listener.serverQuitNotify(address);
- }
- }
- } catch (ZookeeperClientException e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-
- @Override public void setClient(Client client) {
- this.client = (ZookeeperClient)client;
- }
-
- @Override public void start() throws CollectorException {
- Iterator> entryIterator = registrations.entrySet().iterator();
- while (entryIterator.hasNext()) {
- Map.Entry next = entryIterator.next();
- createPath(next.getKey());
-
- ModuleRegistration.Value value = next.getValue().buildValue();
- String contextPath = value.getContextPath() == null ? "" : value.getContextPath();
-
- client.getChildren(next.getKey(), true);
- String serverPath = next.getKey() + "/" + value.getHostPort();
-
- Stat stat = client.exists(serverPath, false);
- if (stat != null) {
- client.delete(serverPath, stat.getVersion());
- }
- stat = client.exists(serverPath, false);
- if (stat == null) {
- setData(serverPath, contextPath);
- } else {
- client.delete(serverPath, stat.getVersion());
- throw new ClusterNodeExistException("current address: " + value.getHostPort() + " has been registered, check the host and port configuration or wait a moment.");
- }
- }
- }
-
- @Override
- public void addListener(ClusterDataListener listener, ModuleRegistration registration) throws ClientException {
- String path = PathUtils.convertKey2Path(listener.path());
- logger.info("listener path: {}", path);
- listeners.put(path, listener);
- registrations.put(path, registration);
- }
-
- @Override public ClusterDataListener getListener(String path) {
- path = PathUtils.convertKey2Path(path);
- return listeners.get(path);
- }
-
- @Override public void createPath(String path) throws ClientException {
- String[] paths = path.replaceFirst("/", "").split("/");
-
- StringBuilder pathBuilder = new StringBuilder();
- for (String subPath : paths) {
- pathBuilder.append("/").append(subPath);
- if (client.exists(pathBuilder.toString(), false) == null) {
- client.create(pathBuilder.toString(), null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
- }
- }
- }
-
- @Override public void setData(String path, String value) throws ClientException {
- if (client.exists(path, false) == null) {
- client.create(path, value.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
- } else {
- client.setData(path, value.getBytes(), -1);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleDefine.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleDefine.java
deleted file mode 100644
index 6cbc453c1e7c430b95060e18f31dac6775c6dc19..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleDefine.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.zookeeper;
-
-import org.skywalking.apm.collector.client.zookeeper.ZookeeperClient;
-import org.skywalking.apm.collector.cluster.ClusterModuleDefine;
-import org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-import org.skywalking.apm.collector.core.module.ModuleConfigParser;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterZKModuleDefine extends ClusterModuleDefine {
-
- public static final String MODULE_NAME = "zookeeper";
- private final ClusterZKDataMonitor dataMonitor;
-
- public ClusterZKModuleDefine() {
- dataMonitor = new ClusterZKDataMonitor();
- }
-
- @Override protected String group() {
- return ClusterModuleGroupDefine.GROUP_NAME;
- }
-
- @Override public String name() {
- return MODULE_NAME;
- }
-
- @Override public boolean defaultModule() {
- return false;
- }
-
- @Override protected ModuleConfigParser configParser() {
- return new ClusterZKConfigParser();
- }
-
- @Override public DataMonitor dataMonitor() {
- return dataMonitor;
- }
-
- @Override protected Client createClient() {
- return new ZookeeperClient(ClusterZKConfig.HOST_PORT, ClusterZKConfig.SESSION_TIMEOUT, dataMonitor);
- }
-
- @Override public ClusterModuleRegistrationReader registrationReader() {
- return new ClusterZKModuleRegistrationReader(dataMonitor);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleRegistrationReader.java b/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleRegistrationReader.java
deleted file mode 100644
index a62e7baabe93b1d8c9b6f564fca94d4fd481b46a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/java/org/skywalking/apm/collector/cluster/zookeeper/ClusterZKModuleRegistrationReader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.cluster.zookeeper;
-
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleRegistrationReader;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterZKModuleRegistrationReader extends ClusterModuleRegistrationReader {
-
- public ClusterZKModuleRegistrationReader(DataMonitor dataMonitor) {
- super(dataMonitor);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/group.define b/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/group.define
deleted file mode 100644
index 333959bcb1f2f8c345db841dd09ae496a45c1a12..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/group.define
+++ /dev/null
@@ -1 +0,0 @@
-org.skywalking.apm.collector.cluster.ClusterModuleGroupDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/module.define b/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/module.define
deleted file mode 100644
index 64e4e0bf724e6611e0883c6b8f2fe04fd20e309e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-cluster/src/main/resources/META-INF/defines/module.define
+++ /dev/null
@@ -1,3 +0,0 @@
-org.skywalking.apm.collector.cluster.zookeeper.ClusterZKModuleDefine
-org.skywalking.apm.collector.cluster.standalone.ClusterStandaloneModuleDefine
-org.skywalking.apm.collector.cluster.redis.ClusterRedisModuleDefine
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-core/pom.xml b/apm-collector-3.2.3/apm-collector-core/pom.xml
deleted file mode 100644
index 719ffe82284bb8a98f4e5a9154c4b550a42e4ab3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- apm-collector-3.2.3
- org.skywalking
- 3.2.4-2017
-
- 4.0.0
-
- apm-collector-3.2.3-core
- jar
-
-
-
- org.yaml
- snakeyaml
- 1.18
-
-
- com.google.code.gson
- gson
- 2.8.1
-
-
-
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/CollectorException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/CollectorException.java
deleted file mode 100644
index ba459eeebbf3bbbd4497b24df5573f7339ab7bb3..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/CollectorException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core;
-
-/**
- * @author peng-yongsheng
- */
-public class CollectorException extends Exception {
-
- public CollectorException(String message) {
- super(message);
- }
-
- public CollectorException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/Client.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/Client.java
deleted file mode 100644
index d6f4141ebf6005cb3cba00197be132c6e34c594c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/Client.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.client;
-
-/**
- * @author peng-yongsheng
- */
-public interface Client {
- void initialize() throws ClientException;
-
- void shutdown();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/ClientException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/ClientException.java
deleted file mode 100644
index b3088011c844d19306d987dfa2aa14d7a9c8ae68..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/ClientException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.client;
-
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ClientException extends CollectorException {
- public ClientException(String message) {
- super(message);
- }
-
- public ClientException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/DataMonitor.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/DataMonitor.java
deleted file mode 100644
index 3143383624783e7a8c8fbe7b0c479ebcfb45f469..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/client/DataMonitor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.client;
-
-import org.skywalking.apm.collector.core.cluster.ClusterDataListener;
-import org.skywalking.apm.collector.core.framework.Starter;
-import org.skywalking.apm.collector.core.module.ModuleRegistration;
-
-/**
- * @author peng-yongsheng
- */
-public interface DataMonitor extends Starter {
- void setClient(Client client);
-
- void addListener(ClusterDataListener listener, ModuleRegistration registration) throws ClientException;
-
- ClusterDataListener getListener(String path);
-
- void createPath(String path) throws ClientException;
-
- void setData(String path, String value) throws ClientException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListener.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListener.java
deleted file mode 100644
index 1d0f43b6a53215033728a9147790b77048717da8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.skywalking.apm.collector.core.framework.Listener;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ClusterDataListener implements Listener {
-
- private Set addresses;
-
- public ClusterDataListener() {
- addresses = new HashSet<>();
- }
-
- public abstract String path();
-
- public final void addAddress(String address) {
- addresses.add(address);
- }
-
- public final void removeAddress(String address) {
- addresses.remove(address);
- }
-
- public final Set getAddresses() {
- return addresses;
- }
-
- public abstract void serverJoinNotify(String serverAddress);
-
- public abstract void serverQuitNotify(String serverAddress);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListenerDefine.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListenerDefine.java
deleted file mode 100644
index b77e1a1a68a433548d4a3c984af853a5ace355bc..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterDataListenerDefine.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-/**
- * @author peng-yongsheng
- */
-public interface ClusterDataListenerDefine {
- ClusterDataListener listener();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleContext.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleContext.java
deleted file mode 100644
index 56ab0aa66ff9f6df66690348202953e9887912aa..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleContext.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-import org.skywalking.apm.collector.core.client.DataMonitor;
-import org.skywalking.apm.collector.core.framework.Context;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterModuleContext extends Context {
-
- public ClusterModuleContext(String groupName) {
- super(groupName);
- }
-
- private ClusterModuleRegistrationReader reader;
-
- private DataMonitor dataMonitor;
-
- public ClusterModuleRegistrationReader getReader() {
- return reader;
- }
-
- public void setReader(ClusterModuleRegistrationReader reader) {
- this.reader = reader;
- }
-
- public DataMonitor getDataMonitor() {
- return dataMonitor;
- }
-
- public void setDataMonitor(DataMonitor dataMonitor) {
- this.dataMonitor = dataMonitor;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleDiscovery.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleDiscovery.java
deleted file mode 100644
index 508ecd0ab2f83dbae1312bb2448f6d65f5bee23e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleDiscovery.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-/**
- * @author peng-yongsheng
- */
-public interface ClusterModuleDiscovery {
-
- void discover();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleException.java
deleted file mode 100644
index f8ba83d01cfdbe0aa83c6c104c912aedd285eae2..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-import org.skywalking.apm.collector.core.module.ModuleException;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterModuleException extends ModuleException {
-
- public ClusterModuleException(String message) {
- super(message);
- }
-
- public ClusterModuleException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleRegistrationReader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleRegistrationReader.java
deleted file mode 100644
index 775b92fe1a6faed92c022bfcbd1546ee98e1f97c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/cluster/ClusterModuleRegistrationReader.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.cluster;
-
-import java.util.Set;
-import org.skywalking.apm.collector.core.client.DataMonitor;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ClusterModuleRegistrationReader {
-
- private final DataMonitor dataMonitor;
-
- public ClusterModuleRegistrationReader(DataMonitor dataMonitor) {
- this.dataMonitor = dataMonitor;
- }
-
- public final Set read(String path) {
- return dataMonitor.getListener(path).getAddresses();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigException.java
deleted file mode 100644
index b5e970046c1ac8f71599eea584933a76185ae34f..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ConfigException extends CollectorException {
-
- public ConfigException(String message) {
- super(message);
- }
-
- public ConfigException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoader.java
deleted file mode 100644
index bc0deb8b63e773a1fd82d7d3bab83cf6d67978a7..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-import org.skywalking.apm.collector.core.framework.Loader;
-
-/**
- * @author peng-yongsheng
- */
-public interface ConfigLoader extends Loader {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoaderException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoaderException.java
deleted file mode 100644
index 2a6ce6bc738b826b80679c67d1cc28342acc4384..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigLoaderException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ConfigLoaderException extends ConfigException {
-
- public ConfigLoaderException(String message) {
- super(message);
- }
-
- public ConfigLoaderException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigParseException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigParseException.java
deleted file mode 100644
index f5293b8916a67fbb98317c3850de22f95351cd90..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/ConfigParseException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-/**
- * @author peng-yongsheng
- */
-public class ConfigParseException extends ConfigException {
-
- public ConfigParseException(String message) {
- super(message);
- }
-
- public ConfigParseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/GroupConfigParser.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/GroupConfigParser.java
deleted file mode 100644
index 62f644d0b0f2f9c246fe796e0c3d96a0aa3335c1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/GroupConfigParser.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-import java.util.Map;
-
-/**
- * @author peng-yongsheng
- */
-public interface GroupConfigParser {
- String NODE_NAME = "config";
-
- void parse(Map config);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfig.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfig.java
deleted file mode 100644
index ec787f6843ec648c6d58810898b8e412bf6c4f22..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfig.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-/**
- * @author peng-yongsheng
- */
-public class SystemConfig {
- public static String DATA_PATH = "../data";
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfigParser.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfigParser.java
deleted file mode 100644
index aa90354dd3af1385adde65d3d8feecb082a908fb..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/config/SystemConfigParser.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.config;
-
-import org.skywalking.apm.collector.core.util.StringUtils;
-
-/**
- * @author peng-yongsheng
- */
-public enum SystemConfigParser {
- INSTANCE;
-
- private static final String DATA_PATH = "data.path";
-
- public void parse() {
- if (!StringUtils.isEmpty(System.getProperty(DATA_PATH))) {
- SystemConfig.DATA_PATH = System.getProperty(DATA_PATH);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/CollectorContextHelper.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/CollectorContextHelper.java
deleted file mode 100644
index eaace4ac086f817d506c8950107bc0d4c91ce3d8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/CollectorContextHelper.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleContext;
-
-/**
- * @author peng-yongsheng
- */
-public enum CollectorContextHelper {
- INSTANCE;
-
- private ClusterModuleContext clusterModuleContext;
- private Map contexts = new LinkedHashMap<>();
-
- public Context getContext(String moduleGroupName) {
- return contexts.get(moduleGroupName);
- }
-
- public ClusterModuleContext getClusterModuleContext() {
- return this.clusterModuleContext;
- }
-
- public void putContext(Context context) {
- if (contexts.containsKey(context.getGroupName())) {
- throw new UnsupportedOperationException("This module context was put, do not allow put a new one");
- } else {
- contexts.put(context.getGroupName(), context);
- }
- }
-
- public void putClusterContext(ClusterModuleContext clusterModuleContext) {
- this.clusterModuleContext = clusterModuleContext;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Context.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Context.java
deleted file mode 100644
index 46276227848cefb4c4a1bbcdf854473df292d0ac..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Context.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class Context {
- private final String groupName;
-
- public Context(String groupName) {
- this.groupName = groupName;
- }
-
- public final String getGroupName() {
- return groupName;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DataInitializer.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DataInitializer.java
deleted file mode 100644
index 497ff19099b6ff1b3f336b87e0413349422d0d65..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DataInitializer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.client.ClientException;
-
-/**
- * @author peng-yongsheng
- */
-public interface DataInitializer {
- void initialize(Client client) throws ClientException;
-
- void addItem(Client client, String itemKey) throws ClientException;
-
- boolean existItem(Client client, String itemKey) throws ClientException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Decision.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Decision.java
deleted file mode 100644
index 31941777609cfda69bd07f0141c3713d1362f183..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Decision.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Decision {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Define.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Define.java
deleted file mode 100644
index 6650fe4e1c9f5dd8152ab5634a36b58f7c387d95..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Define.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Define {
- String name();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefineException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefineException.java
deleted file mode 100644
index 18ebb00c9532f7a12ff529d3c3995a47629e0f4c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefineException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class DefineException extends CollectorException {
-
- public DefineException(String message) {
- super(message);
- }
-
- public DefineException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefinitionFile.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefinitionFile.java
deleted file mode 100644
index c06b6a8e98599affc57197f04fea3da3da0dd39e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/DefinitionFile.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class DefinitionFile {
-
- private static final String CATALOG = "META-INF/defines/";
-
- protected abstract String fileName();
-
- public final String get() {
- return CATALOG + fileName();
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Executor.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Executor.java
deleted file mode 100644
index f768bac44414d1b5491724d8d74137955ecf6fce..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Executor.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Executor {
- void execute(Object message);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Handler.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Handler.java
deleted file mode 100644
index b482237bed940e4f47136e8d7200b40b589e8c71..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Handler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface ServerHandler {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Listener.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Listener.java
deleted file mode 100644
index 20e8e8aa489feeb9f8bdee63382e7ddcf83342d4..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Listener.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Listener {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Loader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Loader.java
deleted file mode 100644
index 8cd44208e2af9a6d6401fcf001bf57c0b984ca64..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Loader.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Loader {
- T load() throws DefineException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/PriorityDecision.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/PriorityDecision.java
deleted file mode 100644
index bc9a263de9204eb0c85bbc4ea1dc8a46397792bf..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/PriorityDecision.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class PriorityDecision implements Decision {
-
- public Object decide(List source) {
- return source.get(0);
- }
-
- public static class Priority {
- private final int value;
- private final Object object;
-
- public Priority(int value, Object object) {
- this.value = value;
- this.object = object;
- }
-
- public int getValue() {
- return value;
- }
-
- public Object getObject() {
- return object;
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Provider.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Provider.java
deleted file mode 100644
index f49cf0519faa8b0133e2a2e01f80f21487476b9d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Provider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public interface Provider {
- D create();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Starter.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Starter.java
deleted file mode 100644
index ae5f2f26345e810137c58e231090ef081dad4518..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/Starter.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public interface Starter {
- void start() throws CollectorException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/UnexpectedException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/UnexpectedException.java
deleted file mode 100644
index dd10bf08dcbb3e37c38a0daa778005fad401e5e1..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/framework/UnexpectedException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.framework;
-
-/**
- * @author peng-yongsheng
- */
-public class UnexpectedException extends RuntimeException {
-
- public UnexpectedException(String message) {
- super(message);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/CommonModuleInstaller.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/CommonModuleInstaller.java
deleted file mode 100644
index 5ded4903ca1ff1a49cafebea0dd39ef8f811880b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/CommonModuleInstaller.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class CommonModuleInstaller implements ModuleInstaller {
-
- private boolean isInstalled = false;
- private Map moduleConfig;
- private Map moduleDefineMap;
-
- @Override
- public final void injectConfiguration(Map moduleConfig, Map moduleDefineMap) {
- this.moduleConfig = moduleConfig;
- this.moduleDefineMap = moduleDefineMap;
- }
-
- final Map getModuleConfig() {
- return moduleConfig;
- }
-
- final Map getModuleDefineMap() {
- return moduleDefineMap;
- }
-
- public abstract void onAfterInstall() throws CollectorException;
-
- @Override public final void afterInstall() throws CollectorException {
- if (!isInstalled) {
- onAfterInstall();
- }
- isInstalled = true;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/Module.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/Module.java
deleted file mode 100644
index c315e0cfc36b936cca9078b463f33e6d8a7d0ec9..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/Module.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Map;
-
-/**
- * @author peng-yongsheng
- */
-public interface Module {
- void install(Map configuration);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigLoader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigLoader.java
deleted file mode 100644
index 4b5140e2a50c94bf5179c669249db35678fd8eee..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigLoader.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.io.FileNotFoundException;
-import java.io.Reader;
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigLoader;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.util.ResourceUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleConfigLoader implements ConfigLoader> {
-
- private final Logger logger = LoggerFactory.getLogger(ModuleConfigLoader.class);
-
- @Override public Map load() throws DefineException {
- Yaml yaml = new Yaml();
- try {
- try {
- Reader applicationReader = ResourceUtils.read("application.yml");
- return (Map)yaml.load(applicationReader);
- } catch (FileNotFoundException e) {
- logger.info("Could not found application.yml file, use default");
- return (Map)yaml.load(ResourceUtils.read("application-default.yml"));
- }
- } catch (FileNotFoundException e) {
- throw new ModuleDefineException(e.getMessage(), e);
- }
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigParser.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigParser.java
deleted file mode 100644
index 9c7ef7b354e5c7d2006a5e9f70c20fb40ae17cc5..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleConfigParser.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Map;
-import org.skywalking.apm.collector.core.config.ConfigParseException;
-
-/**
- * @author peng-yongsheng
- */
-public interface ModuleConfigParser {
- void parse(Map config) throws ConfigParseException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleContext.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleContext.java
deleted file mode 100644
index 97121822ef106c6249cb523b87b5d633d79486ce..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleContext.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.cluster.ClusterModuleContext;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleContext {
- private ClusterModuleContext clusterContext;
-
- public ClusterModuleContext getClusterContext() {
- return clusterContext;
- }
-
- public void setClusterContext(ClusterModuleContext clusterContext) {
- this.clusterContext = clusterContext;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefine.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefine.java
deleted file mode 100644
index 8544ad1ab983169d6e5486d4c72f512722bf4d6d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefine.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.List;
-import org.skywalking.apm.collector.core.client.Client;
-import org.skywalking.apm.collector.core.framework.Define;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.server.Server;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ModuleDefine implements Define {
-
- protected abstract String group();
-
- public abstract boolean defaultModule();
-
- protected abstract ModuleConfigParser configParser();
-
- protected abstract Client createClient();
-
- protected abstract Server server();
-
- public abstract List handlerList();
-
- protected abstract ModuleRegistration registration();
-
- protected abstract void initializeOtherContext();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineException.java
deleted file mode 100644
index 202f31ccbd9662991240c8c282f3c28cb4703b70..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.framework.DefineException;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleDefineException extends DefineException {
- public ModuleDefineException(String message) {
- super(message);
- }
-
- public ModuleDefineException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineLoader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineLoader.java
deleted file mode 100644
index 3a65c6f6405b9fa999d59f96b414b3ecc7c7d107..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefineLoader.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.framework.Loader;
-import org.skywalking.apm.collector.core.util.DefinitionLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleDefineLoader implements Loader>> {
-
- private final Logger logger = LoggerFactory.getLogger(ModuleDefineLoader.class);
-
- @Override public Map> load() throws DefineException {
- Map> moduleDefineMap = new LinkedHashMap<>();
-
- ModuleDefinitionFile definitionFile = new ModuleDefinitionFile();
- logger.info("module definition file name: {}", definitionFile.fileName());
- DefinitionLoader definitionLoader = DefinitionLoader.load(ModuleDefine.class, definitionFile);
- for (ModuleDefine moduleDefine : definitionLoader) {
- logger.info("loaded module definition class: {}", moduleDefine.getClass().getName());
-
- String groupName = moduleDefine.group();
- if (!moduleDefineMap.containsKey(groupName)) {
- moduleDefineMap.put(groupName, new LinkedHashMap<>());
- }
- moduleDefineMap.get(groupName).put(moduleDefine.name().toLowerCase(), moduleDefine);
- }
- return moduleDefineMap;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefinitionFile.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefinitionFile.java
deleted file mode 100644
index d14cef1e411d3edaea4ea323fcda6aec308115fa..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleDefinitionFile.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.framework.DefinitionFile;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleDefinitionFile extends DefinitionFile {
- @Override protected String fileName() {
- return "module.define";
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleException.java
deleted file mode 100644
index da7a56cd7f66fb097c4ef9dc2cbd051298791d1c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.framework.DefineException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ModuleException extends DefineException {
-
- public ModuleException(String message) {
- super(message);
- }
-
- public ModuleException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefine.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefine.java
deleted file mode 100644
index 105103aa1a59b3fd27b96ce78036e8988e98bdcd..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefine.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.config.GroupConfigParser;
-import org.skywalking.apm.collector.core.framework.Context;
-
-/**
- * @author peng-yongsheng
- */
-public interface ModuleGroupDefine {
- String name();
-
- Context groupContext();
-
- ModuleInstaller moduleInstaller();
-
- GroupConfigParser groupConfigParser();
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineFile.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineFile.java
deleted file mode 100644
index db871d9b2fb4e10a21866d5a8b4bfcc4f75d246e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineFile.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import org.skywalking.apm.collector.core.framework.DefinitionFile;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleGroupDefineFile extends DefinitionFile {
- @Override protected String fileName() {
- return "group.define";
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineLoader.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineLoader.java
deleted file mode 100644
index 38deb7659cf3240d544fc4138c8f7e1309681b4a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleGroupDefineLoader.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.framework.Loader;
-import org.skywalking.apm.collector.core.util.DefinitionLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ModuleGroupDefineLoader implements Loader> {
-
- private final Logger logger = LoggerFactory.getLogger(ModuleGroupDefineLoader.class);
-
- @Override public Map load() throws DefineException {
- Map moduleGroupDefineMap = new LinkedHashMap<>();
-
- ModuleGroupDefineFile definitionFile = new ModuleGroupDefineFile();
- logger.info("module group definition file name: {}", definitionFile.fileName());
- DefinitionLoader definitionLoader = DefinitionLoader.load(ModuleGroupDefine.class, definitionFile);
- Iterator defineIterator = definitionLoader.iterator();
- while (defineIterator.hasNext()) {
- ModuleGroupDefine groupDefine = defineIterator.next();
- String groupName = groupDefine.name().toLowerCase();
- moduleGroupDefineMap.put(groupName, groupDefine);
- }
- return moduleGroupDefineMap;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleInstaller.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleInstaller.java
deleted file mode 100644
index a59c0a20d4d03786c0c827d01313d62f7e5f7b70..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleInstaller.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.config.ConfigException;
-import org.skywalking.apm.collector.core.framework.Context;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.server.ServerException;
-import org.skywalking.apm.collector.core.server.ServerHolder;
-
-/**
- * @author peng-yongsheng
- */
-public interface ModuleInstaller {
-
- List dependenceModules();
-
- void injectServerHolder(ServerHolder serverHolder);
-
- String groupName();
-
- Context moduleContext();
-
- void injectConfiguration(Map moduleConfig, Map moduleDefineMap);
-
- void preInstall() throws DefineException, ConfigException, ServerException;
-
- void install() throws ClientException, DefineException, ConfigException, ServerException;
-
- void afterInstall() throws CollectorException;
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleRegistration.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleRegistration.java
deleted file mode 100644
index 42bbd5fe3834fff48b1cbb63cccb31127c3bbe78..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/ModuleRegistration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ModuleRegistration {
-
- public abstract Value buildValue();
-
- public static class Value {
- private final String host;
- private final int port;
- private final String contextPath;
-
- public Value(String host, int port, String contextPath) {
- this.host = host;
- this.port = port;
- this.contextPath = contextPath;
- }
-
- public String getHost() {
- return host;
- }
-
- public int getPort() {
- return port;
- }
-
- public String getHostPort() {
- return host + ":" + port;
- }
-
- public String getContextPath() {
- return contextPath;
- }
- }
-}
\ No newline at end of file
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/MultipleModuleInstaller.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/MultipleModuleInstaller.java
deleted file mode 100644
index 2f64d0a2b75ea96fbf355637576ecf22a62a66d8..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/MultipleModuleInstaller.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import org.skywalking.apm.collector.core.CollectorException;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListenerDefine;
-import org.skywalking.apm.collector.core.config.ConfigException;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.server.ServerException;
-import org.skywalking.apm.collector.core.server.ServerHolder;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class MultipleModuleInstaller extends CommonModuleInstaller {
-
- private final Logger logger = LoggerFactory.getLogger(MultipleModuleInstaller.class);
-
- public MultipleModuleInstaller() {
- moduleDefines = new LinkedList<>();
- }
-
- private List moduleDefines;
- private ServerHolder serverHolder;
-
- @Override public final void injectServerHolder(ServerHolder serverHolder) {
- this.serverHolder = serverHolder;
- }
-
- @Override public final void preInstall() throws DefineException, ConfigException, ServerException {
- logger.info("install module group: {}", groupName());
- Map moduleConfig = getModuleConfig();
- Map moduleDefineMap = getModuleDefineMap();
-
- Iterator> moduleDefineIterator = moduleDefineMap.entrySet().iterator();
- while (moduleDefineIterator.hasNext()) {
- Map.Entry moduleDefineEntry = moduleDefineIterator.next();
- logger.info("module {} initialize", moduleDefineEntry.getKey());
- moduleDefineEntry.getValue().configParser().parse(moduleConfig.get(moduleDefineEntry.getKey()));
- moduleDefines.add(moduleDefineEntry.getValue());
- serverHolder.holdServer(moduleDefineEntry.getValue().server(), moduleDefineEntry.getValue().handlerList());
- }
- }
-
- @Override public void install() throws DefineException, ConfigException, ServerException, ClientException {
- CollectorContextHelper.INSTANCE.putContext(moduleContext());
- for (ModuleDefine moduleDefine : moduleDefines) {
- moduleDefine.initializeOtherContext();
-
- if (moduleDefine instanceof ClusterDataListenerDefine) {
- ClusterDataListenerDefine listenerDefine = (ClusterDataListenerDefine)moduleDefine;
- if (ObjectUtils.isNotEmpty(listenerDefine.listener()) && ObjectUtils.isNotEmpty(moduleDefine.registration())) {
- logger.info("add group: {}, module: {}, listener into cluster data monitor", moduleDefine.group(), moduleDefine.name());
- CollectorContextHelper.INSTANCE.getClusterModuleContext().getDataMonitor().addListener(listenerDefine.listener(), moduleDefine.registration());
- }
- }
- }
- }
-
- @Override public void onAfterInstall() throws CollectorException {
-
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/SingleModuleInstaller.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/SingleModuleInstaller.java
deleted file mode 100644
index b61776948ecd9fb1979881cecaca2ec9d37771cf..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/module/SingleModuleInstaller.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.module;
-
-import java.util.Iterator;
-import java.util.Map;
-import org.skywalking.apm.collector.core.client.ClientException;
-import org.skywalking.apm.collector.core.cluster.ClusterDataListenerDefine;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleContext;
-import org.skywalking.apm.collector.core.cluster.ClusterModuleException;
-import org.skywalking.apm.collector.core.config.ConfigException;
-import org.skywalking.apm.collector.core.framework.CollectorContextHelper;
-import org.skywalking.apm.collector.core.framework.DefineException;
-import org.skywalking.apm.collector.core.server.ServerException;
-import org.skywalking.apm.collector.core.server.ServerHolder;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class SingleModuleInstaller extends CommonModuleInstaller {
-
- private final Logger logger = LoggerFactory.getLogger(SingleModuleInstaller.class);
-
- private ModuleDefine moduleDefine;
- private ServerHolder serverHolder;
-
- @Override public final void injectServerHolder(ServerHolder serverHolder) {
- this.serverHolder = serverHolder;
- }
-
- @Override public final void preInstall() throws DefineException, ConfigException, ServerException {
- logger.info("install module group: {}", groupName());
- Map moduleConfig = getModuleConfig();
- Map moduleDefineMap = getModuleDefineMap();
- if (CollectionUtils.isNotEmpty(moduleConfig)) {
- if (moduleConfig.size() > 1) {
- throw new ClusterModuleException("single module, but configure multiple modules");
- }
-
- Map.Entry configEntry = moduleConfig.entrySet().iterator().next();
- if (moduleDefineMap.containsKey(configEntry.getKey())) {
- moduleDefine = moduleDefineMap.get(configEntry.getKey());
- moduleDefine.configParser().parse(configEntry.getValue());
- } else {
- throw new ClusterModuleException("module name incorrect, please check the module name in application.yml");
- }
- } else {
- logger.info("could not configure module, use the default");
- Iterator> moduleDefineIterator = moduleDefineMap.entrySet().iterator();
-
- boolean hasDefaultModule = false;
- while (moduleDefineIterator.hasNext()) {
- Map.Entry moduleDefineEntry = moduleDefineIterator.next();
- if (moduleDefineEntry.getValue().defaultModule()) {
- if (hasDefaultModule) {
- throw new ClusterModuleException("single module, but configure multiple default module");
- }
- this.moduleDefine = moduleDefineEntry.getValue();
- if (this.moduleDefine.configParser() != null) {
- this.moduleDefine.configParser().parse(null);
- }
- hasDefaultModule = true;
- }
- }
- }
- serverHolder.holdServer(moduleDefine.server(), moduleDefine.handlerList());
- }
-
- @Override public void install() throws ClientException, DefineException, ConfigException, ServerException {
- if (!(moduleContext() instanceof ClusterModuleContext)) {
- CollectorContextHelper.INSTANCE.putContext(moduleContext());
- }
- moduleDefine.initializeOtherContext();
-
- if (moduleDefine instanceof ClusterDataListenerDefine) {
- ClusterDataListenerDefine listenerDefine = (ClusterDataListenerDefine)moduleDefine;
- if (ObjectUtils.isNotEmpty(listenerDefine.listener()) && ObjectUtils.isNotEmpty(moduleDefine.registration())) {
- CollectorContextHelper.INSTANCE.getClusterModuleContext().getDataMonitor().addListener(listenerDefine.listener(), moduleDefine.registration());
- logger.info("add group: {}, module: {}, listener into cluster data monitor", moduleDefine.group(), moduleDefine.name());
- }
- }
- }
-
- protected ModuleDefine getModuleDefine() {
- return moduleDefine;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/DaemonThreadFactory.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/DaemonThreadFactory.java
deleted file mode 100644
index 7da9a257701eb9cc428e4d97c316447c6643047e..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/DaemonThreadFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-import java.util.concurrent.ThreadFactory;
-
-/**
- * @author peng-yongsheng
- */
-public enum DaemonThreadFactory implements ThreadFactory {
- INSTANCE;
-
- @Override
- public Thread newThread(Runnable r) {
- Thread t = new Thread(r);
- t.setDaemon(true);
- return t;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/EndOfBatchCommand.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/EndOfBatchCommand.java
deleted file mode 100644
index 41565d36b312d59d157eda48273cf969332aa174..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/EndOfBatchCommand.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-/**
- * @author peng-yongsheng
- */
-public class EndOfBatchCommand {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/MessageHolder.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/MessageHolder.java
deleted file mode 100644
index c10ba3512dd1dea20c4cfb9a832fc5a426aacb6d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/MessageHolder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-/**
- * @author peng-yongsheng
- */
-public class MessageHolder {
- private Object message;
-
- public Object getMessage() {
- return message;
- }
-
- public void setMessage(Object message) {
- this.message = message;
- }
-
- public void reset() {
- message = null;
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueCreator.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueCreator.java
deleted file mode 100644
index 39236b58a7d313dd574afae0188159ddf2c5c82b..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueCreator.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-/**
- * @author peng-yongsheng
- */
-public interface QueueCreator {
- QueueEventHandler create(int queueSize, QueueExecutor executor);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueEventHandler.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueEventHandler.java
deleted file mode 100644
index aa13c82b293f50a9ef9c4deef2c7686c3cab225d..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueEventHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-/**
- * @author peng-yongsheng
- */
-public interface QueueEventHandler {
- void tell(Object message);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueExecutor.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueExecutor.java
deleted file mode 100644
index 27d88e655b2d4c5ac561fd635c992fbcd662c8ff..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/queue/QueueExecutor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.queue;
-
-import org.skywalking.apm.collector.core.framework.Executor;
-
-/**
- * @author peng-yongsheng
- */
-public interface QueueExecutor extends Executor {
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/remote/Remote.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/remote/Remote.java
deleted file mode 100644
index 9459d184040a736aa1b60698eaa13df5df5cf88c..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/remote/Remote.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.remote;
-
-/**
- * @author peng-yongsheng
- */
-public interface Remote {
- void call(Object message);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/Server.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/Server.java
deleted file mode 100644
index 934e5d001374fa2af4299b2f871d867654558e09..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/Server.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.server;
-
-import org.skywalking.apm.collector.core.framework.Handler;
-
-/**
- * @author peng-yongsheng
- */
-public interface Server {
-
- String hostPort();
-
- String serverClassify();
-
- void initialize() throws ServerException;
-
- void start() throws ServerException;
-
- void addHandler(Handler handler);
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerException.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerException.java
deleted file mode 100644
index 9eedf1fc053189597a4139117e8ed1619ff737c2..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.server;
-
-import org.skywalking.apm.collector.core.CollectorException;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class ServerException extends CollectorException {
-
- public ServerException(String message) {
- super(message);
- }
-
- public ServerException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerHolder.java b/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerHolder.java
deleted file mode 100644
index 2484c6e686f7e80a946be7a4ed67a7baac99405a..0000000000000000000000000000000000000000
--- a/apm-collector-3.2.3/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/server/ServerHolder.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, OpenSkywalking Organization All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project repository: https://github.com/OpenSkywalking/skywalking
- */
-
-package org.skywalking.apm.collector.core.server;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.skywalking.apm.collector.core.framework.Handler;
-import org.skywalking.apm.collector.core.util.CollectionUtils;
-import org.skywalking.apm.collector.core.util.ObjectUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServerHolder {
-
- private final Logger logger = LoggerFactory.getLogger(ServerHolder.class);
-
- private List servers;
-
- public ServerHolder() {
- servers = new LinkedList<>();
- }
-
- public void holdServer(Server newServer, List handlers) throws ServerException {
- if (ObjectUtils.isEmpty(newServer) || CollectionUtils.isEmpty(handlers)) {
- return;
- }
-
- boolean isNewServer = true;
- for (Server server : servers) {
- if (server.hostPort().equals(newServer.hostPort()) && server.serverClassify().equals(newServer.serverClassify())) {
- isNewServer = false;
- addHandler(handlers, server);
- }
- }
- if (isNewServer) {
- newServer.initialize();
- servers.add(newServer);
- addHandler(handlers, newServer);
- }
- }
-
- private void addHandler(List