Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gdyjdao
SkyWalking
提交
8d104e4f
S
SkyWalking
项目概览
gdyjdao
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
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,发现更多精彩内容 >>
提交
8d104e4f
编写于
11月 15, 2017
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete the name column in all storage tables.
上级
e5c9e295
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
23 addition
and
215 deletion
+23
-215
apm-collector/apm-collector-agent/collector-agent-stream/src/main/java/org/skywalking/apm/collector/agent/stream/parser/SegmentParse.java
...lking/apm/collector/agent/stream/parser/SegmentParse.java
+4
-0
apm-collector/apm-collector-agent/collector-agent-stream/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/node/NodeComponentSpanListener.java
...t/stream/worker/trace/node/NodeComponentSpanListener.java
+4
-21
apm-collector/apm-collector-queue/collector-queue-disruptor-provider/src/main/java/org/skywalking/apm/collector/queue/disruptor/base/DisruptorEventHandler.java
...collector/queue/disruptor/base/DisruptorEventHandler.java
+0
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeComponent.java
...lking/apm/collector/storage/table/node/NodeComponent.java
+0
-18
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeComponentTable.java
.../apm/collector/storage/table/node/NodeComponentTable.java
+0
-2
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeMapping.java
...walking/apm/collector/storage/table/node/NodeMapping.java
+0
-9
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeMappingTable.java
...ng/apm/collector/storage/table/node/NodeMappingTable.java
+0
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/segment/Segment.java
...ywalking/apm/collector/storage/table/segment/Segment.java
+9
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/serviceref/ServiceReference.java
.../collector/storage/table/serviceref/ServiceReference.java
+0
-27
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/serviceref/ServiceReferenceTable.java
...ector/storage/table/serviceref/ServiceReferenceTable.java
+0
-3
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeComponentEsPersistenceDAO.java
...llector/storage/es/dao/NodeComponentEsPersistenceDAO.java
+0
-6
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeComponentEsUIDAO.java
...ng/apm/collector/storage/es/dao/NodeComponentEsUIDAO.java
+0
-40
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeMappingEsPersistenceDAO.java
...collector/storage/es/dao/NodeMappingEsPersistenceDAO.java
+0
-3
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeMappingEsUIDAO.java
...king/apm/collector/storage/es/dao/NodeMappingEsUIDAO.java
+1
-15
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/ServiceReferenceEsPersistenceDAO.java
...ctor/storage/es/dao/ServiceReferenceEsPersistenceDAO.java
+0
-9
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/NodeComponentEsTableDefine.java
...llector/storage/es/define/NodeComponentEsTableDefine.java
+0
-2
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/NodeMappingEsTableDefine.java
...collector/storage/es/define/NodeMappingEsTableDefine.java
+0
-1
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/ServiceReferenceEsTableDefine.java
...ctor/storage/es/define/ServiceReferenceEsTableDefine.java
+0
-3
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2PersistenceDAO.java
...llector/storage/h2/dao/NodeComponentH2PersistenceDAO.java
+0
-6
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
...ng/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
+0
-14
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2PersistenceDAO.java
...collector/storage/h2/dao/NodeMappingH2PersistenceDAO.java
+0
-3
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
...king/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
+3
-14
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/ServiceReferenceH2PersistenceDAO.java
...ctor/storage/h2/dao/ServiceReferenceH2PersistenceDAO.java
+0
-9
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/NodeComponentH2TableDefine.java
...llector/storage/h2/define/NodeComponentH2TableDefine.java
+0
-2
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/NodeMappingH2TableDefine.java
...collector/storage/h2/define/NodeMappingH2TableDefine.java
+0
-1
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/ServiceReferenceH2TableDefine.java
...ctor/storage/h2/define/ServiceReferenceH2TableDefine.java
+0
-3
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/skywalking/apm/collector/ui/service/ServiceTreeService.java
...ywalking/apm/collector/ui/service/ServiceTreeService.java
+2
-2
未找到文件。
apm-collector/apm-collector-agent/collector-agent-stream/src/main/java/org/skywalking/apm/collector/agent/stream/parser/SegmentParse.java
浏览文件 @
8d104e4f
...
...
@@ -39,6 +39,7 @@ import org.skywalking.apm.collector.agent.stream.worker.trace.serviceref.Service
import
org.skywalking.apm.collector.core.graph.Graph
;
import
org.skywalking.apm.collector.core.graph.GraphManager
;
import
org.skywalking.apm.collector.core.module.ModuleManager
;
import
org.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.skywalking.apm.collector.storage.table.segment.Segment
;
import
org.skywalking.apm.network.proto.SpanType
;
import
org.skywalking.apm.network.proto.TraceSegmentObject
;
...
...
@@ -57,6 +58,7 @@ public class SegmentParse {
private
final
List
<
SpanListener
>
spanListeners
;
private
final
ModuleManager
moduleManager
;
private
String
segmentId
;
private
long
timeBucket
=
0
;
public
SegmentParse
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
...
...
@@ -135,6 +137,7 @@ public class SegmentParse {
if
(
spanDecorator
.
getSpanId
()
==
0
)
{
notifyFirstListener
(
spanDecorator
,
applicationId
,
applicationInstanceId
,
segmentId
);
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
getMinuteTimeBucket
(
spanDecorator
.
getStartTime
());
}
if
(
SpanType
.
Exit
.
equals
(
spanDecorator
.
getSpanType
()))
{
...
...
@@ -154,6 +157,7 @@ public class SegmentParse {
private
void
buildSegment
(
String
id
,
byte
[]
dataBinary
)
{
Segment
segment
=
new
Segment
(
id
);
segment
.
setDataBinary
(
dataBinary
);
segment
.
setTimeBucket
(
timeBucket
);
Graph
<
Segment
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
TraceStreamGraph
.
SEGMENT_GRAPH_ID
,
Segment
.
class
);
graph
.
start
(
segment
);
}
...
...
apm-collector/apm-collector-agent/collector-agent-stream/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/node/NodeComponentSpanListener.java
浏览文件 @
8d104e4f
...
...
@@ -47,18 +47,10 @@ public class NodeComponentSpanListener implements EntrySpanListener, ExitSpanLis
public
void
parseExit
(
SpanDecorator
spanDecorator
,
int
applicationId
,
int
instanceId
,
String
segmentId
)
{
NodeComponent
nodeComponent
=
new
NodeComponent
(
Const
.
EMPTY_STRING
);
nodeComponent
.
setComponentId
(
spanDecorator
.
getComponentId
());
nodeComponent
.
setPeerId
(
spanDecorator
.
getPeerId
());
String
id
;
if
(
spanDecorator
.
getComponentId
()
==
0
)
{
nodeComponent
.
setComponentName
(
spanDecorator
.
getComponent
());
id
=
nodeComponent
.
getComponentName
();
}
else
{
nodeComponent
.
setComponentName
(
Const
.
EMPTY_STRING
);
id
=
String
.
valueOf
(
nodeComponent
.
getComponentId
());
}
String
id
=
String
.
valueOf
(
nodeComponent
.
getComponentId
())
+
Const
.
ID_SPLIT
+
nodeComponent
.
getPeerId
();
nodeComponent
.
setPeerId
(
spanDecorator
.
getPeerId
());
id
=
id
+
Const
.
ID_SPLIT
+
nodeComponent
.
getPeerId
();
nodeComponent
.
setId
(
id
);
nodeComponents
.
add
(
nodeComponent
);
}
...
...
@@ -68,18 +60,9 @@ public class NodeComponentSpanListener implements EntrySpanListener, ExitSpanLis
String
segmentId
)
{
NodeComponent
nodeComponent
=
new
NodeComponent
(
Const
.
EMPTY_STRING
);
nodeComponent
.
setComponentId
(
spanDecorator
.
getComponentId
());
String
id
;
if
(
spanDecorator
.
getComponentId
()
==
0
)
{
nodeComponent
.
setComponentName
(
spanDecorator
.
getComponent
());
id
=
nodeComponent
.
getComponentName
();
}
else
{
id
=
String
.
valueOf
(
nodeComponent
.
getComponentId
());
nodeComponent
.
setComponentName
(
Const
.
EMPTY_STRING
);
}
nodeComponent
.
setPeerId
(
applicationId
);
id
=
id
+
Const
.
ID_SPLIT
+
String
.
valueOf
(
applicationId
);
String
id
=
String
.
valueOf
(
nodeComponent
.
getComponentId
())
+
Const
.
ID_SPLIT
+
String
.
valueOf
(
applicationId
);
nodeComponent
.
setId
(
id
);
nodeComponents
.
add
(
nodeComponent
);
...
...
apm-collector/apm-collector-queue/collector-queue-disruptor-provider/src/main/java/org/skywalking/apm/collector/queue/disruptor/base/DisruptorEventHandler.java
浏览文件 @
8d104e4f
...
...
@@ -21,7 +21,6 @@ package org.skywalking.apm.collector.queue.disruptor.base;
import
com.lmax.disruptor.EventHandler
;
import
com.lmax.disruptor.RingBuffer
;
import
org.skywalking.apm.collector.core.CollectorException
;
import
org.skywalking.apm.collector.core.data.Data
;
import
org.skywalking.apm.collector.core.data.EndOfBatchQueueMessage
;
import
org.skywalking.apm.collector.queue.base.MessageHolder
;
import
org.skywalking.apm.collector.queue.base.QueueEventHandler
;
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeComponent.java
浏览文件 @
8d104e4f
...
...
@@ -30,8 +30,6 @@ public class NodeComponent extends Data {
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
NodeComponentTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
new
CoverOperation
()),
new
Column
(
NodeComponentTable
.
COLUMN_PEER
,
new
CoverOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
...
...
@@ -50,22 +48,6 @@ public class NodeComponent extends Data {
super
(
id
,
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
}
public
String
getComponentName
()
{
return
getDataString
(
1
);
}
public
void
setComponentName
(
String
componentName
)
{
setDataString
(
1
,
componentName
);
}
public
String
getPeer
()
{
return
getDataString
(
1
);
}
public
void
setPeer
(
String
peer
)
{
setDataString
(
2
,
peer
);
}
public
Long
getTimeBucket
()
{
return
getDataLong
(
0
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeComponentTable.java
浏览文件 @
8d104e4f
...
...
@@ -26,7 +26,5 @@ import org.skywalking.apm.collector.core.data.CommonTable;
public
class
NodeComponentTable
extends
CommonTable
{
public
static
final
String
TABLE
=
"node_component"
;
public
static
final
String
COLUMN_COMPONENT_ID
=
"component_id"
;
public
static
final
String
COLUMN_COMPONENT_NAME
=
"component_name"
;
public
static
final
String
COLUMN_PEER
=
"peer"
;
public
static
final
String
COLUMN_PEER_ID
=
"peer_id"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeMapping.java
浏览文件 @
8d104e4f
...
...
@@ -30,7 +30,6 @@ public class NodeMapping extends Data {
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
NodeMappingTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
NodeMappingTable
.
COLUMN_ADDRESS
,
new
CoverOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
...
...
@@ -49,14 +48,6 @@ public class NodeMapping extends Data {
super
(
id
,
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
}
public
String
getAddress
()
{
return
getDataString
(
1
);
}
public
void
setAddress
(
String
address
)
{
setDataString
(
1
,
address
);
}
public
int
getApplicationId
()
{
return
getDataInteger
(
0
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/node/NodeMappingTable.java
浏览文件 @
8d104e4f
...
...
@@ -27,5 +27,4 @@ public class NodeMappingTable extends CommonTable {
public
static
final
String
TABLE
=
"node_mapping"
;
public
static
final
String
COLUMN_APPLICATION_ID
=
"application_id"
;
public
static
final
String
COLUMN_ADDRESS_ID
=
"address_id"
;
public
static
final
String
COLUMN_ADDRESS
=
"address"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/segment/Segment.java
浏览文件 @
8d104e4f
...
...
@@ -33,6 +33,7 @@ public class Segment extends Data {
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
SegmentTable
.
COLUMN_TIME_BUCKET
,
new
NonOperation
()),
};
private
static
final
Column
[]
DOUBLE_COLUMNS
=
{};
private
static
final
Column
[]
INTEGER_COLUMNS
=
{
...
...
@@ -54,4 +55,12 @@ public class Segment extends Data {
public
void
setDataBinary
(
byte
[]
dataBinary
)
{
setDataBytes
(
0
,
dataBinary
);
}
public
long
getTimeBucket
()
{
return
getDataLong
(
0
);
}
public
void
setTimeBucket
(
long
timeBucket
)
{
setDataLong
(
0
,
timeBucket
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/serviceref/ServiceReference.java
浏览文件 @
8d104e4f
...
...
@@ -31,9 +31,6 @@ public class ServiceReference extends Data {
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
ServiceReferenceTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
new
NonOperation
()),
new
Column
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
new
NonOperation
()),
new
Column
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
new
NonOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
...
...
@@ -67,30 +64,6 @@ public class ServiceReference extends Data {
setCostSummary
(
0L
);
}
public
String
getEntryServiceName
()
{
return
getDataString
(
1
);
}
public
void
setEntryServiceName
(
String
entryServiceName
)
{
setDataString
(
1
,
entryServiceName
);
}
public
String
getFrontServiceName
()
{
return
getDataString
(
2
);
}
public
void
setFrontServiceName
(
String
frontServiceName
)
{
setDataString
(
2
,
frontServiceName
);
}
public
String
getBehindServiceName
()
{
return
getDataString
(
3
);
}
public
void
setBehindServiceName
(
String
behindServiceName
)
{
setDataString
(
3
,
behindServiceName
);
}
public
Integer
getEntryServiceId
()
{
return
getDataInteger
(
0
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/serviceref/ServiceReferenceTable.java
浏览文件 @
8d104e4f
...
...
@@ -26,11 +26,8 @@ import org.skywalking.apm.collector.core.data.CommonTable;
public
class
ServiceReferenceTable
extends
CommonTable
{
public
static
final
String
TABLE
=
"service_reference"
;
public
static
final
String
COLUMN_ENTRY_SERVICE_ID
=
"entry_service_id"
;
public
static
final
String
COLUMN_ENTRY_SERVICE_NAME
=
"entry_service_name"
;
public
static
final
String
COLUMN_FRONT_SERVICE_ID
=
"front_service_id"
;
public
static
final
String
COLUMN_FRONT_SERVICE_NAME
=
"front_service_name"
;
public
static
final
String
COLUMN_BEHIND_SERVICE_ID
=
"behind_service_id"
;
public
static
final
String
COLUMN_BEHIND_SERVICE_NAME
=
"behind_service_name"
;
public
static
final
String
COLUMN_S1_LTE
=
"s1_lte"
;
public
static
final
String
COLUMN_S3_LTE
=
"s3_lte"
;
public
static
final
String
COLUMN_S5_LTE
=
"s5_lte"
;
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeComponentEsPersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -44,9 +44,7 @@ public class NodeComponentEsPersistenceDAO extends EsDAO implements INodeCompone
NodeComponent
nodeComponent
=
new
NodeComponent
(
id
);
Map
<
String
,
Object
>
source
=
getResponse
.
getSource
();
nodeComponent
.
setComponentId
(((
Number
)
source
.
get
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
)).
intValue
());
nodeComponent
.
setComponentName
((
String
)
source
.
get
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
));
nodeComponent
.
setPeerId
(((
Number
)
source
.
get
(
NodeComponentTable
.
COLUMN_PEER_ID
)).
intValue
());
nodeComponent
.
setPeer
((
String
)
source
.
get
(
NodeComponentTable
.
COLUMN_PEER
));
nodeComponent
.
setTimeBucket
((
Long
)
source
.
get
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
));
return
nodeComponent
;
}
else
{
...
...
@@ -57,9 +55,7 @@ public class NodeComponentEsPersistenceDAO extends EsDAO implements INodeCompone
@Override
public
IndexRequestBuilder
prepareBatchInsert
(
NodeComponent
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
data
.
getComponentId
());
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
data
.
getComponentName
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER_ID
,
data
.
getPeerId
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER
,
data
.
getPeer
());
source
.
put
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareIndex
(
NodeComponentTable
.
TABLE
,
data
.
getId
()).
setSource
(
source
);
...
...
@@ -68,9 +64,7 @@ public class NodeComponentEsPersistenceDAO extends EsDAO implements INodeCompone
@Override
public
UpdateRequestBuilder
prepareBatchUpdate
(
NodeComponent
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
data
.
getComponentId
());
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
data
.
getComponentName
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER_ID
,
data
.
getPeerId
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER
,
data
.
getPeer
());
source
.
put
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareUpdate
(
NodeComponentTable
.
TABLE
,
data
.
getId
()).
setDoc
(
source
);
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeComponentEsUIDAO.java
浏览文件 @
8d104e4f
...
...
@@ -27,7 +27,6 @@ import org.elasticsearch.index.query.QueryBuilders;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.dao.INodeComponentUIDAO
;
import
org.skywalking.apm.collector.storage.es.base.dao.EsDAO
;
import
org.skywalking.apm.collector.storage.table.node.NodeComponentTable
;
...
...
@@ -50,7 +49,6 @@ public class NodeComponentEsUIDAO extends EsDAO implements INodeComponentUIDAO {
logger
.
debug
(
"node component load, start time: {}, end time: {}"
,
startTime
,
endTime
);
JsonArray
nodeComponentArray
=
new
JsonArray
();
nodeComponentArray
.
addAll
(
aggregationByComponentId
(
startTime
,
endTime
));
nodeComponentArray
.
addAll
(
aggregationByComponentName
(
startTime
,
endTime
));
return
nodeComponentArray
;
}
...
...
@@ -62,7 +60,6 @@ public class NodeComponentEsUIDAO extends EsDAO implements INodeComponentUIDAO {
searchRequestBuilder
.
setSize
(
0
);
searchRequestBuilder
.
addAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
).
field
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_PEER
).
field
(
NodeComponentTable
.
COLUMN_PEER
).
size
(
100
))
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_PEER_ID
).
field
(
NodeComponentTable
.
COLUMN_PEER_ID
).
size
(
100
)));
SearchResponse
searchResponse
=
searchRequestBuilder
.
execute
().
actionGet
();
...
...
@@ -80,31 +77,6 @@ public class NodeComponentEsUIDAO extends EsDAO implements INodeComponentUIDAO {
return
nodeComponentArray
;
}
private
JsonArray
aggregationByComponentName
(
long
startTime
,
long
endTime
)
{
SearchRequestBuilder
searchRequestBuilder
=
getClient
().
prepareSearch
(
NodeComponentTable
.
TABLE
);
searchRequestBuilder
.
setTypes
(
NodeComponentTable
.
TABLE_TYPE
);
searchRequestBuilder
.
setSearchType
(
SearchType
.
DFS_QUERY_THEN_FETCH
);
searchRequestBuilder
.
setQuery
(
QueryBuilders
.
rangeQuery
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
).
gte
(
startTime
).
lte
(
endTime
));
searchRequestBuilder
.
setSize
(
0
);
searchRequestBuilder
.
addAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
).
field
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_PEER
).
field
(
NodeComponentTable
.
COLUMN_PEER
).
size
(
100
))
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeComponentTable
.
COLUMN_PEER_ID
).
field
(
NodeComponentTable
.
COLUMN_PEER_ID
).
size
(
100
)));
SearchResponse
searchResponse
=
searchRequestBuilder
.
execute
().
actionGet
();
Terms
componentNameTerms
=
searchResponse
.
getAggregations
().
get
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
);
JsonArray
nodeComponentArray
=
new
JsonArray
();
for
(
Terms
.
Bucket
componentNameBucket
:
componentNameTerms
.
getBuckets
())
{
String
componentName
=
componentNameBucket
.
getKeyAsString
();
if
(
StringUtils
.
isNotEmpty
(
componentName
))
{
buildComponentArray
(
componentNameBucket
,
componentName
,
nodeComponentArray
);
}
}
return
nodeComponentArray
;
}
private
void
buildComponentArray
(
Terms
.
Bucket
componentBucket
,
String
componentName
,
JsonArray
nodeComponentArray
)
{
Terms
peerIdTerms
=
componentBucket
.
getAggregations
().
get
(
NodeComponentTable
.
COLUMN_PEER_ID
);
for
(
Terms
.
Bucket
peerIdBucket
:
peerIdTerms
.
getBuckets
())
{
...
...
@@ -120,17 +92,5 @@ public class NodeComponentEsUIDAO extends EsDAO implements INodeComponentUIDAO {
nodeComponentArray
.
add
(
nodeComponentObj
);
}
}
Terms
peerTerms
=
componentBucket
.
getAggregations
().
get
(
NodeComponentTable
.
COLUMN_PEER
);
for
(
Terms
.
Bucket
peerBucket
:
peerTerms
.
getBuckets
())
{
String
peer
=
peerBucket
.
getKeyAsString
();
if
(
StringUtils
.
isNotEmpty
(
peer
))
{
JsonObject
nodeComponentObj
=
new
JsonObject
();
nodeComponentObj
.
addProperty
(
"componentName"
,
componentName
);
nodeComponentObj
.
addProperty
(
"peer"
,
peer
);
nodeComponentArray
.
add
(
nodeComponentObj
);
}
}
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeMappingEsPersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -45,7 +45,6 @@ public class NodeMappingEsPersistenceDAO extends EsDAO implements INodeMappingPe
Map
<
String
,
Object
>
source
=
getResponse
.
getSource
();
nodeMapping
.
setApplicationId
(((
Number
)
source
.
get
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
)).
intValue
());
nodeMapping
.
setAddressId
(((
Number
)
source
.
get
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
)).
intValue
());
nodeMapping
.
setAddress
((
String
)
source
.
get
(
NodeMappingTable
.
COLUMN_ADDRESS
));
nodeMapping
.
setTimeBucket
(((
Number
)
source
.
get
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
)).
longValue
());
return
nodeMapping
;
}
else
{
...
...
@@ -57,7 +56,6 @@ public class NodeMappingEsPersistenceDAO extends EsDAO implements INodeMappingPe
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
data
.
getApplicationId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
data
.
getAddressId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS
,
data
.
getAddress
());
source
.
put
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareIndex
(
NodeMappingTable
.
TABLE
,
data
.
getId
()).
setSource
(
source
);
...
...
@@ -67,7 +65,6 @@ public class NodeMappingEsPersistenceDAO extends EsDAO implements INodeMappingPe
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
data
.
getApplicationId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
data
.
getAddressId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS
,
data
.
getAddress
());
source
.
put
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareUpdate
(
NodeMappingTable
.
TABLE
,
data
.
getId
()).
setDoc
(
source
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/NodeMappingEsUIDAO.java
浏览文件 @
8d104e4f
...
...
@@ -27,7 +27,6 @@ import org.elasticsearch.index.query.QueryBuilders;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.dao.INodeMappingUIDAO
;
import
org.skywalking.apm.collector.storage.es.base.dao.EsDAO
;
import
org.skywalking.apm.collector.storage.table.node.NodeMappingTable
;
...
...
@@ -54,8 +53,7 @@ public class NodeMappingEsUIDAO extends EsDAO implements INodeMappingUIDAO {
searchRequestBuilder
.
addAggregation
(
AggregationBuilders
.
terms
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
).
field
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
).
field
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
).
size
(
100
))
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeMappingTable
.
COLUMN_ADDRESS
).
field
(
NodeMappingTable
.
COLUMN_ADDRESS
).
size
(
100
)));
.
subAggregation
(
AggregationBuilders
.
terms
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
).
field
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
).
size
(
100
)));
SearchResponse
searchResponse
=
searchRequestBuilder
.
execute
().
actionGet
();
Terms
applicationIdTerms
=
searchResponse
.
getAggregations
().
get
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
);
...
...
@@ -78,18 +76,6 @@ public class NodeMappingEsUIDAO extends EsDAO implements INodeMappingUIDAO {
nodeMappingArray
.
add
(
nodeMappingObj
);
}
}
Terms
addressTerms
=
applicationIdBucket
.
getAggregations
().
get
(
NodeMappingTable
.
COLUMN_ADDRESS
);
for
(
Terms
.
Bucket
addressBucket
:
addressTerms
.
getBuckets
())
{
String
address
=
addressBucket
.
getKeyAsString
();
if
(
StringUtils
.
isNotEmpty
(
address
))
{
JsonObject
nodeMappingObj
=
new
JsonObject
();
// nodeMappingObj.addProperty("applicationCode", applicationCode);
nodeMappingObj
.
addProperty
(
"address"
,
address
);
nodeMappingArray
.
add
(
nodeMappingObj
);
}
}
}
logger
.
debug
(
"node mapping data: {}"
,
nodeMappingArray
.
toString
());
return
nodeMappingArray
;
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/ServiceReferenceEsPersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -48,11 +48,8 @@ public class ServiceReferenceEsPersistenceDAO extends EsDAO implements IServiceR
ServiceReference
serviceReference
=
new
ServiceReference
(
id
);
Map
<
String
,
Object
>
source
=
getResponse
.
getSource
();
serviceReference
.
setEntryServiceId
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
)).
intValue
());
serviceReference
.
setEntryServiceName
((
String
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
));
serviceReference
.
setFrontServiceId
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
)).
intValue
());
serviceReference
.
setFrontServiceName
((
String
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
));
serviceReference
.
setBehindServiceId
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
)).
intValue
());
serviceReference
.
setBehindServiceName
((
String
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
));
serviceReference
.
setS1Lte
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_S1_LTE
)).
longValue
());
serviceReference
.
setS3Lte
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_S3_LTE
)).
longValue
());
serviceReference
.
setS5Lte
(((
Number
)
source
.
get
(
ServiceReferenceTable
.
COLUMN_S5_LTE
)).
longValue
());
...
...
@@ -70,11 +67,8 @@ public class ServiceReferenceEsPersistenceDAO extends EsDAO implements IServiceR
@Override
public
IndexRequestBuilder
prepareBatchInsert
(
ServiceReference
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
data
.
getEntryServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
data
.
getEntryServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
data
.
getFrontServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
data
.
getFrontServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
data
.
getBehindServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
data
.
getBehindServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
data
.
getS1Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
data
.
getS3Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
data
.
getS5Lte
());
...
...
@@ -90,11 +84,8 @@ public class ServiceReferenceEsPersistenceDAO extends EsDAO implements IServiceR
@Override
public
UpdateRequestBuilder
prepareBatchUpdate
(
ServiceReference
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
data
.
getEntryServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
data
.
getEntryServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
data
.
getFrontServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
data
.
getFrontServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
data
.
getBehindServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
data
.
getBehindServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
data
.
getS1Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
data
.
getS3Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
data
.
getS5Lte
());
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/NodeComponentEsTableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -37,9 +37,7 @@ public class NodeComponentEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeComponentTable
.
COLUMN_PEER_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeComponentTable
.
COLUMN_PEER
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/NodeMappingEsTableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -38,7 +38,6 @@ public class NodeMappingEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeMappingTable
.
COLUMN_ADDRESS
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/ServiceReferenceEsTableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -38,11 +38,8 @@ public class ServiceReferenceEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_AGG
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2PersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -55,9 +55,7 @@ public class NodeComponentH2PersistenceDAO extends H2DAO implements INodeCompone
if
(
rs
.
next
())
{
NodeComponent
nodeComponent
=
new
NodeComponent
(
id
);
nodeComponent
.
setComponentId
(
rs
.
getInt
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
));
nodeComponent
.
setComponentName
(
rs
.
getString
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
));
nodeComponent
.
setPeerId
(
rs
.
getInt
(
NodeComponentTable
.
COLUMN_PEER_ID
));
nodeComponent
.
setPeer
(
rs
.
getString
(
NodeComponentTable
.
COLUMN_PEER
));
nodeComponent
.
setTimeBucket
(
rs
.
getLong
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
));
return
nodeComponent
;
}
...
...
@@ -73,9 +71,7 @@ public class NodeComponentH2PersistenceDAO extends H2DAO implements INodeCompone
H2SqlEntity
entity
=
new
H2SqlEntity
();
source
.
put
(
NodeComponentTable
.
COLUMN_ID
,
data
.
getId
());
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
data
.
getComponentId
());
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
data
.
getComponentName
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER_ID
,
data
.
getPeerId
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER
,
data
.
getPeer
());
source
.
put
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchInsertSql
(
NodeComponentTable
.
TABLE
,
source
.
keySet
());
...
...
@@ -89,9 +85,7 @@ public class NodeComponentH2PersistenceDAO extends H2DAO implements INodeCompone
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
H2SqlEntity
entity
=
new
H2SqlEntity
();
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
data
.
getComponentId
());
source
.
put
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
data
.
getComponentName
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER_ID
,
data
.
getPeerId
());
source
.
put
(
NodeComponentTable
.
COLUMN_PEER
,
data
.
getPeer
());
source
.
put
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchUpdateSql
(
NodeComponentTable
.
TABLE
,
source
.
keySet
(),
NodeComponentTable
.
COLUMN_ID
);
entity
.
setSql
(
sql
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
浏览文件 @
8d104e4f
...
...
@@ -19,12 +19,10 @@
package
org.skywalking.apm.collector.storage.h2.dao
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonObject
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
import
org.skywalking.apm.collector.client.h2.H2ClientException
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.base.sql.SqlBuilder
;
import
org.skywalking.apm.collector.storage.dao.INodeComponentUIDAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
...
...
@@ -56,7 +54,6 @@ public class NodeComponentH2UIDAO extends H2DAO implements INodeComponentUIDAO {
JsonArray
nodeComponentArray
=
new
JsonArray
();
String
sql
=
SqlBuilder
.
buildSql
(
AGGREGATE_COMPONENT_SQL
,
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
NodeComponentTable
.
COLUMN_PEER
,
NodeComponentTable
.
COLUMN_PEER_ID
,
NodeComponentTable
.
TABLE
,
NodeComponentTable
.
COLUMN_TIME_BUCKET
);
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
...
...
@@ -69,21 +66,10 @@ public class NodeComponentH2UIDAO extends H2DAO implements INodeComponentUIDAO {
// String peer = ApplicationCache.get(peerId);
// nodeComponentArray.add(buildNodeComponent(peer, componentName));
}
String
peer
=
rs
.
getString
(
NodeComponentTable
.
COLUMN_PEER
);
if
(
StringUtils
.
isNotEmpty
(
peer
))
{
nodeComponentArray
.
add
(
buildNodeComponent
(
peer
,
componentName
));
}
}
}
catch
(
SQLException
|
H2ClientException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
return
nodeComponentArray
;
}
private
JsonObject
buildNodeComponent
(
String
peer
,
String
componentName
)
{
JsonObject
nodeComponentObj
=
new
JsonObject
();
nodeComponentObj
.
addProperty
(
"componentName"
,
componentName
);
nodeComponentObj
.
addProperty
(
"peer"
,
peer
);
return
nodeComponentObj
;
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2PersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -56,7 +56,6 @@ public class NodeMappingH2PersistenceDAO extends H2DAO implements INodeMappingPe
NodeMapping
nodeMapping
=
new
NodeMapping
(
id
);
nodeMapping
.
setApplicationId
(
rs
.
getInt
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
));
nodeMapping
.
setAddressId
(
rs
.
getInt
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
));
nodeMapping
.
setAddress
(
rs
.
getString
(
NodeMappingTable
.
COLUMN_ADDRESS
));
nodeMapping
.
setTimeBucket
(
rs
.
getLong
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
));
return
nodeMapping
;
}
...
...
@@ -72,7 +71,6 @@ public class NodeMappingH2PersistenceDAO extends H2DAO implements INodeMappingPe
source
.
put
(
NodeMappingTable
.
COLUMN_ID
,
nodeMapping
.
getId
());
source
.
put
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
nodeMapping
.
getApplicationId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
nodeMapping
.
getAddressId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS
,
nodeMapping
.
getAddress
());
source
.
put
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
nodeMapping
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchInsertSql
(
NodeMappingTable
.
TABLE
,
source
.
keySet
());
entity
.
setSql
(
sql
);
...
...
@@ -86,7 +84,6 @@ public class NodeMappingH2PersistenceDAO extends H2DAO implements INodeMappingPe
H2SqlEntity
entity
=
new
H2SqlEntity
();
source
.
put
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
nodeMapping
.
getApplicationId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
nodeMapping
.
getAddressId
());
source
.
put
(
NodeMappingTable
.
COLUMN_ADDRESS
,
nodeMapping
.
getAddress
());
source
.
put
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
nodeMapping
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchUpdateSql
(
NodeMappingTable
.
TABLE
,
source
.
keySet
(),
NodeMappingTable
.
COLUMN_ID
);
entity
.
setSql
(
sql
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
浏览文件 @
8d104e4f
...
...
@@ -24,7 +24,6 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
import
org.skywalking.apm.collector.client.h2.H2ClientException
;
import
org.skywalking.apm.collector.core.util.StringUtils
;
import
org.skywalking.apm.collector.storage.base.sql.SqlBuilder
;
import
org.skywalking.apm.collector.storage.dao.INodeMappingUIDAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
...
...
@@ -48,8 +47,7 @@ public class NodeMappingH2UIDAO extends H2DAO implements INodeMappingUIDAO {
H2Client
client
=
getClient
();
JsonArray
nodeMappingArray
=
new
JsonArray
();
String
sql
=
SqlBuilder
.
buildSql
(
NODE_MAPPING_SQL
,
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
NodeMappingTable
.
COLUMN_ADDRESS
,
NodeMappingTable
.
TABLE
,
NodeMappingTable
.
COLUMN_TIME_BUCKET
);
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
NodeMappingTable
.
TABLE
,
NodeMappingTable
.
COLUMN_TIME_BUCKET
);
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
...
...
@@ -58,21 +56,12 @@ public class NodeMappingH2UIDAO extends H2DAO implements INodeMappingUIDAO {
//TODO ApplicationCache
// String applicationCode = ApplicationCache.get(applicationId);
int
addressId
=
rs
.
getInt
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
);
if
(
addressId
!=
0
)
{
// String address = ApplicationCache.get(addressId);
JsonObject
nodeMappingObj
=
new
JsonObject
();
// nodeMappingObj.addProperty("applicationCode", applicationCode);
// nodeMappingObj.addProperty("address", address);
nodeMappingArray
.
add
(
nodeMappingObj
);
}
String
address
=
rs
.
getString
(
NodeMappingTable
.
COLUMN_ADDRESS
);
if
(
StringUtils
.
isNotEmpty
(
address
))
{
JsonObject
nodeMappingObj
=
new
JsonObject
();
// nodeMappingObj.addProperty("applicationCode", applicationCode);
nodeMappingObj
.
addProperty
(
"address"
,
address
);
nodeMappingArray
.
add
(
nodeMappingObj
);
}
}
}
catch
(
SQLException
|
H2ClientException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/ServiceReferenceH2PersistenceDAO.java
浏览文件 @
8d104e4f
...
...
@@ -56,11 +56,8 @@ public class ServiceReferenceH2PersistenceDAO extends H2DAO implements IServiceR
if
(
rs
.
next
())
{
ServiceReference
serviceReference
=
new
ServiceReference
(
id
);
serviceReference
.
setEntryServiceId
(
rs
.
getInt
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
));
serviceReference
.
setEntryServiceName
(
rs
.
getString
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
));
serviceReference
.
setFrontServiceId
(
rs
.
getInt
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
));
serviceReference
.
setFrontServiceName
(
rs
.
getString
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
));
serviceReference
.
setBehindServiceId
(
rs
.
getInt
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
));
serviceReference
.
setBehindServiceName
(
rs
.
getString
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
));
serviceReference
.
setS1Lte
(
rs
.
getLong
(
ServiceReferenceTable
.
COLUMN_S1_LTE
));
serviceReference
.
setS3Lte
(
rs
.
getLong
(
ServiceReferenceTable
.
COLUMN_S3_LTE
));
serviceReference
.
setS5Lte
(
rs
.
getLong
(
ServiceReferenceTable
.
COLUMN_S5_LTE
));
...
...
@@ -83,11 +80,8 @@ public class ServiceReferenceH2PersistenceDAO extends H2DAO implements IServiceR
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceReferenceTable
.
COLUMN_ID
,
data
.
getId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
data
.
getEntryServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
data
.
getEntryServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
data
.
getFrontServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
data
.
getFrontServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
data
.
getBehindServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
data
.
getBehindServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
data
.
getS1Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
data
.
getS3Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
data
.
getS5Lte
());
...
...
@@ -108,11 +102,8 @@ public class ServiceReferenceH2PersistenceDAO extends H2DAO implements IServiceR
H2SqlEntity
entity
=
new
H2SqlEntity
();
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
data
.
getEntryServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
data
.
getEntryServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
data
.
getFrontServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
data
.
getFrontServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
data
.
getBehindServiceId
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
data
.
getBehindServiceName
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
data
.
getS1Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
data
.
getS3Lte
());
source
.
put
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
data
.
getS5Lte
());
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/NodeComponentH2TableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -34,9 +34,7 @@ public class NodeComponentH2TableDefine extends H2TableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_COMPONENT_NAME
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_PEER_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_PEER
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeComponentTable
.
COLUMN_TIME_BUCKET
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/NodeMappingH2TableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -35,7 +35,6 @@ public class NodeMappingH2TableDefine extends H2TableDefine {
addColumn
(
new
H2ColumnDefine
(
NodeMappingTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeMappingTable
.
COLUMN_ADDRESS
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
NodeMappingTable
.
COLUMN_TIME_BUCKET
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/ServiceReferenceH2TableDefine.java
浏览文件 @
8d104e4f
...
...
@@ -34,11 +34,8 @@ public class ServiceReferenceH2TableDefine extends H2TableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_ENTRY_SERVICE_NAME
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_S1_LTE
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_S3_LTE
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceReferenceTable
.
COLUMN_S5_LTE
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/skywalking/apm/collector/ui/service/ServiceTreeService.java
浏览文件 @
8d104e4f
...
...
@@ -74,8 +74,8 @@ public class ServiceTreeService {
int
behindServiceId
=
serviceReference
.
get
(
ColumnNameUtils
.
INSTANCE
.
rename
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
)).
getAsInt
();
String
frontServiceName
=
serviceNameCacheService
.
getSplitServiceName
(
serviceNameCacheService
.
get
(
frontServiceId
));
String
behindServiceName
=
serviceNameCacheService
.
getSplitServiceName
(
serviceNameCacheService
.
get
(
behindServiceId
));
serviceReference
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_NAME
)
,
frontServiceName
);
serviceReference
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_NAME
)
,
behindServiceName
);
serviceReference
.
addProperty
(
"frontServiceName"
,
frontServiceName
);
serviceReference
.
addProperty
(
"behindServiceName"
,
behindServiceName
);
});
return
buildTreeData
(
serviceReferenceMap
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录