Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
e7704360
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
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,发现更多精彩内容 >>
提交
e7704360
编写于
12月 18, 2017
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Analysis register module finished.
上级
dcad78c4
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
278 addition
and
55 deletion
+278
-55
apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/GraphIdDefine.java
...llector/analysis/register/define/graph/GraphIdDefine.java
+28
-0
apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/WorkerIdDefine.java
...lector/analysis/register/define/graph/WorkerIdDefine.java
+31
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml
...ctor-analysis/analysis-register/register-provider/pom.xml
+15
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleProvider.java
...sis/register/provider/AnalysisRegisterModuleProvider.java
+10
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterGraph.java
.../register/provider/register/ApplicationRegisterGraph.java
+46
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterRemoteWorker.java
...er/provider/register/ApplicationRegisterRemoteWorker.java
+7
-7
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterSerialWorker.java
...er/provider/register/ApplicationRegisterSerialWorker.java
+10
-12
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java
.../analysis/register/provider/register/IdAutoIncrement.java
+1
-1
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterGraph.java
...sis/register/provider/register/InstanceRegisterGraph.java
+46
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterRemoteWorker.java
...ister/provider/register/InstanceRegisterRemoteWorker.java
+6
-6
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java
...ister/provider/register/InstanceRegisterSerialWorker.java
+7
-8
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterGraph.java
.../register/provider/register/ServiceNameRegisterGraph.java
+46
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterRemoteWorker.java
...er/provider/register/ServiceNameRegisterRemoteWorker.java
+6
-6
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterSerialWorker.java
...er/provider/register/ServiceNameRegisterSerialWorker.java
+9
-11
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ApplicationIDService.java
...lysis/register/provider/service/ApplicationIDService.java
+3
-1
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java
...analysis/register/provider/service/InstanceIDService.java
+3
-1
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ServiceNameService.java
...nalysis/register/provider/service/ServiceNameService.java
+3
-1
apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorkerProvider.java
...lysis/worker/model/base/AbstractRemoteWorkerProvider.java
+1
-1
未找到文件。
apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/GraphIdDefine.java
0 → 100644
浏览文件 @
e7704360
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.define.graph
;
/**
* @author peng-yongsheng
*/
public
class
GraphIdDefine
{
public
static
final
int
APPLICATION_REGISTER_GRAPH_ID
=
200
;
public
static
final
int
INSTANCE_REGISTER_GRAPH_ID
=
201
;
public
static
final
int
SERVICE_NAME_REGISTER_GRAPH_ID
=
202
;
}
apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/WorkerIdDefine.java
0 → 100644
浏览文件 @
e7704360
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.define.graph
;
/**
* @author peng-yongsheng
*/
public
class
WorkerIdDefine
{
public
static
final
int
APPLICATION_REGISTER_REMOTE_WORKER
=
200
;
public
static
final
int
APPLICATION_REGISTER_SERIAL_WORKER
=
201
;
public
static
final
int
INSTANCE_REGISTER_REMOTE_WORKER
=
202
;
public
static
final
int
INSTANCE_REGISTER_SERIAL_WORKER
=
203
;
public
static
final
int
SERVICE_NAME_REGISTER_REMOTE_WORKER
=
204
;
public
static
final
int
SERVICE_NAME_REGISTER_SERIAL_WORKER
=
205
;
}
apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml
浏览文件 @
e7704360
...
...
@@ -36,5 +36,20 @@
<artifactId>
register-define
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
collector-cache-define
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
collector-storage-define
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
analysis-worker-model
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleProvider.java
浏览文件 @
e7704360
...
...
@@ -23,6 +23,9 @@ import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegi
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.register.ApplicationRegisterGraph
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.register.InstanceRegisterGraph
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.register.ServiceNameRegisterGraph
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.service.ApplicationIDService
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.service.InstanceIDService
;
import
org.apache.skywalking.apm.collector.analysis.register.provider.service.ServiceNameService
;
...
...
@@ -52,7 +55,14 @@ public class AnalysisRegisterModuleProvider extends ModuleProvider {
}
@Override
public
void
start
(
Properties
config
)
throws
ServiceNotProvidedException
{
ApplicationRegisterGraph
applicationRegisterGraph
=
new
ApplicationRegisterGraph
(
getManager
());
applicationRegisterGraph
.
create
();
InstanceRegisterGraph
instanceRegisterGraph
=
new
InstanceRegisterGraph
(
getManager
());
instanceRegisterGraph
.
create
();
ServiceNameRegisterGraph
serviceNameRegisterGraph
=
new
ServiceNameRegisterGraph
(
getManager
());
serviceNameRegisterGraph
.
create
();
}
@Override
public
void
notifyAfterCompleted
()
throws
ServiceNotProvidedException
{
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterGraph.java
0 → 100644
浏览文件 @
e7704360
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.RemoteModule
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationRegisterGraph
{
private
final
ModuleManager
moduleManager
;
public
ApplicationRegisterGraph
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
}
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
GraphManager
.
INSTANCE
.
createIfAbsent
(
GraphIdDefine
.
APPLICATION_REGISTER_GRAPH_ID
,
Application
.
class
)
.
addNode
(
new
ApplicationRegisterRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
GraphIdDefine
.
APPLICATION_REGISTER_GRAPH_ID
).
create
(
null
))
.
addNext
(
new
ApplicationRegisterSerialWorker
.
Factory
(
moduleManager
).
create
(
null
));
}
}
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/ApplicationRegisterRemoteWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/ApplicationRegisterRemoteWorker.java
浏览文件 @
e7704360
...
...
@@ -16,16 +16,16 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.remote.service.Selector
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -41,7 +41,7 @@ public class ApplicationRegisterRemoteWorker extends AbstractRemoteWorker<Applic
}
@Override
public
int
id
()
{
return
10006
;
return
WorkerIdDefine
.
APPLICATION_REGISTER_REMOTE_WORKER
;
}
@Override
protected
void
onWork
(
Application
message
)
throws
WorkerException
{
...
...
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/ApplicationRegisterSerialWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/ApplicationRegisterSerialWorker.java
浏览文件 @
e7704360
...
...
@@ -16,21 +16,19 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.agent.stream.IdAutoIncrement
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationRegisterDAO
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker
;
import
org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
;
import
org.apache.skywalking.apm.collector.queue.service.QueueCreatorService
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -51,7 +49,7 @@ public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker<Ap
}
@Override
public
int
id
()
{
return
101
;
return
WorkerIdDefine
.
APPLICATION_REGISTER_SERIAL_WORKER
;
}
@Override
protected
void
onWork
(
Application
application
)
throws
WorkerException
{
...
...
@@ -84,8 +82,8 @@ public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker<Ap
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
Application
,
Application
,
ApplicationRegisterSerialWorker
>
{
public
Factory
(
ModuleManager
moduleManager
,
QueueCreatorService
<
Application
>
queueCreatorService
)
{
super
(
moduleManager
,
queueCreatorService
);
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationRegisterSerialWorker
workerInstance
(
ModuleManager
moduleManager
)
{
...
...
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream
/IdAutoIncrement.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register
/IdAutoIncrement.java
浏览文件 @
e7704360
...
...
@@ -17,7 +17,7 @@
*/
package
org.apache.skywalking.apm.collector.a
gent.stream
;
package
org.apache.skywalking.apm.collector.a
nalysis.register.provider.register
;
/**
* @author peng-yongsheng
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterGraph.java
0 → 100644
浏览文件 @
e7704360
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.RemoteModule
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.storage.table.register.Instance
;
/**
* @author peng-yongsheng
*/
public
class
InstanceRegisterGraph
{
private
final
ModuleManager
moduleManager
;
public
InstanceRegisterGraph
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
}
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
GraphManager
.
INSTANCE
.
createIfAbsent
(
GraphIdDefine
.
INSTANCE_REGISTER_GRAPH_ID
,
Instance
.
class
)
.
addNode
(
new
InstanceRegisterRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
GraphIdDefine
.
INSTANCE_REGISTER_GRAPH_ID
).
create
(
null
))
.
addNext
(
new
InstanceRegisterSerialWorker
.
Factory
(
moduleManager
).
create
(
null
));
}
}
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/InstanceRegisterRemoteWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/InstanceRegisterRemoteWorker.java
浏览文件 @
e7704360
...
...
@@ -16,16 +16,16 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.remote.service.Selector
;
import
org.apache.skywalking.apm.collector.storage.table.register.Instance
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -37,7 +37,7 @@ public class InstanceRegisterRemoteWorker extends AbstractRemoteWorker<Instance,
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
InstanceRegisterRemoteWorker
.
class
);
@Override
public
int
id
()
{
return
10001
;
return
WorkerIdDefine
.
INSTANCE_REGISTER_REMOTE_WORKER
;
}
InstanceRegisterRemoteWorker
(
ModuleManager
moduleManager
)
{
...
...
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/InstanceRegisterSerialWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/InstanceRegisterSerialWorker.java
浏览文件 @
e7704360
...
...
@@ -16,19 +16,18 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.InstanceCacheService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.queue.service.QueueCreatorService
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.dao.IInstanceRegisterDAO
;
import
org.apache.skywalking.apm.collector.storage.table.register.Instance
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -49,7 +48,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
}
@Override
public
int
id
()
{
return
102
;
return
WorkerIdDefine
.
INSTANCE_REGISTER_SERIAL_WORKER
;
}
@Override
protected
void
onWork
(
Instance
instance
)
throws
WorkerException
{
...
...
@@ -83,8 +82,8 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
Instance
,
Instance
,
InstanceRegisterSerialWorker
>
{
public
Factory
(
ModuleManager
moduleManager
,
QueueCreatorService
<
Instance
>
queueCreatorService
)
{
super
(
moduleManager
,
queueCreatorService
);
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
InstanceRegisterSerialWorker
workerInstance
(
ModuleManager
moduleManager
)
{
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterGraph.java
0 → 100644
浏览文件 @
e7704360
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.RemoteModule
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.storage.table.register.ServiceName
;
/**
* @author peng-yongsheng
*/
public
class
ServiceNameRegisterGraph
{
private
final
ModuleManager
moduleManager
;
public
ServiceNameRegisterGraph
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
}
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
GraphManager
.
INSTANCE
.
createIfAbsent
(
GraphIdDefine
.
SERVICE_NAME_REGISTER_GRAPH_ID
,
ServiceName
.
class
)
.
addNode
(
new
ServiceNameRegisterRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
GraphIdDefine
.
SERVICE_NAME_REGISTER_GRAPH_ID
).
create
(
null
))
.
addNext
(
new
ServiceNameRegisterSerialWorker
.
Factory
(
moduleManager
).
create
(
null
));
}
}
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/ServiceNameRegisterRemoteWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/ServiceNameRegisterRemoteWorker.java
浏览文件 @
e7704360
...
...
@@ -16,16 +16,16 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.remote.service.Selector
;
import
org.apache.skywalking.apm.collector.storage.table.register.ServiceName
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -41,7 +41,7 @@ public class ServiceNameRegisterRemoteWorker extends AbstractRemoteWorker<Servic
}
@Override
public
int
id
()
{
return
10000
;
return
WorkerIdDefine
.
SERVICE_NAME_REGISTER_REMOTE_WORKER
;
}
@Override
protected
void
onWork
(
ServiceName
serviceName
)
throws
WorkerException
{
...
...
apm-collector/apm-collector-a
gent-stream/collector-agent-stream-provider/src/main/java/org/apache/skywalking/apm/collector/agent/stream/work
er/register/ServiceNameRegisterSerialWorker.java
→
apm-collector/apm-collector-a
nalysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provid
er/register/ServiceNameRegisterSerialWorker.java
浏览文件 @
e7704360
...
...
@@ -16,21 +16,19 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.register.provider.register
;
package
org.apache.skywalking.apm.collector.agent.stream.worker.register
;
import
org.apache.skywalking.apm.collector.agent.stream.IdAutoIncrement
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.queue.service.QueueCreatorService
;
import
org.apache.skywalking.apm.collector.storage.dao.IServiceNameRegisterDAO
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.dao.IServiceNameRegisterDAO
;
import
org.apache.skywalking.apm.collector.storage.table.register.ServiceName
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -51,7 +49,7 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker<Se
}
@Override
public
int
id
()
{
return
100
;
return
WorkerIdDefine
.
SERVICE_NAME_REGISTER_SERIAL_WORKER
;
}
@Override
protected
void
onWork
(
ServiceName
serviceName
)
throws
WorkerException
{
...
...
@@ -87,8 +85,8 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker<Se
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
ServiceName
,
ServiceName
,
ServiceNameRegisterSerialWorker
>
{
public
Factory
(
ModuleManager
moduleManager
,
QueueCreatorService
<
ServiceName
>
queueCreatorService
)
{
super
(
moduleManager
,
queueCreatorService
);
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ServiceNameRegisterSerialWorker
workerInstance
(
ModuleManager
moduleManager
)
{
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ApplicationIDService.java
浏览文件 @
e7704360
...
...
@@ -18,10 +18,12 @@
package
org.apache.skywalking.apm.collector.analysis.register.provider.service
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
;
import
org.apache.skywalking.apm.collector.core.graph.Graph
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
...
...
@@ -45,7 +47,7 @@ public class ApplicationIDService implements IApplicationIDService {
private
Graph
<
Application
>
getApplicationRegisterGraph
()
{
if
(
ObjectUtils
.
isEmpty
(
applicationRegisterGraph
))
{
// this.applicationRegisterGraph = GraphManager.INSTANCE.createIfAbsent(RegisterStreamGraph
Define.APPLICATION_REGISTER_GRAPH_ID, Application.class);
this
.
applicationRegisterGraph
=
GraphManager
.
INSTANCE
.
findGraph
(
GraphId
Define
.
APPLICATION_REGISTER_GRAPH_ID
,
Application
.
class
);
}
return
this
.
applicationRegisterGraph
;
}
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java
浏览文件 @
e7704360
...
...
@@ -18,10 +18,12 @@
package
org.apache.skywalking.apm.collector.analysis.register.provider.service
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.InstanceCacheService
;
import
org.apache.skywalking.apm.collector.core.graph.Graph
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
...
...
@@ -55,7 +57,7 @@ public class InstanceIDService implements IInstanceIDService {
private
Graph
<
Instance
>
getInstanceRegisterGraph
()
{
if
(
ObjectUtils
.
isEmpty
(
instanceRegisterGraph
))
{
// this.instanceRegisterGraph = GraphManager.INSTANCE.createIfAbsent(RegisterStreamGraph
Define.INSTANCE_REGISTER_GRAPH_ID, Instance.class);
this
.
instanceRegisterGraph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
GraphId
Define
.
INSTANCE_REGISTER_GRAPH_ID
,
Instance
.
class
);
}
return
instanceRegisterGraph
;
}
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ServiceNameService.java
浏览文件 @
e7704360
...
...
@@ -18,10 +18,12 @@
package
org.apache.skywalking.apm.collector.analysis.register.provider.service
;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService
;
import
org.apache.skywalking.apm.collector.core.graph.Graph
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.ObjectUtils
;
import
org.apache.skywalking.apm.collector.storage.table.register.ServiceName
;
...
...
@@ -52,7 +54,7 @@ public class ServiceNameService implements IServiceNameService {
private
Graph
<
ServiceName
>
getServiceNameRegisterGraph
()
{
if
(
ObjectUtils
.
isEmpty
(
serviceNameRegisterGraph
))
{
// this.serviceNameRegisterGraph = GraphManager.INSTANCE.createIfAbsent(RegisterStreamGraph
Define.SERVICE_NAME_REGISTER_GRAPH_ID, ServiceName.class);
this
.
serviceNameRegisterGraph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
GraphId
Define
.
SERVICE_NAME_REGISTER_GRAPH_ID
,
ServiceName
.
class
);
}
return
serviceNameRegisterGraph
;
}
...
...
apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorkerProvider.java
浏览文件 @
e7704360
...
...
@@ -48,7 +48,7 @@ public abstract class AbstractRemoteWorkerProvider<INPUT extends Data, OUTPUT ex
* @return The created worker reference. See {@link RemoteWorkerRef} worker instance, when the worker provider not
* find then Throw this Exception.
*/
@Override
final
public
RemoteWorkerRef
create
(
WorkerCreateListener
workerCreateListener
)
{
@Override
final
public
RemoteWorkerRef
<
INPUT
,
OUTPUT
>
create
(
WorkerCreateListener
workerCreateListener
)
{
WORKER_TYPE
remoteWorker
=
workerInstance
(
getModuleManager
());
workerCreateListener
.
addWorker
(
remoteWorker
);
return
new
RemoteWorkerRef
<>(
remoteWorker
,
remoteSenderService
,
graphId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录