提交 324521b8 编写于 作者: wu-sheng's avatar wu-sheng

Merge branch 'master' of https://github.com/OpenSkywalking/skywalking into...

Merge branch 'master' of https://github.com/OpenSkywalking/skywalking into feature/collector-modelization
......@@ -56,7 +56,7 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker {
ServiceNameDataDefine.ServiceName serviceName = (ServiceNameDataDefine.ServiceName)message;
logger.debug("register service name: {}, application id: {}", serviceName.getServiceName(), serviceName.getApplicationId());
IServiceNameCacheDAO cacheDao = (IServiceNameCacheDAO)DAOContainer.INSTANCE.get(IServiceNameDAO.class.getName());
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());
......
......@@ -18,9 +18,9 @@
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.cache.ServiceIdCache;
import org.skywalking.apm.collector.core.util.Const;
import org.skywalking.apm.collector.core.util.StringUtils;
import org.slf4j.Logger;
......@@ -34,6 +34,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class);
private static ReferenceIdExchanger EXCHANGER;
private ServiceNameService serviceNameService;
public static ReferenceIdExchanger getInstance() {
if (EXCHANGER == null) {
......@@ -42,9 +43,13 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
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 = ServiceIdCache.get(InstanceCache.get(standardBuilder.getEntryApplicationInstanceId()), standardBuilder.getEntryServiceName());
int entryServiceId = serviceNameService.getOrCreate(InstanceCache.get(standardBuilder.getEntryApplicationInstanceId()), standardBuilder.getEntryServiceName());
if (entryServiceId == 0) {
return false;
} else {
......@@ -55,7 +60,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
}
if (standardBuilder.getParentServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getParentServiceName())) {
int parentServiceId = ServiceIdCache.get(InstanceCache.get(standardBuilder.getParentApplicationInstanceId()), standardBuilder.getParentServiceName());
int parentServiceId = serviceNameService.getOrCreate(InstanceCache.get(standardBuilder.getParentApplicationInstanceId()), standardBuilder.getParentServiceName());
if (parentServiceId == 0) {
return false;
} else {
......
......@@ -18,8 +18,8 @@
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.ServiceIdCache;
import org.skywalking.apm.collector.core.util.Const;
import org.skywalking.apm.collector.core.util.StringUtils;
......@@ -29,6 +29,7 @@ import org.skywalking.apm.collector.core.util.StringUtils;
public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
private static SpanIdExchanger EXCHANGER;
private ServiceNameService serviceNameService;
public static SpanIdExchanger getInstance() {
if (EXCHANGER == null) {
......@@ -37,6 +38,10 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
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());
......@@ -50,7 +55,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
}
if (standardBuilder.getOperationNameId() == 0 && StringUtils.isNotEmpty(standardBuilder.getOperationName())) {
int operationNameId = ServiceIdCache.get(applicationId, standardBuilder.getOperationName());
int operationNameId = serviceNameService.getOrCreate(applicationId, standardBuilder.getOperationName());
if (operationNameId == 0) {
return false;
} else {
......
org.skywalking.apm.collector.agentregister.worker.application.ApplicationRegisterRemoteWorker$Factory
org.skywalking.apm.collector.agentregister.worker.instance.InstanceRegisterRemoteWorker$Factory
org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameRegisterRemoteWorker$Factory
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.cache.dao.ApplicationH2DAO
org.skywalking.apm.collector.cache.dao.InstanceH2DAO
org.skywalking.apm.collector.cache.dao.ServiceNameH2DAO
\ No newline at end of file
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
cluster:
zookeeper:
hostPort: localhost:2181
sessionTimeout: 100000
# redis:
# host: localhost
# port: 6379
queue:
disruptor: on
data_carrier: off
agentstream:
#cluster:
# zookeeper:
# hostPort: localhost:2181
# sessionTimeout: 100000
agent_server:
jetty:
host: localhost
port: 10800
context_path: /
agent_stream:
grpc:
host: localhost
port: 1000
port: 11800
jetty:
host: localhost
port: 2000
port: 12800
context_path: /
discovery:
grpc: localhost
port: 1000
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
\ No newline at end of file
org.skywalking.apm.collector.agentregister.worker.application.ApplicationRegisterRemoteWorker$Factory
org.skywalking.apm.collector.agentregister.worker.instance.InstanceRegisterRemoteWorker$Factory
org.skywalking.apm.collector.agentregister.worker.servicename.ServiceNameRegisterRemoteWorker$Factory
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册