Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
ef284dc6
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ef284dc6
编写于
1月 04, 2018
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the applicationCodeRegister only for single code.
上级
fd08a731
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
11 deletion
+11
-11
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
...c/provider/handler/ApplicationRegisterServiceHandler.java
+4
-4
apm-protocol/apm-network/src/main/proto/ApplicationRegisterService.proto
...m-network/src/main/proto/ApplicationRegisterService.proto
+3
-3
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java
...ng/apm/agent/core/remote/AppAndServiceRegisterClient.java
+4
-4
未找到文件。
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
浏览文件 @
ef284dc6
...
...
@@ -24,7 +24,7 @@ import org.apache.skywalking.apm.collector.analysis.register.define.service.IApp
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.server.grpc.GRPCHandler
;
import
org.apache.skywalking.apm.network.proto.Application
;
import
org.apache.skywalking.apm.network.proto.ApplicationMapping
s
;
import
org.apache.skywalking.apm.network.proto.ApplicationMapping
;
import
org.apache.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.KeyWithIntegerValue
;
import
org.slf4j.Logger
;
...
...
@@ -44,16 +44,16 @@ public class ApplicationRegisterServiceHandler extends ApplicationRegisterServic
}
@Override
public
void
applicationCodeRegister
(
Application
request
,
StreamObserver
<
ApplicationMapping
s
>
responseObserver
)
{
public
void
applicationCodeRegister
(
Application
request
,
StreamObserver
<
ApplicationMapping
>
responseObserver
)
{
logger
.
debug
(
"register application"
);
ApplicationMapping
s
.
Builder
builder
=
ApplicationMappings
.
newBuilder
();
ApplicationMapping
.
Builder
builder
=
ApplicationMapping
.
newBuilder
();
String
applicationCode
=
request
.
getApplicationCode
();
int
applicationId
=
applicationIDService
.
getOrCreateForApplicationCode
(
applicationCode
);
if
(
applicationId
!=
0
)
{
KeyWithIntegerValue
value
=
KeyWithIntegerValue
.
newBuilder
().
setKey
(
applicationCode
).
setValue
(
applicationId
).
build
();
builder
.
addApplications
(
value
);
builder
.
setApplication
(
value
);
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
...
...
apm-protocol/apm-network/src/main/proto/ApplicationRegisterService.proto
浏览文件 @
ef284dc6
...
...
@@ -7,7 +7,7 @@ import "KeyWithIntegerValue.proto";
//register service for ApplicationCode, this service is called when service starts.
service
ApplicationRegisterService
{
rpc
applicationCodeRegister
(
Application
)
returns
(
ApplicationMapping
s
)
{
rpc
applicationCodeRegister
(
Application
)
returns
(
ApplicationMapping
)
{
}
}
...
...
@@ -15,6 +15,6 @@ message Application {
string
applicationCode
=
1
;
}
message
ApplicationMapping
s
{
repeated
KeyWithIntegerValue
applications
=
1
;
message
ApplicationMapping
{
KeyWithIntegerValue
application
=
1
;
}
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java
浏览文件 @
ef284dc6
...
...
@@ -41,7 +41,7 @@ import org.apache.skywalking.apm.network.proto.Application;
import
org.apache.skywalking.apm.network.proto.ApplicationInstance
;
import
org.apache.skywalking.apm.network.proto.ApplicationInstanceHeartbeat
;
import
org.apache.skywalking.apm.network.proto.ApplicationInstanceMapping
;
import
org.apache.skywalking.apm.network.proto.ApplicationMapping
s
;
import
org.apache.skywalking.apm.network.proto.ApplicationMapping
;
import
org.apache.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.NetworkAddressRegisterServiceGrpc
;
...
...
@@ -109,10 +109,10 @@ public class AppAndServiceRegisterClient implements BootService, GRPCChannelList
try
{
if
(
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
==
DictionaryUtil
.
nullValue
())
{
if
(
applicationRegisterServiceBlockingStub
!=
null
)
{
ApplicationMapping
s
applicationMapping
=
applicationRegisterServiceBlockingStub
.
applicationCodeRegister
(
ApplicationMapping
applicationMapping
=
applicationRegisterServiceBlockingStub
.
applicationCodeRegister
(
Application
.
newBuilder
().
setApplicationCode
(
Config
.
Agent
.
APPLICATION_CODE
).
build
());
if
(
applicationMapping
.
getApplicationsCount
()
>
0
)
{
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
=
applicationMapping
.
getApplication
s
(
0
).
getValue
();
if
(
applicationMapping
!=
null
)
{
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
=
applicationMapping
.
getApplication
(
).
getValue
();
shouldTry
=
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录