Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
361eee8f
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,发现更多精彩内容 >>
提交
361eee8f
编写于
1月 23, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复Reduce的bug
上级
bf0221d9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
11 deletion
+17
-11
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainDetail.java
...oud/skywalking/analysis/categorize2chain/ChainDetail.java
+7
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainRelate.java
...oud/skywalking/analysis/categorize2chain/ChainRelate.java
+10
-8
未找到文件。
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainDetail.java
浏览文件 @
361eee8f
...
...
@@ -14,16 +14,19 @@ import java.util.HashMap;
import
java.util.Map
;
public
class
ChainDetail
{
private
boolean
isNormal
=
true
;
private
String
chainToken
;
private
Map
<
String
,
ChainNode
>
chainNodeMap
=
new
HashMap
<
String
,
ChainNode
>();
private
String
userId
;
public
ChainDetail
(
ChainInfo
chainInfo
)
{
public
ChainDetail
(
ChainInfo
chainInfo
,
boolean
isNormal
)
{
chainToken
=
chainInfo
.
getCID
();
for
(
ChainNode
chainNode
:
chainInfo
.
getNodes
())
{
chainNodeMap
.
put
(
chainNode
.
getTraceLevelId
(),
chainNode
);
}
userId
=
chainInfo
.
getUserId
();
this
.
isNormal
=
isNormal
;
}
@Override
...
...
@@ -36,8 +39,9 @@ public class ChainDetail {
put
.
addColumn
(
Config
.
HBase
.
TRACE_DETAIL_FAMILY_COLUMN
.
getBytes
(),
entry
.
getKey
().
getBytes
(),
entry
.
getValue
().
toString
().
getBytes
());
}
CallChainInfoDao
.
saveChainDetail
(
this
);
if
(
isNormal
)
{
CallChainInfoDao
.
saveChainDetail
(
this
);
}
}
public
Collection
<
ChainNode
>
getChainNodes
()
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainRelate.java
浏览文件 @
361eee8f
...
...
@@ -4,8 +4,6 @@ import com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainInfo;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.config.Constants
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
org.apache.hadoop.hbase.client.Put
;
import
org.slf4j.Logger
;
...
...
@@ -27,7 +25,7 @@ public class ChainRelate {
this
.
key
=
key
;
}
private
void
categoryUncategorizedChainInfo
(
CategorizedChainInfo
parentChains
)
{
private
void
category
All
UncategorizedChainInfo
(
CategorizedChainInfo
parentChains
)
{
if
(
uncategorizeChainInfoList
!=
null
&&
uncategorizeChainInfoList
.
size
()
>
0
)
{
Iterator
<
UncategorizeChainInfo
>
uncategorizeChainInfoIterator
=
uncategorizeChainInfoList
.
iterator
();
while
(
uncategorizeChainInfoIterator
.
hasNext
())
{
...
...
@@ -40,18 +38,22 @@ public class ChainRelate {
}
}
private
void
classifiedChains
(
UncategorizeChainInfo
child
)
{
private
void
try2CategoryUncategorizedChainInfo
(
UncategorizeChainInfo
child
)
{
boolean
isContained
=
false
;
for
(
Map
.
Entry
<
String
,
CategorizedChainInfo
>
entry
:
categorizedChainInfoMap
.
entrySet
())
{
if
(
entry
.
getValue
().
isAlreadyContained
(
child
))
{
isContained
=
true
;
}
else
if
(
entry
.
getValue
().
isContained
(
child
))
{
entry
.
getValue
().
add
(
child
);
chainDetailMap
.
put
(
child
.
getCID
(),
new
ChainDetail
(
child
.
getChainInfo
(),
false
));
isContained
=
true
;
}
}
if
(!
isContained
)
{
if
(!
uncategorizeChainInfoList
.
contains
(
child
))
{
chainDetailMap
.
put
(
child
.
getCID
(),
new
ChainDetail
(
child
.
getChainInfo
(),
false
));
}
uncategorizeChainInfoList
.
add
(
child
);
}
...
...
@@ -62,7 +64,7 @@ public class ChainRelate {
categorizedChainInfoMap
.
put
(
chainInfo
.
getCID
(),
new
CategorizedChainInfo
(
chainInfo
));
chainDetailMap
.
put
(
chainInfo
.
getCID
(),
new
ChainDetail
(
chainInfo
));
chainDetailMap
.
put
(
chainInfo
.
getCID
(),
new
ChainDetail
(
chainInfo
,
true
));
}
return
categorizedChainInfoMap
.
get
(
chainInfo
.
getCID
());
}
...
...
@@ -70,10 +72,10 @@ public class ChainRelate {
public
void
addRelate
(
ChainInfo
chainInfo
)
{
if
(
chainInfo
.
getChainStatus
()
==
ChainInfo
.
ChainStatus
.
NORMAL
)
{
CategorizedChainInfo
categorizedChainInfo
=
addCategorizedChain
(
chainInfo
);
categoryUncategorizedChainInfo
(
categorizedChainInfo
);
category
All
UncategorizedChainInfo
(
categorizedChainInfo
);
}
else
{
UncategorizeChainInfo
uncategorizeChainInfo
=
new
UncategorizeChainInfo
(
chainInfo
);
classifiedChains
(
uncategorizeChainInfo
);
try2CategoryUncategorizedChainInfo
(
uncategorizeChainInfo
);
}
}
...
...
@@ -86,8 +88,8 @@ public class ChainRelate {
List
<
Put
>
puts
=
new
ArrayList
<
Put
>();
for
(
Map
.
Entry
<
String
,
ChainDetail
>
entry
:
chainDetailMap
.
entrySet
())
{
Put
put1
=
new
Put
(
entry
.
getKey
().
getBytes
());
puts
.
add
(
put1
);
entry
.
getValue
().
save
(
put1
);
puts
.
add
(
put1
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录