提交 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 { ...@@ -56,7 +56,7 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker {
ServiceNameDataDefine.ServiceName serviceName = (ServiceNameDataDefine.ServiceName)message; ServiceNameDataDefine.ServiceName serviceName = (ServiceNameDataDefine.ServiceName)message;
logger.debug("register service name: {}, application id: {}", serviceName.getServiceName(), serviceName.getApplicationId()); 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()); int serviceId = cacheDao.getServiceId(serviceName.getApplicationId(), serviceName.getServiceName());
IServiceNameDAO dao = (IServiceNameDAO)DAOContainer.INSTANCE.get(IServiceNameDAO.class.getName()); IServiceNameDAO dao = (IServiceNameDAO)DAOContainer.INSTANCE.get(IServiceNameDAO.class.getName());
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
package org.skywalking.apm.collector.agentstream.worker.segment.standardization; 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.ApplicationCache;
import org.skywalking.apm.collector.cache.InstanceCache; 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.Const;
import org.skywalking.apm.collector.core.util.StringUtils; import org.skywalking.apm.collector.core.util.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -34,6 +34,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> { ...@@ -34,6 +34,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class); private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class);
private static ReferenceIdExchanger EXCHANGER; private static ReferenceIdExchanger EXCHANGER;
private ServiceNameService serviceNameService;
public static ReferenceIdExchanger getInstance() { public static ReferenceIdExchanger getInstance() {
if (EXCHANGER == null) { if (EXCHANGER == null) {
...@@ -42,9 +43,13 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> { ...@@ -42,9 +43,13 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
return EXCHANGER; return EXCHANGER;
} }
public ReferenceIdExchanger() {
serviceNameService = new ServiceNameService();
}
@Override public boolean exchange(ReferenceDecorator standardBuilder, int applicationId) { @Override public boolean exchange(ReferenceDecorator standardBuilder, int applicationId) {
if (standardBuilder.getEntryServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getEntryServiceName())) { 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) { if (entryServiceId == 0) {
return false; return false;
} else { } else {
...@@ -55,7 +60,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> { ...@@ -55,7 +60,7 @@ public class ReferenceIdExchanger implements IdExchanger<ReferenceDecorator> {
} }
if (standardBuilder.getParentServiceId() == 0 && StringUtils.isNotEmpty(standardBuilder.getParentServiceName())) { 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) { if (parentServiceId == 0) {
return false; return false;
} else { } else {
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
package org.skywalking.apm.collector.agentstream.worker.segment.standardization; 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.ApplicationCache;
import org.skywalking.apm.collector.cache.ServiceIdCache;
import org.skywalking.apm.collector.core.util.Const; import org.skywalking.apm.collector.core.util.Const;
import org.skywalking.apm.collector.core.util.StringUtils; import org.skywalking.apm.collector.core.util.StringUtils;
...@@ -29,6 +29,7 @@ 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> { public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
private static SpanIdExchanger EXCHANGER; private static SpanIdExchanger EXCHANGER;
private ServiceNameService serviceNameService;
public static SpanIdExchanger getInstance() { public static SpanIdExchanger getInstance() {
if (EXCHANGER == null) { if (EXCHANGER == null) {
...@@ -37,6 +38,10 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> { ...@@ -37,6 +38,10 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
return EXCHANGER; return EXCHANGER;
} }
public SpanIdExchanger() {
serviceNameService = new ServiceNameService();
}
@Override public boolean exchange(SpanDecorator standardBuilder, int applicationId) { @Override public boolean exchange(SpanDecorator standardBuilder, int applicationId) {
if (standardBuilder.getPeerId() == 0 && StringUtils.isNotEmpty(standardBuilder.getPeer())) { if (standardBuilder.getPeerId() == 0 && StringUtils.isNotEmpty(standardBuilder.getPeer())) {
int peerId = ApplicationCache.get(standardBuilder.getPeer()); int peerId = ApplicationCache.get(standardBuilder.getPeer());
...@@ -50,7 +55,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> { ...@@ -50,7 +55,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
} }
if (standardBuilder.getOperationNameId() == 0 && StringUtils.isNotEmpty(standardBuilder.getOperationName())) { 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) { if (operationNameId == 0) {
return false; return false;
} else { } 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.component.NodeComponentRemoteWorker$Factory
org.skywalking.apm.collector.agentstream.worker.node.mapping.NodeMappingRemoteWorker$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.noderef.NodeReferenceRemoteWorker$Factory
......
org.skywalking.apm.collector.cache.dao.ApplicationH2DAO org.skywalking.apm.collector.cache.dao.ApplicationH2CacheDAO
org.skywalking.apm.collector.cache.dao.InstanceH2DAO org.skywalking.apm.collector.cache.dao.InstanceH2CacheDAO
org.skywalking.apm.collector.cache.dao.ServiceNameH2DAO org.skywalking.apm.collector.cache.dao.ServiceNameH2CacheDAO
\ No newline at end of file \ No newline at end of file
cluster: #cluster:
zookeeper: # zookeeper:
hostPort: localhost:2181 # hostPort: localhost:2181
sessionTimeout: 100000 # sessionTimeout: 100000
# redis: agent_server:
# host: localhost jetty:
# port: 6379 host: localhost
queue: port: 10800
disruptor: on context_path: /
data_carrier: off agent_stream:
agentstream:
grpc: grpc:
host: localhost host: localhost
port: 1000 port: 11800
jetty: jetty:
host: localhost host: localhost
port: 2000 port: 12800
context_path: / context_path: /
discovery: config:
grpc: localhost buffer_offset_max_file_size: 10M
port: 1000 buffer_segment_max_file_size: 500M
ui: ui:
jetty: jetty:
host: localhost host: localhost
port: 12800 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.
先完成此消息的编辑!
想要评论请 注册