Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
c90b484f
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
c90b484f
编写于
3月 07, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复bug
上级
e2acf567
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
7 deletion
+9
-7
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/chainbuild/entity/CallChainTree.java
.../skywalking/analysis/chainbuild/entity/CallChainTree.java
+2
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/chainbuild/entity/CallChainTreeNode.java
...walking/analysis/chainbuild/entity/CallChainTreeNode.java
+7
-4
未找到文件。
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/chainbuild/entity/CallChainTree.java
浏览文件 @
c90b484f
...
...
@@ -3,6 +3,7 @@ package com.ai.cloud.skywalking.analysis.chainbuild.entity;
import
com.ai.cloud.skywalking.analysis.chainbuild.po.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.chainbuild.po.ChainNode
;
import
com.ai.cloud.skywalking.analysis.chainbuild.util.HBaseUtil
;
import
com.ai.cloud.skywalking.analysis.chainbuild.util.TokenGenerator
;
import
com.google.gson.Gson
;
import
org.apache.hadoop.hbase.client.Put
;
...
...
@@ -33,14 +34,12 @@ public class CallChainTree {
combineChains
=
new
HashMap
<
String
,
ChainInfo
>();
nodes
=
new
HashMap
<
String
,
CallChainTreeNode
>();
this
.
callEntrance
=
callEntrance
;
this
.
treeId
=
TokenGenerator
.
generateTreeToken
(
callEntrance
);
}
public
static
CallChainTree
load
(
String
callEntrance
)
throws
IOException
{
CallChainTree
chain
=
HBaseUtil
.
loadCallChainTree
(
callEntrance
);
chain
.
hasBeenMergedChainIds
.
addAll
(
HBaseUtil
.
loadHasBeenMergeChainIds
(
callEntrance
));
if
(
chain
==
null
)
{
chain
=
new
CallChainTree
(
callEntrance
);
}
return
chain
;
}
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/chainbuild/entity/CallChainTreeNode.java
浏览文件 @
c90b484f
...
...
@@ -24,13 +24,16 @@ public class CallChainTreeNode {
public
CallChainTreeNode
(
ChainNode
node
)
{
this
.
traceLevelId
=
node
.
getTraceLevelId
();
chainNodeContainer
.
put
(
node
.
getNodeToken
(),
new
ChainNodeSpecificMinSummary
());
chainNodeContainer
=
new
HashMap
<
String
,
ChainNodeSpecificMinSummary
>();
this
.
viewPointId
=
node
.
getViewPoint
();
}
public
CallChainTreeNode
(
String
originData
)
{
JsonObject
jsonObject
=
(
JsonObject
)
new
JsonParser
().
parse
(
originData
);
traceLevelId
=
jsonObject
.
get
(
"traceLevelId"
).
getAsString
();
viewPointId
=
jsonObject
.
get
(
"viewPointId"
).
getAsString
();
// 每次都只load对应的节点统计结果,不全部load出来
chainNodeContainer
=
new
HashMap
<
String
,
ChainNodeSpecificMinSummary
>();
}
public
void
mergeIfNess
(
ChainNode
node
)
{
...
...
@@ -46,11 +49,11 @@ public class CallChainTreeNode {
String
keyOfMinSummaryTable
=
generateKeyOfMinSummaryTable
(
treeId
,
calendar
);
ChainNodeSpecificMinSummary
minSummary
=
chainNodeContainer
.
get
(
keyOfMinSummaryTable
);
if
(
minSummary
==
null
)
{
minSummary
=
HBaseUtil
.
loadSpecificMinSummary
(
keyOfMinSummaryTable
,
node
.
get
NodeToken
());
minSummary
=
HBaseUtil
.
loadSpecificMinSummary
(
keyOfMinSummaryTable
,
node
.
get
TraceLevelId
());
chainNodeContainer
.
put
(
keyOfMinSummaryTable
,
minSummary
);
}
minSummary
.
summary
(
String
.
valueOf
(
calendar
.
get
(
Calendar
.
MINUTE
)
+
1
),
node
);
minSummary
.
summary
(
String
.
valueOf
(
calendar
.
get
(
Calendar
.
MINUTE
)),
node
);
}
private
String
generateKeyOfMinSummaryTable
(
String
treeId
,
Calendar
calendar
)
{
...
...
@@ -68,7 +71,7 @@ public class CallChainTreeNode {
}
public
void
saveSummaryResultToHBase
()
throws
IOException
,
InterruptedException
{
List
<
Put
>
puts
=
new
ArrayList
<
Put
>();
List
<
Put
>
puts
=
new
ArrayList
<
Put
>();
for
(
Map
.
Entry
<
String
,
ChainNodeSpecificMinSummary
>
entry
:
chainNodeContainer
.
entrySet
())
{
Put
put
=
new
Put
(
entry
.
getKey
().
getBytes
());
put
.
addColumn
(
HBaseTableMetaData
.
TABLE_CHAIN_ONE_MINUTE_SUMMARY
.
COLUMN_FAMILY_NAME
.
getBytes
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录