Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
0b5e3f1d
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
0b5e3f1d
编写于
1月 07, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Application mapping pyramid aggregate.
上级
7effeccc
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
754 addition
and
159 deletion
+754
-159
apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java
...or/analysis/metric/define/graph/MetricWorkerIdDefine.java
+19
-13
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java
...nalysis/metric/provider/AnalysisMetricModuleProvider.java
+2
-2
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java
...ation/mapping/ApplicationMappingDayPersistenceWorker.java
+68
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java
...plication/mapping/ApplicationMappingDayTransformNode.java
+45
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java
...r/worker/application/mapping/ApplicationMappingGraph.java
+16
-5
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java
...tion/mapping/ApplicationMappingHourPersistenceWorker.java
+9
-9
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourTransformNode.java
...lication/mapping/ApplicationMappingHourTransformNode.java
+45
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteAggregationWorker.java
...on/mapping/ApplicationMappingMinuteAggregationWorker.java
+7
-7
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinutePersistenceWorker.java
...on/mapping/ApplicationMappingMinutePersistenceWorker.java
+67
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthPersistenceWorker.java
...ion/mapping/ApplicationMappingMonthPersistenceWorker.java
+67
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthTransformNode.java
...ication/mapping/ApplicationMappingMonthTransformNode.java
+45
-0
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingRemoteWorker.java
...r/application/mapping/ApplicationMappingRemoteWorker.java
+2
-2
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java
...r/application/mapping/ApplicationMappingSpanListener.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingAggregationWorker.java
...er/instance/mapping/InstanceMappingAggregationWorker.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayPersistenceWorker.java
...instance/mapping/InstanceMappingDayPersistenceWorker.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayTransformNode.java
...ker/instance/mapping/InstanceMappingDayTransformNode.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourPersistenceWorker.java
...nstance/mapping/InstanceMappingHourPersistenceWorker.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourTransformNode.java
...er/instance/mapping/InstanceMappingHourTransformNode.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinutePersistenceWorker.java
...tance/mapping/InstanceMappingMinutePersistenceWorker.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthPersistenceWorker.java
...stance/mapping/InstanceMappingMonthPersistenceWorker.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthTransformNode.java
...r/instance/mapping/InstanceMappingMonthTransformNode.java
+1
-1
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingRemoteWorker.java
.../worker/instance/mapping/InstanceMappingRemoteWorker.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
...pache/skywalking/apm/collector/storage/StorageModule.java
+2
-2
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingDayPersistenceDAO.java
...torage/dao/ampp/IApplicationMappingDayPersistenceDAO.java
+3
-3
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingHourPersistenceDAO.java
...orage/dao/ampp/IApplicationMappingHourPersistenceDAO.java
+28
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMinutePersistenceDAO.java
...age/dao/ampp/IApplicationMappingMinutePersistenceDAO.java
+28
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java
...rage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java
+28
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java
...llector/storage/table/application/ApplicationMapping.java
+20
-5
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimer.java
...ywalking/apm/collector/storage/es/DataTTLKeeperTimer.java
+2
-1
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
...ing/apm/collector/storage/es/StorageModuleEsProvider.java
+3
-3
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsPersistenceDAO.java
...or/storage/es/dao/ApplicationMappingEsPersistenceDAO.java
+0
-90
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
.../dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
+63
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java
...ge/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java
+42
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java
...e/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java
+42
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java
...es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java
+42
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java
.../es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java
+42
-0
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java
...ing/apm/collector/storage/h2/StorageModuleH2Provider.java
+3
-3
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2MinutePersistenceDAO.java
...rage/h2/dao/ApplicationMappingH2MinutePersistenceDAO.java
+4
-4
未找到文件。
apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java
浏览文件 @
0b5e3f1d
...
...
@@ -82,24 +82,30 @@ public class MetricWorkerIdDefine {
public
static
final
int
APPLICATION_MONTH_METRIC_PERSISTENCE_WORKER_ID
=
4607
;
public
static
final
int
APPLICATION_MONTH_METRIC_TRANSFORM_NODE_ID
=
4608
;
public
static
final
int
INSTANCE_MINUTE_MAPPING_AGGREGATION_WORKER_ID
=
4700
;
public
static
final
int
INSTANCE_MINUTE_MAPPING_REMOTE_WORKER_ID
=
4701
;
public
static
final
int
INSTANCE_MINUTE_MAPPING_PERSISTENCE_WORKER_ID
=
4702
;
public
static
final
int
INSTANCE_HOUR_MAPPING_PERSISTENCE_WORKER_ID
=
4703
;
public
static
final
int
INSTANCE_HOUR_MAPPING_TRANSFORM_NODE_ID
=
4704
;
public
static
final
int
INSTANCE_DAY_MAPPING_PERSISTENCE_WORKER_ID
=
4705
;
public
static
final
int
INSTANCE_DAY_MAPPING_TRANSFORM_NODE_ID
=
4706
;
public
static
final
int
INSTANCE_MONTH_MAPPING_PERSISTENCE_WORKER_ID
=
4707
;
public
static
final
int
INSTANCE_MONTH_MAPPING_TRANSFORM_NODE_ID
=
4708
;
public
static
final
int
INSTANCE_MAPPING_MINUTE_AGGREGATION_WORKER_ID
=
4700
;
public
static
final
int
INSTANCE_MAPPING_MINUTE_REMOTE_WORKER_ID
=
4701
;
public
static
final
int
INSTANCE_MAPPING_MINUTE_PERSISTENCE_WORKER_ID
=
4702
;
public
static
final
int
INSTANCE_MAPPING_HOUR_PERSISTENCE_WORKER_ID
=
4703
;
public
static
final
int
INSTANCE_MAPPING_HOUR_TRANSFORM_NODE_ID
=
4704
;
public
static
final
int
INSTANCE_MAPPING_DAY_PERSISTENCE_WORKER_ID
=
4705
;
public
static
final
int
INSTANCE_MAPPING_DAY_TRANSFORM_NODE_ID
=
4706
;
public
static
final
int
INSTANCE_MAPPING_MONTH_PERSISTENCE_WORKER_ID
=
4707
;
public
static
final
int
INSTANCE_MAPPING_MONTH_TRANSFORM_NODE_ID
=
4708
;
public
static
final
int
APPLICATION_MAPPING_MINUTE_AGGREGATION_WORKER_ID
=
4800
;
public
static
final
int
APPLICATION_MAPPING_MINUTE_REMOTE_WORKER_ID
=
4801
;
public
static
final
int
APPLICATION_MAPPING_MINUTE_PERSISTENCE_WORKER_ID
=
4802
;
public
static
final
int
APPLICATION_MAPPING_HOUR_PERSISTENCE_WORKER_ID
=
4803
;
public
static
final
int
APPLICATION_MAPPING_HOUR_TRANSFORM_NODE_ID
=
4804
;
public
static
final
int
APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID
=
4805
;
public
static
final
int
APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID
=
4806
;
public
static
final
int
APPLICATION_MAPPING_MONTH_PERSISTENCE_WORKER_ID
=
4807
;
public
static
final
int
APPLICATION_MAPPING_MONTH_TRANSFORM_NODE_ID
=
4808
;
public
static
final
int
APPLICATION_COMPONENT_AGGREGATION_WORKER_ID
=
418
;
public
static
final
int
APPLICATION_COMPONENT_REMOTE_WORKER_ID
=
419
;
public
static
final
int
APPLICATION_COMPONENT_PERSISTENCE_WORKER_ID
=
420
;
public
static
final
int
APPLICATION_MAPPING_AGGREGATION_WORKER_ID
=
421
;
public
static
final
int
APPLICATION_MAPPING_REMOTE_WORKER_ID
=
422
;
public
static
final
int
APPLICATION_MAPPING_PERSISTENCE_WORKER_ID
=
423
;
public
static
final
int
SERVICE_ENTRY_AGGREGATION_WORKER_ID
=
424
;
public
static
final
int
SERVICE_ENTRY_REMOTE_WORKER_ID
=
425
;
public
static
final
int
SERVICE_ENTRY_PERSISTENCE_WORKER_ID
=
426
;
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java
浏览文件 @
0b5e3f1d
...
...
@@ -22,8 +22,8 @@ import java.util.Properties;
import
org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.ApplicationComponentGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.ApplicationComponentSpanListener
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.ApplicationMappingGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.ApplicationMappingSpanListener
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.
mapping.
ApplicationMappingGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.
mapping.
ApplicationMappingSpanListener
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric.ApplicationMetricGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric.ApplicationReferenceMetricGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.GlobalTraceGraph
;
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingDayPersistenceWorker
extends
PersistenceWorker
<
ApplicationMapping
>
{
ApplicationMappingDayPersistenceWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
return
true
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationMapping
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMappingDayPersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationMapping
,
ApplicationMappingDayPersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMappingDayPersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMappingDayPersistenceWorker
(
moduleManager
);
}
@Override
public
int
queueSize
()
{
return
1024
;
}
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.Next
;
import
org.apache.skywalking.apm.collector.core.graph.NodeProcessor
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingDayTransformNode
implements
NodeProcessor
<
ApplicationMapping
,
ApplicationMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
ApplicationMapping
applicationMapping
,
Next
<
ApplicationMapping
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
minuteToDay
(
applicationMapping
.
getTimeBucket
());
applicationMapping
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
applicationMapping
.
getMetricId
());
applicationMapping
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
applicationMapping
);
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/ApplicationMappingGraph.java
→
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
mapping/
ApplicationMappingGraph.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,11 +16,12 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
;
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
import
org.apache.skywalking.apm.collector.core.graph.Node
;
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
;
...
...
@@ -42,9 +43,19 @@ public class ApplicationMappingGraph {
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
GraphManager
.
INSTANCE
.
createIfAbsent
(
MetricGraphIdDefine
.
APPLICATION_MAPPING_GRAPH_ID
,
ApplicationMapping
.
class
)
.
addNode
(
new
ApplicationMappingAggregationWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
))
.
addNext
(
new
ApplicationMappingRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
MetricGraphIdDefine
.
APPLICATION_MAPPING_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
ApplicationMappingPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
Node
<
ApplicationMapping
,
ApplicationMapping
>
remoteNode
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
MetricGraphIdDefine
.
APPLICATION_MAPPING_GRAPH_ID
,
ApplicationMapping
.
class
)
.
addNode
(
new
ApplicationMappingMinuteAggregationWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
))
.
addNext
(
new
ApplicationMappingRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
MetricGraphIdDefine
.
APPLICATION_MAPPING_GRAPH_ID
).
create
(
workerCreateListener
));
remoteNode
.
addNext
(
new
ApplicationMappingMinutePersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
remoteNode
.
addNext
(
new
ApplicationMappingHourTransformNode
())
.
addNext
(
new
ApplicationMappingHourPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
remoteNode
.
addNext
(
new
ApplicationMappingDayTransformNode
())
.
addNext
(
new
ApplicationMappingDayPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
remoteNode
.
addNext
(
new
ApplicationMappingMonthTransformNode
())
.
addNext
(
new
ApplicationMappingMonthPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
ApplicationMapping
PersistenceWorker.java
→
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
mapping/ApplicationMappingHour
PersistenceWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
;
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker
;
...
...
@@ -24,20 +24,20 @@ import org.apache.skywalking.apm.collector.analysis.worker.model.impl.Persistenc
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
IApplicationMapping
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
ampp.IApplicationMappingHour
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingPersistenceWorker
extends
PersistenceWorker
<
ApplicationMapping
>
{
public
class
ApplicationMapping
Hour
PersistenceWorker
extends
PersistenceWorker
<
ApplicationMapping
>
{
ApplicationMappingPersistenceWorker
(
ModuleManager
moduleManager
)
{
ApplicationMapping
Hour
PersistenceWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_PERSISTENCE_WORKER_ID
;
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_
HOUR_
PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
...
...
@@ -46,17 +46,17 @@ public class ApplicationMappingPersistenceWorker extends PersistenceWorker<Appli
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationMapping
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMappingPersistenceDAO
.
class
);
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMapping
Hour
PersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationMapping
,
ApplicationMappingPersistenceWorker
>
{
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationMapping
,
ApplicationMapping
Hour
PersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMappingPersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMappingPersistenceWorker
(
moduleManager
);
@Override
public
ApplicationMapping
Hour
PersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMapping
Hour
PersistenceWorker
(
moduleManager
);
}
@Override
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourTransformNode.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.Next
;
import
org.apache.skywalking.apm.collector.core.graph.NodeProcessor
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingHourTransformNode
implements
NodeProcessor
<
ApplicationMapping
,
ApplicationMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_HOUR_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
ApplicationMapping
applicationMapping
,
Next
<
ApplicationMapping
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
minuteToHour
(
applicationMapping
.
getTimeBucket
());
applicationMapping
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
applicationMapping
.
getMetricId
());
applicationMapping
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
applicationMapping
);
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
ApplicationMapping
AggregationWorker.java
→
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
mapping/ApplicationMappingMinute
AggregationWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
;
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider
;
...
...
@@ -27,24 +27,24 @@ import org.apache.skywalking.apm.collector.storage.table.application.Application
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingAggregationWorker
extends
AggregationWorker
<
ApplicationMapping
,
ApplicationMapping
>
{
public
class
ApplicationMapping
Minute
AggregationWorker
extends
AggregationWorker
<
ApplicationMapping
,
ApplicationMapping
>
{
ApplicationMappingAggregationWorker
(
ModuleManager
moduleManager
)
{
ApplicationMapping
Minute
AggregationWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_AGGREGATION_WORKER_ID
;
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_
MINUTE_
AGGREGATION_WORKER_ID
;
}
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
ApplicationMapping
,
ApplicationMapping
,
ApplicationMappingAggregationWorker
>
{
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
ApplicationMapping
,
ApplicationMapping
,
ApplicationMapping
Minute
AggregationWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMappingAggregationWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMappingAggregationWorker
(
moduleManager
);
@Override
public
ApplicationMapping
Minute
AggregationWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMapping
Minute
AggregationWorker
(
moduleManager
);
}
@Override
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinutePersistenceWorker.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingMinutePersistenceWorker
extends
PersistenceWorker
<
ApplicationMapping
>
{
ApplicationMappingMinutePersistenceWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_MINUTE_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
return
true
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationMapping
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMappingMinutePersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationMapping
,
ApplicationMappingMinutePersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMappingMinutePersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMappingMinutePersistenceWorker
(
moduleManager
);
}
@Override
public
int
queueSize
()
{
return
1024
;
}
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthPersistenceWorker.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingMonthPersistenceWorker
extends
PersistenceWorker
<
ApplicationMapping
>
{
ApplicationMappingMonthPersistenceWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_MONTH_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
return
true
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationMapping
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMappingMonthPersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationMapping
,
ApplicationMappingMonthPersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMappingMonthPersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMappingMonthPersistenceWorker
(
moduleManager
);
}
@Override
public
int
queueSize
()
{
return
1024
;
}
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthTransformNode.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.metric.provider.worker.application.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.Next
;
import
org.apache.skywalking.apm.collector.core.graph.NodeProcessor
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingMonthTransformNode
implements
NodeProcessor
<
ApplicationMapping
,
ApplicationMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_MONTH_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
ApplicationMapping
applicationMapping
,
Next
<
ApplicationMapping
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
minuteToMonth
(
applicationMapping
.
getTimeBucket
());
applicationMapping
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
applicationMapping
.
getMetricId
());
applicationMapping
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
applicationMapping
);
}
}
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/ApplicationMappingRemoteWorker.java
→
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
mapping/
ApplicationMappingRemoteWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
;
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
.mapping
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
...
...
@@ -37,7 +37,7 @@ public class ApplicationMappingRemoteWorker extends AbstractRemoteWorker<Applica
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_REMOTE_WORKER_ID
;
return
MetricWorkerIdDefine
.
APPLICATION_MAPPING_
MINUTE_
REMOTE_WORKER_ID
;
}
@Override
protected
void
onWork
(
ApplicationMapping
applicationMapping
)
throws
WorkerException
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/ApplicationMappingSpanListener.java
→
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/
mapping/
ApplicationMappingSpanListener.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
;
package
org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application
.mapping
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingAggregationWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -34,7 +34,7 @@ public class InstanceMappingAggregationWorker extends AggregationWorker<Instance
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_M
INUTE_MAPPING
_AGGREGATION_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_M
APPING_MINUTE
_AGGREGATION_WORKER_ID
;
}
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
InstanceMapping
,
InstanceMapping
,
InstanceMappingAggregationWorker
>
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayPersistenceWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -37,7 +37,7 @@ public class InstanceMappingDayPersistenceWorker extends PersistenceWorker<Insta
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_
DAY_MAPPING
_PERSISTENCE_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_
MAPPING_DAY
_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayTransformNode.java
浏览文件 @
0b5e3f1d
...
...
@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappin
public
class
InstanceMappingDayTransformNode
implements
NodeProcessor
<
InstanceMapping
,
InstanceMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_
DAY_MAPPING
_TRANSFORM_NODE_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_
MAPPING_DAY
_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
InstanceMapping
instanceMapping
,
Next
<
InstanceMapping
>
next
)
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourPersistenceWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -37,7 +37,7 @@ public class InstanceMappingHourPersistenceWorker extends PersistenceWorker<Inst
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_
HOUR_MAPPING
_PERSISTENCE_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_
MAPPING_HOUR
_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourTransformNode.java
浏览文件 @
0b5e3f1d
...
...
@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappin
public
class
InstanceMappingHourTransformNode
implements
NodeProcessor
<
InstanceMapping
,
InstanceMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_
HOUR_MAPPING
_TRANSFORM_NODE_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_
MAPPING_HOUR
_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
InstanceMapping
instanceMapping
,
Next
<
InstanceMapping
>
next
)
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinutePersistenceWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -37,7 +37,7 @@ public class InstanceMappingMinutePersistenceWorker extends PersistenceWorker<In
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_M
INUTE_MAPPING
_PERSISTENCE_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_M
APPING_MINUTE
_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthPersistenceWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -37,7 +37,7 @@ public class InstanceMappingMonthPersistenceWorker extends PersistenceWorker<Ins
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_M
ONTH_MAPPING
_PERSISTENCE_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_M
APPING_MONTH
_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthTransformNode.java
浏览文件 @
0b5e3f1d
...
...
@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappin
public
class
InstanceMappingMonthTransformNode
implements
NodeProcessor
<
InstanceMapping
,
InstanceMapping
>
{
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_M
ONTH_MAPPING
_TRANSFORM_NODE_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_M
APPING_MONTH
_TRANSFORM_NODE_ID
;
}
@Override
public
void
process
(
InstanceMapping
instanceMapping
,
Next
<
InstanceMapping
>
next
)
{
...
...
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingRemoteWorker.java
浏览文件 @
0b5e3f1d
...
...
@@ -37,7 +37,7 @@ public class InstanceMappingRemoteWorker extends AbstractRemoteWorker<InstanceMa
}
@Override
public
int
id
()
{
return
MetricWorkerIdDefine
.
INSTANCE_M
INUTE_MAPPING
_REMOTE_WORKER_ID
;
return
MetricWorkerIdDefine
.
INSTANCE_M
APPING_MINUTE
_REMOTE_WORKER_ID
;
}
@Override
protected
void
onWork
(
InstanceMapping
instanceMapping
)
throws
WorkerException
{
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
浏览文件 @
0b5e3f1d
...
...
@@ -27,7 +27,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IApplicationAlarmPersiste
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
IApplicationMapping
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
ampp.IApplicationMappingMinute
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceAlarmListPersistenceDAO
;
...
...
@@ -121,7 +121,7 @@ public class StorageModule extends Module {
classes
.
add
(
IGlobalTracePersistenceDAO
.
class
);
classes
.
add
(
IApplicationComponentPersistenceDAO
.
class
);
classes
.
add
(
IApplicationMappingPersistenceDAO
.
class
);
classes
.
add
(
IApplicationMapping
Minute
PersistenceDAO
.
class
);
classes
.
add
(
IApplicationMinuteMetricPersistenceDAO
.
class
);
classes
.
add
(
IApplicationReferenceMinuteMetricPersistenceDAO
.
class
);
classes
.
add
(
ISegmentCostPersistenceDAO
.
class
);
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/
IApplicationMapping
PersistenceDAO.java
→
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/
ampp/IApplicationMappingDay
PersistenceDAO.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.storage.dao
;
package
org.apache.skywalking.apm.collector.storage.dao
.ampp
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
...
...
@@ -24,5 +24,5 @@ import org.apache.skywalking.apm.collector.storage.table.application.Application
/**
* @author peng-yongsheng
*/
public
interface
IApplicationMapping
PersistenceDAO
<
Insert
,
Update
,
DataImpl
extends
ApplicationMapping
>
extends
IPersistenceDAO
<
Insert
,
Update
,
DataImpl
>
{
}
public
interface
IApplicationMapping
DayPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
extends
ApplicationMapping
>
extends
IPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
>
{
}
\ No newline at end of file
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingHourPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.dao.ampp
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationMappingHourPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
extends
ApplicationMapping
>
extends
IPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
>
{
}
\ No newline at end of file
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMinutePersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.dao.ampp
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationMappingMinutePersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
extends
ApplicationMapping
>
extends
IPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
>
{
}
\ No newline at end of file
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.dao.ampp
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationMappingMonthPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
extends
ApplicationMapping
>
extends
IPersistenceDAO
<
INSERT
,
UPDATE
,
STREAM_DATA
>
{
}
\ No newline at end of file
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java
浏览文件 @
0b5e3f1d
...
...
@@ -16,18 +16,17 @@
*
*/
package
org.apache.skywalking.apm.collector.storage.table.application
;
import
org.apache.skywalking.apm.collector.core.data.Column
;
import
org.apache.skywalking.apm.collector.core.data.
Abstract
Data
;
import
org.apache.skywalking.apm.collector.core.data.
Stream
Data
;
import
org.apache.skywalking.apm.collector.core.data.operator.CoverOperation
;
import
org.apache.skywalking.apm.collector.core.data.operator.NonOperation
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMapping
extends
Abstract
Data
{
public
class
ApplicationMapping
extends
Stream
Data
{
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
ApplicationMappingTable
.
COLUMN_ID
,
new
NonOperation
()),
...
...
@@ -45,8 +44,24 @@ public class ApplicationMapping extends AbstractData {
private
static
final
Column
[]
BOOLEAN_COLUMNS
=
{};
private
static
final
Column
[]
BYTE_COLUMNS
=
{};
public
ApplicationMapping
(
String
id
)
{
super
(
id
,
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
public
ApplicationMapping
()
{
super
(
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
}
@Override
public
String
getId
()
{
return
getDataString
(
0
);
}
@Override
public
void
setId
(
String
id
)
{
setDataString
(
0
,
id
);
}
@Override
public
String
getMetricId
()
{
return
getDataString
(
1
);
}
@Override
public
void
setMetricId
(
String
metricId
)
{
setDataString
(
1
,
metricId
);
}
public
int
getApplicationId
()
{
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimer.java
浏览文件 @
0b5e3f1d
...
...
@@ -26,6 +26,7 @@ import org.apache.skywalking.apm.collector.storage.dao.*;
import
java.util.Calendar
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO
;
...
...
@@ -95,7 +96,7 @@ public class DataTTLKeeperTimer {
IApplicationComponentPersistenceDAO
applicationComponentPersistenceDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IApplicationComponentPersistenceDAO
.
class
);
applicationComponentPersistenceDAO
.
deleteHistory
(
startTimestamp
,
endTimestamp
);
IApplicationMapping
PersistenceDAO
applicationMappingPersistenceDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMapping
PersistenceDAO
.
class
);
IApplicationMapping
MinutePersistenceDAO
applicationMappingPersistenceDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMappingMinute
PersistenceDAO
.
class
);
applicationMappingPersistenceDAO
.
deleteHistory
(
startTimestamp
,
endTimestamp
);
IApplicationReferenceMinuteMetricPersistenceDAO
applicationReferenceMetricPersistenceDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IApplicationReferenceMinuteMetricPersistenceDAO
.
class
);
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
浏览文件 @
0b5e3f1d
...
...
@@ -36,7 +36,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IApplicationAlarmPersiste
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
IApplicationMapping
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
ampp.IApplicationMappingMinute
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceAlarmListPersistenceDAO
;
...
...
@@ -91,7 +91,7 @@ import org.apache.skywalking.apm.collector.storage.es.dao.ApplicationComponentEs
import
org.apache.skywalking.apm.collector.storage.es.dao.ApplicationComponentEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ApplicationEsCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ApplicationEsRegisterDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.
ApplicationMapping
EsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.
ampp.ApplicationMappingMinute
EsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ApplicationMappingEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.amp.ApplicationMinuteMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ApplicationReferenceAlarmEsPersistenceDAO
;
...
...
@@ -234,7 +234,7 @@ public class StorageModuleEsProvider extends ModuleProvider {
this
.
registerServiceImplementation
(
IGlobalTracePersistenceDAO
.
class
,
new
GlobalTraceEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationComponentPersistenceDAO
.
class
,
new
ApplicationComponentEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationMapping
PersistenceDAO
.
class
,
new
ApplicationMapping
EsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationMapping
MinutePersistenceDAO
.
class
,
new
ApplicationMappingMinute
EsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationMinuteMetricPersistenceDAO
.
class
,
new
ApplicationMinuteMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationReferenceMinuteMetricPersistenceDAO
.
class
,
new
ApplicationReferenceMinuteMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ISegmentCostPersistenceDAO
.
class
,
new
SegmentCostEsPersistenceDAO
(
elasticSearchClient
));
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsPersistenceDAO.java
已删除
100644 → 0
浏览文件 @
7effeccc
/*
* 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.storage.es.dao
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.reindex.BulkByScrollResponse
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingEsPersistenceDAO
extends
EsDAO
implements
IApplicationMappingPersistenceDAO
<
IndexRequestBuilder
,
UpdateRequestBuilder
,
ApplicationMapping
>
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApplicationMappingEsPersistenceDAO
.
class
);
public
ApplicationMappingEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
public
ApplicationMapping
get
(
String
id
)
{
GetResponse
getResponse
=
getClient
().
prepareGet
(
ApplicationMappingTable
.
TABLE
,
id
).
get
();
if
(
getResponse
.
isExists
())
{
ApplicationMapping
applicationMapping
=
new
ApplicationMapping
(
id
);
Map
<
String
,
Object
>
source
=
getResponse
.
getSource
();
applicationMapping
.
setApplicationId
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_APPLICATION_ID
)).
intValue
());
applicationMapping
.
setAddressId
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_ADDRESS_ID
)).
intValue
());
applicationMapping
.
setTimeBucket
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
)).
longValue
());
return
applicationMapping
;
}
else
{
return
null
;
}
}
@Override
public
IndexRequestBuilder
prepareBatchInsert
(
ApplicationMapping
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ApplicationMappingTable
.
COLUMN_APPLICATION_ID
,
data
.
getApplicationId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_ADDRESS_ID
,
data
.
getAddressId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareIndex
(
ApplicationMappingTable
.
TABLE
,
data
.
getId
()).
setSource
(
source
);
}
@Override
public
UpdateRequestBuilder
prepareBatchUpdate
(
ApplicationMapping
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ApplicationMappingTable
.
COLUMN_APPLICATION_ID
,
data
.
getApplicationId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_ADDRESS_ID
,
data
.
getAddressId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareUpdate
(
ApplicationMappingTable
.
TABLE
,
data
.
getId
()).
setDoc
(
source
);
}
@Override
public
void
deleteHistory
(
Long
startTimestamp
,
Long
endTimestamp
)
{
long
startTimeBucket
=
TimeBucketUtils
.
INSTANCE
.
getMinuteTimeBucket
(
startTimestamp
);
long
endTimeBucket
=
TimeBucketUtils
.
INSTANCE
.
getMinuteTimeBucket
(
endTimestamp
);
BulkByScrollResponse
response
=
getClient
().
prepareDelete
()
.
filter
(
QueryBuilders
.
rangeQuery
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTimeBucket
).
lte
(
endTimeBucket
))
.
source
(
ApplicationMappingTable
.
TABLE
)
.
get
();
long
deleted
=
response
.
getDeleted
();
logger
.
info
(
"Delete {} rows history from {} index."
,
deleted
,
ApplicationMappingTable
.
TABLE
);
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.es.dao.ampp
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
/**
* @author peng-yongsheng
*/
public
abstract
class
AbstractApplicationMappingEsPersistenceDAO
extends
AbstractPersistenceEsDAO
<
ApplicationMapping
>
{
AbstractApplicationMappingEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
protected
final
String
timeBucketColumnNameForDelete
()
{
return
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
;
}
@Override
protected
final
ApplicationMapping
esDataToStreamData
(
Map
<
String
,
Object
>
source
)
{
ApplicationMapping
applicationMapping
=
new
ApplicationMapping
();
applicationMapping
.
setId
((
String
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_ID
));
applicationMapping
.
setMetricId
((
String
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_METRIC_ID
));
applicationMapping
.
setApplicationId
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_APPLICATION_ID
)).
intValue
());
applicationMapping
.
setAddressId
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_ADDRESS_ID
)).
intValue
());
applicationMapping
.
setTimeBucket
(((
Number
)
source
.
get
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
)).
longValue
());
return
applicationMapping
;
}
@Override
protected
final
Map
<
String
,
Object
>
esStreamDataToEsData
(
ApplicationMapping
streamData
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ApplicationMappingTable
.
COLUMN_ID
,
streamData
.
getId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_METRIC_ID
,
streamData
.
getMetricId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_APPLICATION_ID
,
streamData
.
getApplicationId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_ADDRESS_ID
,
streamData
.
getAddressId
());
source
.
put
(
ApplicationMappingTable
.
COLUMN_TIME_BUCKET
,
streamData
.
getTimeBucket
());
return
source
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.es.dao.ampp
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingDayEsPersistenceDAO
extends
AbstractApplicationMappingEsPersistenceDAO
implements
IApplicationMappingDayPersistenceDAO
<
IndexRequestBuilder
,
UpdateRequestBuilder
,
ApplicationMapping
>
{
public
ApplicationMappingDayEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
protected
String
tableName
()
{
return
ApplicationMappingTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Day
.
getName
();
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.es.dao.ampp
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingHourEsPersistenceDAO
extends
AbstractApplicationMappingEsPersistenceDAO
implements
IApplicationMappingHourPersistenceDAO
<
IndexRequestBuilder
,
UpdateRequestBuilder
,
ApplicationMapping
>
{
public
ApplicationMappingHourEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
protected
String
tableName
()
{
return
ApplicationMappingTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Hour
.
getName
();
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.es.dao.ampp
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingMinuteEsPersistenceDAO
extends
AbstractApplicationMappingEsPersistenceDAO
implements
IApplicationMappingMinutePersistenceDAO
<
IndexRequestBuilder
,
UpdateRequestBuilder
,
ApplicationMapping
>
{
public
ApplicationMappingMinuteEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
protected
String
tableName
()
{
return
ApplicationMappingTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Minute
.
getName
();
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java
0 → 100644
浏览文件 @
0b5e3f1d
/*
* 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.storage.es.dao.ampp
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMappingMonthEsPersistenceDAO
extends
AbstractApplicationMappingEsPersistenceDAO
implements
IApplicationMappingMonthPersistenceDAO
<
IndexRequestBuilder
,
UpdateRequestBuilder
,
ApplicationMapping
>
{
public
ApplicationMappingMonthEsPersistenceDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
@Override
protected
String
tableName
()
{
return
ApplicationMappingTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Month
.
getName
();
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java
浏览文件 @
0b5e3f1d
...
...
@@ -32,7 +32,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IApplicationAlarmPersiste
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
IApplicationMapping
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
ampp.IApplicationMappingMinute
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceAlarmListPersistenceDAO
;
...
...
@@ -87,7 +87,7 @@ import org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationComponentH2
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationComponentH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationH2CacheDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationH2RegisterDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationMappingH2PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationMappingH2
Minute
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationMappingH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationMinuteMetricH2PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationReferenceAlarmH2PersistenceDAO
;
...
...
@@ -212,7 +212,7 @@ public class StorageModuleH2Provider extends ModuleProvider {
this
.
registerServiceImplementation
(
IGlobalTracePersistenceDAO
.
class
,
new
GlobalTraceH2PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationComponentPersistenceDAO
.
class
,
new
ApplicationComponentH2PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationMapping
PersistenceDAO
.
class
,
new
ApplicationMappingH2
PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationMapping
MinutePersistenceDAO
.
class
,
new
ApplicationMappingH2Minute
PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationMinuteMetricPersistenceDAO
.
class
,
new
ApplicationMinuteMetricH2PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationReferenceMinuteMetricPersistenceDAO
.
class
,
new
ApplicationReferenceMinuteMetricH2PersistenceDAO
(
h2Client
));
this
.
registerServiceImplementation
(
ISegmentCostPersistenceDAO
.
class
,
new
SegmentCostH2PersistenceDAO
(
h2Client
));
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2PersistenceDAO.java
→
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2
Minute
PersistenceDAO.java
浏览文件 @
0b5e3f1d
...
...
@@ -27,7 +27,7 @@ import java.util.List;
import
java.util.Map
;
import
org.apache.skywalking.apm.collector.client.h2.H2Client
;
import
org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder
;
import
org.apache.skywalking.apm.collector.storage.dao.
IApplicationMapping
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.
ampp.IApplicationMappingMinute
PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
import
org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping
;
...
...
@@ -39,12 +39,12 @@ import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng, clevertension
*/
public
class
ApplicationMappingH2
PersistenceDAO
extends
H2DAO
implements
IApplicationMapping
PersistenceDAO
<
H2SqlEntity
,
H2SqlEntity
,
ApplicationMapping
>
{
public
class
ApplicationMappingH2
MinutePersistenceDAO
extends
H2DAO
implements
IApplicationMappingMinute
PersistenceDAO
<
H2SqlEntity
,
H2SqlEntity
,
ApplicationMapping
>
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApplicationMappingH2PersistenceDAO
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApplicationMappingH2
Minute
PersistenceDAO
.
class
);
private
static
final
String
GET_SQL
=
"select * from {0} where {1} = ?"
;
public
ApplicationMappingH2PersistenceDAO
(
H2Client
client
)
{
public
ApplicationMappingH2
Minute
PersistenceDAO
(
H2Client
client
)
{
super
(
client
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录