Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
3af21631
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,发现更多精彩内容 >>
提交
3af21631
编写于
1月 22, 2016
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.修改大量类名、方法类、包名。为后续二次分析任务准备。
上级
2ef6ef46
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
129 addition
and
102 deletion
+129
-102
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
...om/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
+11
-9
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainMapper.java
...ing/analysis/categorize2chain/Categorize2ChainMapper.java
+10
-10
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainReduce.java
...ing/analysis/categorize2chain/Categorize2ChainReduce.java
+8
-13
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/CategorizedChainInfo.java
...lking/analysis/categorize2chain/CategorizedChainInfo.java
+3
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainDetail.java
...oud/skywalking/analysis/categorize2chain/ChainDetail.java
+5
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainNodeSpecificTimeWindowSummary.java
.../categorize2chain/ChainNodeSpecificTimeWindowSummary.java
+7
-7
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainNodeSpecificTimeWindowSummaryValue.java
...gorize2chain/ChainNodeSpecificTimeWindowSummaryValue.java
+4
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainRelate.java
...oud/skywalking/analysis/categorize2chain/ChainRelate.java
+3
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainSpecificTimeWindowSummary.java
...ysis/categorize2chain/ChainSpecificTimeWindowSummary.java
+6
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/CostMap.java
...i/cloud/skywalking/analysis/categorize2chain/CostMap.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/SpanEntry.java
...cloud/skywalking/analysis/categorize2chain/SpanEntry.java
+2
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Summary.java
...i/cloud/skywalking/analysis/categorize2chain/Summary.java
+5
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/UncategorizeChainInfo.java
...king/analysis/categorize2chain/UncategorizeChainInfo.java
+3
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/dao/CallChainInfoDao.java
...lking/analysis/categorize2chain/dao/CallChainInfoDao.java
+4
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/SpanNodeProcessChain.java
...nalysis/categorize2chain/filter/SpanNodeProcessChain.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/SpanNodeProcessFilter.java
...alysis/categorize2chain/filter/SpanNodeProcessFilter.java
+4
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/AppendBusinessKeyFilter.java
...categorize2chain/filter/impl/AppendBusinessKeyFilter.java
+16
-0
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/CopyAttrFilter.java
...analysis/categorize2chain/filter/impl/CopyAttrFilter.java
+5
-5
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ProcessCostTimeFilter.java
...s/categorize2chain/filter/impl/ProcessCostTimeFilter.java
+5
-5
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ReplaceAddressFilter.java
...is/categorize2chain/filter/impl/ReplaceAddressFilter.java
+5
-5
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/TokenGenerateFilter.java
...sis/categorize2chain/filter/impl/TokenGenerateFilter.java
+5
-5
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/model/ChainInfo.java
...skywalking/analysis/categorize2chain/model/ChainInfo.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/model/ChainNode.java
...skywalking/analysis/categorize2chain/model/ChainNode.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/config/Config.java
.../java/com/ai/cloud/skywalking/analysis/config/Config.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/config/Constants.java
...va/com/ai/cloud/skywalking/analysis/config/Constants.java
+0
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/util/HBaseUtil.java
...java/com/ai/cloud/skywalking/analysis/util/HBaseUtil.java
+7
-2
skywalking-analysis/src/test/java/com/ai/cloud/skywalking/analysis/mapper/CallChainMapperTest.java
...cloud/skywalking/analysis/mapper/CallChainMapperTest.java
+6
-4
未找到文件。
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.mapper.CallChainMapper
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.conf.Configured
;
import
org.apache.hadoop.hbase.client.Scan
;
...
...
@@ -14,10 +16,10 @@ import org.apache.hadoop.util.ToolRunner;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.Categorize2ChainMapper
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.Categorize2ChainReduce
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
public
class
AnalysisServerDriver
extends
Configured
implements
Tool
{
...
...
@@ -41,10 +43,10 @@ public class AnalysisServerDriver extends Configured implements Tool {
job
.
setJarByClass
(
AnalysisServerDriver
.
class
);
Scan
scan
=
buildHBaseScan
(
args
);
TableMapReduceUtil
.
initTableMapperJob
(
Config
.
HBase
.
CALL_CHAIN_TABLE_NAME
,
scan
,
Ca
ll
ChainMapper
.
class
,
TableMapReduceUtil
.
initTableMapperJob
(
Config
.
HBase
.
CALL_CHAIN_TABLE_NAME
,
scan
,
Ca
tegorize2
ChainMapper
.
class
,
String
.
class
,
ChainInfo
.
class
,
job
);
//TableMapReduceUtil.initTableReducerJob("sw-call-chain-model", CallChainReducer
.class, job);
TableMapReduceUtil
.
initTableReducerJob
(
Config
.
HBase
.
CALL_CHAIN_TABLE_NAME
,
Categorize2ChainReduce
.
class
,
job
);
return
job
.
waitForCompletion
(
true
)
?
0
:
1
;
}
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
mapper/Call
ChainMapper.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/Categorize2
ChainMapper.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
mapper
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.filter.SpanNodeProcessChain
;
import
com.ai.cloud.skywalking.analysis.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.SpanNodeProcessChain
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
com.ai.cloud.skywalking.protocol.Span
;
import
org.apache.hadoop.hbase.Cell
;
import
org.apache.hadoop.hbase.client.Result
;
import
org.apache.hadoop.hbase.io.ImmutableBytesWritable
;
...
...
@@ -18,8 +19,8 @@ import org.slf4j.LoggerFactory;
import
java.io.IOException
;
import
java.util.*
;
public
class
Ca
ll
ChainMapper
extends
TableMapper
<
Text
,
ChainInfo
>
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
Ca
ll
ChainMapper
.
class
.
getName
());
public
class
Ca
tegorize2
ChainMapper
extends
TableMapper
<
Text
,
ChainInfo
>
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
Ca
tegorize2
ChainMapper
.
class
.
getName
());
@Override
protected
void
map
(
ImmutableBytesWritable
key
,
Result
value
,
Context
context
)
throws
IOException
,
...
...
@@ -33,12 +34,11 @@ public class CallChainMapper extends TableMapper<Text, ChainInfo> {
}
chainInfo
=
spanToChainInfo
(
key
.
toString
(),
spanList
);
context
.
write
(
new
Text
(
chainInfo
.
getUserId
()
+
":"
+
chainInfo
.
getEntranceNodeToken
()),
chainInfo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"Failed to mapper call chain["
+
key
.
toString
()
+
"]"
,
e
);
chainInfo
=
new
ChainInfo
(
"-1"
);
}
context
.
write
(
new
Text
(
chainInfo
.
getUserId
()
+
":"
+
chainInfo
.
getEntranceNodeToken
()),
chainInfo
);
}
public
static
ChainInfo
spanToChainInfo
(
String
key
,
List
<
Span
>
spanList
)
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce/ChainInfo
Reduce.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/Categorize2Chain
Reduce.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.reduce
;
package
com.ai.cloud.skywalking.analysis.categorize2chain
;
import
java.io.IOException
;
import
java.util.Iterator
;
import
com.ai.cloud.skywalking.analysis.config.Constants
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
org.apache.hadoop.hbase.client.Put
;
import
org.apache.hadoop.hbase.mapreduce.TableReducer
;
import
org.apache.hadoop.io.Text
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.util.Iterator
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
public
class
C
hainInfo
Reduce
extends
TableReducer
<
Text
,
ChainInfo
,
Put
>
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
C
hainInfo
Reduce
.
class
.
getName
());
public
class
C
ategorize2Chain
Reduce
extends
TableReducer
<
Text
,
ChainInfo
,
Put
>
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
C
ategorize2Chain
Reduce
.
class
.
getName
());
@Override
protected
void
reduce
(
Text
key
,
Iterable
<
ChainInfo
>
values
,
Context
context
)
throws
IOException
,
InterruptedException
{
...
...
@@ -21,11 +21,6 @@ public class ChainInfoReduce extends TableReducer<Text, ChainInfo, Put> {
}
public
static
void
reduceAction
(
String
key
,
Iterator
<
ChainInfo
>
chainInfoIterator
)
throws
IOException
,
InterruptedException
{
if
(
Constants
.
EXCEPTIONMAPPER
.
equals
(
key
))
{
logger
.
info
(
"Skip Exception Mapper....."
);
return
;
}
try
{
ChainRelate
chainRelate
=
HBaseUtil
.
selectCallChainRelationship
(
key
.
toString
());
Summary
summary
=
new
Summary
();
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/CategorizedChainInfo.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/CategorizedChainInfo.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/ChainDetail.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/ChainDetail.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.dao.CallChainInfoDao
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.dao.CallChainInfoDao
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.google.gson.Gson
;
import
org.apache.hadoop.hbase.client.Put
;
import
java.sql.SQLException
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/ChainNodeSpecificTimeWindowSummary.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/ChainNodeSpecificTimeWindowSummary.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
...
...
@@ -14,7 +14,7 @@ public class ChainNodeSpecificTimeWindowSummary {
private
String
traceLevelId
;
private
Map
<
String
,
SummaryResult
>
summerResultMap
;
private
Map
<
String
,
ChainNodeSpecificTimeWindowSummaryValue
>
summerResultMap
;
public
static
ChainNodeSpecificTimeWindowSummary
newInstance
(
String
traceLevelId
)
{
ChainNodeSpecificTimeWindowSummary
cns
=
new
ChainNodeSpecificTimeWindowSummary
();
...
...
@@ -23,14 +23,14 @@ public class ChainNodeSpecificTimeWindowSummary {
}
private
ChainNodeSpecificTimeWindowSummary
()
{
summerResultMap
=
new
HashMap
<
String
,
SummaryResult
>();
summerResultMap
=
new
HashMap
<
String
,
ChainNodeSpecificTimeWindowSummaryValue
>();
}
public
ChainNodeSpecificTimeWindowSummary
(
String
value
)
{
JsonObject
jsonObject
=
(
JsonObject
)
new
JsonParser
().
parse
(
value
);
traceLevelId
=
jsonObject
.
get
(
"traceLevelId"
).
getAsString
();
summerResultMap
=
new
Gson
().
fromJson
(
jsonObject
.
get
(
"summerResultMap"
).
toString
(),
new
TypeToken
<
Map
<
String
,
SummaryResult
>>()
{
new
TypeToken
<
Map
<
String
,
ChainNodeSpecificTimeWindowSummaryValue
>>()
{
}.
getType
());
}
...
...
@@ -40,9 +40,9 @@ public class ChainNodeSpecificTimeWindowSummary {
public
void
summary
(
ChainNode
node
)
{
String
key
=
generateKey
(
node
.
getStartDate
());
SummaryResult
summaryResult
=
summerResultMap
.
get
(
key
);
ChainNodeSpecificTimeWindowSummaryValue
summaryResult
=
summerResultMap
.
get
(
key
);
if
(
summaryResult
==
null
)
{
summaryResult
=
new
SummaryResult
();
summaryResult
=
new
ChainNodeSpecificTimeWindowSummaryValue
();
summerResultMap
.
put
(
key
,
summaryResult
);
}
summaryResult
.
summary
(
node
);
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce/SummaryResult
.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/ChainNodeSpecificTimeWindowSummaryValue
.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
public
class
SummaryResult
{
public
class
ChainNodeSpecificTimeWindowSummaryValue
{
private
long
totalCall
;
private
long
totalCostTime
;
private
long
correctNumber
;
public
SummaryResult
()
{
public
ChainNodeSpecificTimeWindowSummaryValue
()
{
totalCall
=
0
;
totalCostTime
=
0
;
correctNumber
=
0
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/ChainRelate.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/ChainRelate.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
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.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
com.google.gson.Gson
;
import
org.apache.hadoop.hbase.client.Put
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/ChainSpecificTimeWindowSummary.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/ChainSpecificTimeWindowSummary.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
org.apache.hadoop.hbase.client.Put
;
import
java.io.IOException
;
...
...
@@ -11,6 +12,9 @@ import java.util.Map;
public
class
ChainSpecificTimeWindowSummary
{
/**
* key : cid + 时间窗口
*/
private
Map
<
String
,
ChainNodeSpecificTimeWindowSummary
>
chainNodeSummaryResultMap
;
public
ChainSpecificTimeWindowSummary
()
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
mapper
/CostMap.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/CostMap.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
mapper
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
mapper
/SpanEntry.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/SpanEntry.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
mapper
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
import
com.ai.cloud.skywalking.protocol.CallType
;
import
com.ai.cloud.skywalking.protocol.Span
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/Summary.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/Summary.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.dao.CallChainInfoDao
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
dao.CallChainInfoDao
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.util.HBaseUtil
;
import
org.apache.hadoop.hbase.client.Put
;
import
java.io.IOException
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
reduce
/UncategorizeChainInfo.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain
/UncategorizeChainInfo.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.
reduce
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.
model.ChainNode
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.annotations.Expose
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/dao/CallChainInfoDao.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
dao/CallChainInfoDao.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.dao
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
dao
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.ChainDetail
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.reduce.ChainDetail
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/SpanNodeProcessChain.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/SpanNodeProcessChain.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter
;
import
java.io.IOException
;
import
java.util.HashMap
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/SpanNodeProcessFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/SpanNodeProcessFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
public
abstract
class
SpanNodeProcessFilter
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/impl/AppendBusinessKeyFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/impl/AppendBusinessKeyFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter.impl
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.impl
;
import
com.ai.cloud.skywalking.analysis.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
public
class
AppendBusinessKeyFilter
extends
SpanNodeProcessFilter
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/impl/CopyAttrFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/impl/CopyAttrFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter.impl
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.impl
;
import
com.ai.cloud.skywalking.analysis.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
public
class
CopyAttrFilter
extends
SpanNodeProcessFilter
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/impl/ProcessCostTimeFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/impl/ProcessCostTimeFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter.impl
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.impl
;
import
com.ai.cloud.skywalking.analysis.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
public
class
ProcessCostTimeFilter
extends
SpanNodeProcessFilter
{
@Override
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/impl/ReplaceAddressFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/impl/ReplaceAddressFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter.impl
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.impl
;
import
com.ai.cloud.skywalking.analysis.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
public
class
ReplaceAddressFilter
extends
SpanNodeProcessFilter
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/filter/impl/TokenGenerateFilter.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
filter/impl/TokenGenerateFilter.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.filter.impl
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
filter.impl
;
import
com.ai.cloud.skywalking.analysis.
filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.
mapper.CostMap
;
import
com.ai.cloud.skywalking.analysis.
mapper.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.CostMap
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.
categorize2chain.model.ChainNode
;
import
com.ai.cloud.skywalking.analysis.util.TokenGenerator
;
public
class
TokenGenerateFilter
extends
SpanNodeProcessFilter
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/model/ChainInfo.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
model/ChainInfo.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.model
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
model
;
import
com.ai.cloud.skywalking.analysis.util.TokenGenerator
;
import
org.apache.hadoop.io.Writable
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/model/ChainNode.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/
categorize2chain/
model/ChainNode.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.model
;
package
com.ai.cloud.skywalking.analysis.
categorize2chain.
model
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.annotations.Expose
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/config/Config.java
浏览文件 @
3af21631
...
...
@@ -11,7 +11,7 @@ public class Config {
public
static
String
TRACE_INFO_COLUMN_FAMILY
=
"trace_info"
;
public
static
String
CALL_CHAIN_TABLE_NAME
;
public
static
String
CALL_CHAIN_TABLE_NAME
=
"sw-call-chain"
;
public
static
String
ZK_QUORUM
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/config/Constants.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.config
;
public
class
Constants
{
public
static
final
String
EXCEPTIONMAPPER
=
"-1:"
;
public
static
final
String
UNCATEGORIZED_QUALIFIER_NAME
=
"UNCATEGORIZED_CALL_CHAIN"
;
}
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/util/HBaseUtil.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.util
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.CategorizedChainInfo
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.ChainNodeSpecificTimeWindowSummary
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.ChainRelate
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.ChainSpecificTimeWindowSummary
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.UncategorizeChainInfo
;
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.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.reduce.*
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.hbase.*
;
import
org.apache.hadoop.hbase.client.*
;
...
...
skywalking-analysis/src/test/java/com/ai/cloud/skywalking/analysis/mapper/CallChainMapperTest.java
浏览文件 @
3af21631
package
com.ai.cloud.skywalking.analysis.mapper
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.Categorize2ChainMapper
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.Categorize2ChainReduce
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.config.Config
;
import
com.ai.cloud.skywalking.analysis.config.ConfigInitializer
;
import
com.ai.cloud.skywalking.analysis.model.ChainInfo
;
import
com.ai.cloud.skywalking.analysis.reduce.ChainInfoReduce
;
import
com.ai.cloud.skywalking.protocol.Span
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.hbase.Cell
;
import
org.apache.hadoop.hbase.HBaseConfiguration
;
...
...
@@ -36,12 +38,12 @@ public class CallChainMapperTest {
public
void
testMap
()
throws
Exception
{
ConfigInitializer
.
initialize
();
List
<
Span
>
spanList
=
selectByTraceId
(
chain_Id
);
ChainInfo
chainInfo
=
Ca
ll
ChainMapper
.
spanToChainInfo
(
chain_Id
,
spanList
);
ChainInfo
chainInfo
=
Ca
tegorize2
ChainMapper
.
spanToChainInfo
(
chain_Id
,
spanList
);
List
<
ChainInfo
>
chainInfos
=
new
ArrayList
<
ChainInfo
>();
chainInfos
.
add
(
chainInfo
);
C
hainInfo
Reduce
.
reduceAction
(
chainInfo
.
getUserId
()
+
":"
+
chainInfo
.
getEntranceNodeToken
(),
chainInfos
.
iterator
());
C
ategorize2Chain
Reduce
.
reduceAction
(
chainInfo
.
getUserId
()
+
":"
+
chainInfo
.
getEntranceNodeToken
(),
chainInfos
.
iterator
());
}
public
static
List
<
Span
>
selectByTraceId
(
String
traceId
)
throws
IOException
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录