Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
2caae110
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2caae110
编写于
4月 11, 2012
作者:
F
Frankie Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upgrade to 0.2.2
上级
2b6f0e63
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
98 addition
and
40 deletion
+98
-40
cat-consumer/pom.xml
cat-consumer/pom.xml
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/LogviewUploader.java
.../main/java/com/dianping/cat/consumer/LogviewUploader.java
+0
-5
cat-consumer/src/main/java/com/dianping/cat/consumer/RealtimeConsumer.java
...main/java/com/dianping/cat/consumer/RealtimeConsumer.java
+10
-4
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
...m/dianping/cat/consumer/build/ComponentsConfigurator.java
+16
-14
cat-consumer/src/main/java/com/dianping/cat/consumer/logview/LogviewUploader.java
...va/com/dianping/cat/consumer/logview/LogviewUploader.java
+36
-0
cat-consumer/src/main/resources/META-INF/plexus/components.xml
...onsumer/src/main/resources/META-INF/plexus/components.xml
+7
-0
cat-core/pom.xml
cat-core/pom.xml
+1
-1
cat-core/src/main/java/com/dianping/cat/storage/message/LocalMessageBucket.java
.../com/dianping/cat/storage/message/LocalMessageBucket.java
+1
-1
cat-core/src/main/java/com/dianping/cat/storage/report/LocalReportBucket.java
...va/com/dianping/cat/storage/report/LocalReportBucket.java
+1
-1
cat-core/src/main/resources/META-INF/plexus/components.xml
cat-core/src/main/resources/META-INF/plexus/components.xml
+4
-0
cat-hadoop/pom.xml
cat-hadoop/pom.xml
+1
-1
cat-hadoop/src/main/resources/META-INF/plexus/components.xml
cat-hadoop/src/main/resources/META-INF/plexus/components.xml
+0
-4
cat-home/pom.xml
cat-home/pom.xml
+1
-1
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+12
-0
cat-job/pom.xml
cat-job/pom.xml
+1
-1
pom.xml
pom.xml
+6
-6
未找到文件。
cat-consumer/pom.xml
浏览文件 @
2caae110
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-consumer
</artifactId>
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/LogviewUploader.java
已删除
100644 → 0
浏览文件 @
2b6f0e63
package
com.dianping.cat.consumer
;
public
class
LogviewUploader
{
}
cat-consumer/src/main/java/com/dianping/cat/consumer/RealtimeConsumer.java
浏览文件 @
2caae110
...
...
@@ -16,6 +16,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.consumer.logview.LogviewUploader
;
import
com.dianping.cat.message.Message
;
import
com.dianping.cat.message.MessageProducer
;
import
com.dianping.cat.message.Transaction
;
...
...
@@ -59,6 +60,9 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
@Inject
private
AnalyzerFactory
m_factory
;
@Inject
private
LogviewUploader
m_uploader
;
private
ExecutorService
m_executor
;
private
Set
<
String
>
m_domains
=
new
HashSet
<
String
>();
...
...
@@ -208,10 +212,6 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
Cat
.
reset
();
}
private
void
uploadLogviewBuckets
(
Set
<
String
>
domains
)
{
}
private
void
flushLogviewBuckets
(
Set
<
String
>
domains
)
{
BucketManager
manager
=
lookup
(
BucketManager
.
class
);
...
...
@@ -262,6 +262,12 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
m_executor
.
submit
(
task
);
}
}
private
void
uploadLogviewBuckets
(
Set
<
String
>
domains
)
{
for
(
String
domain
:
domains
)
{
m_uploader
.
upload
(
m_startTime
,
domain
);
}
}
}
class
PeriodManager
extends
Thread
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
浏览文件 @
2caae110
...
...
@@ -17,6 +17,7 @@ import com.dianping.cat.consumer.dump.DumpChannelManager;
import
com.dianping.cat.consumer.dump.DumpUploader
;
import
com.dianping.cat.consumer.event.EventAnalyzer
;
import
com.dianping.cat.consumer.ip.IpAnalyzer
;
import
com.dianping.cat.consumer.logview.LogviewUploader
;
import
com.dianping.cat.consumer.problem.ProblemAnalyzer
;
import
com.dianping.cat.consumer.problem.handler.ErrorHandler
;
import
com.dianping.cat.consumer.problem.handler.FailureHandler
;
...
...
@@ -40,44 +41,45 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
AnalyzerFactory
.
class
,
DefaultAnalyzerFactory
.
class
));
all
.
add
(
C
(
MessageConsumer
.
class
,
"realtime"
,
RealtimeConsumer
.
class
)
//
.
req
(
AnalyzerFactory
.
class
)
//
.
config
(
E
(
"extraTime"
).
value
(
property
(
"extraTime"
,
"300000"
))
//
,
E
(
"analyzers"
).
value
(
"problem,transaction,event,ip,dump"
)));
.
req
(
AnalyzerFactory
.
class
,
LogviewUploader
.
class
)
//
.
config
(
E
(
"extraTime"
).
value
(
property
(
"extraTime"
,
"300000"
))
//
,
E
(
"analyzers"
).
value
(
"problem,transaction,event,ip,dump"
)));
String
errorTypes
=
"Error,RuntimeException,Exception"
;
String
failureTypes
=
"URL,SQL,Call,Cache"
;
all
.
add
(
C
(
Handler
.
class
,
ERROR
.
getName
(),
ErrorHandler
.
class
)
//
.
config
(
E
(
"errorType"
).
value
(
errorTypes
)));
.
config
(
E
(
"errorType"
).
value
(
errorTypes
)));
all
.
add
(
C
(
Handler
.
class
,
FAILURE
.
getName
(),
FailureHandler
.
class
)
//
.
config
(
E
(
"failureType"
).
value
(
failureTypes
)));
.
config
(
E
(
"failureType"
).
value
(
failureTypes
)));
all
.
add
(
C
(
Handler
.
class
,
LONG_URL
.
getName
(),
LongUrlHandler
.
class
)
//
.
req
(
ServerConfigManager
.
class
));
.
req
(
ServerConfigManager
.
class
));
all
.
add
(
C
(
ProblemAnalyzer
.
class
).
is
(
PER_LOOKUP
)
//
.
req
(
Handler
.
class
,
new
String
[]
{
FAILURE
.
getName
(),
ERROR
.
getName
(),
LONG_URL
.
getName
()
},
"m_handlers"
)
//
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
.
req
(
Handler
.
class
,
new
String
[]
{
FAILURE
.
getName
(),
ERROR
.
getName
(),
LONG_URL
.
getName
()
},
"m_handlers"
)
//
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
all
.
add
(
C
(
TransactionAnalyzer
.
class
).
is
(
PER_LOOKUP
)
//
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
all
.
add
(
C
(
EventAnalyzer
.
class
).
is
(
PER_LOOKUP
)
//
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
.
req
(
BucketManager
.
class
,
ReportDao
.
class
));
all
.
add
(
C
(
IpAnalyzer
.
class
));
all
.
add
(
C
(
DumpAnalyzer
.
class
).
is
(
PER_LOOKUP
)
//
.
req
(
MessagePathBuilder
.
class
)
//
.
req
(
DumpChannelManager
.
class
));
.
req
(
MessagePathBuilder
.
class
)
//
.
req
(
DumpChannelManager
.
class
));
all
.
add
(
C
(
DumpChannel
.
class
));
all
.
add
(
C
(
DumpChannelManager
.
class
)
//
.
req
(
MessageCodec
.
class
,
"plain-text"
));
.
req
(
MessageCodec
.
class
,
"plain-text"
));
all
.
add
(
C
(
LogviewUploader
.
class
));
all
.
add
(
C
(
DumpUploader
.
class
)
//
.
req
(
FileSystemManager
.
class
)
//
.
req
(
FileSystemManager
.
class
)
//
);
return
all
;
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/logview/LogviewUploader.java
0 → 100644
浏览文件 @
2caae110
package
com.dianping.cat.consumer.logview
;
import
java.text.MessageFormat
;
import
java.util.Date
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.configuration.server.entity.ServerConfig
;
import
com.dianping.cat.message.spi.MessagePathBuilder
;
import
com.site.lookup.ContainerHolder
;
import
com.site.lookup.annotation.Inject
;
public
class
LogviewUploader
extends
ContainerHolder
implements
Initializable
{
@Inject
private
MessagePathBuilder
m_builder
;
private
String
m_baseDir
=
"target/bucket/logview"
;
public
void
upload
(
long
timestamp
,
String
domain
)
{
MessageFormat
format
=
new
MessageFormat
(
"{0,date,yyyyMMdd}/{1}"
);
String
path
=
format
.
format
(
new
Object
[]
{
new
Date
(
timestamp
),
domain
});
}
@Override
public
void
initialize
()
throws
InitializationException
{
ServerConfigManager
configManager
=
lookup
(
ServerConfigManager
.
class
);
ServerConfig
serverConfig
=
configManager
.
getServerConfig
();
if
(
serverConfig
!=
null
)
{
m_baseDir
=
serverConfig
.
getStorage
().
getLocalBaseDir
();
}
}
}
cat-consumer/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
2caae110
...
...
@@ -16,6 +16,9 @@
<requirement>
<role>
com.dianping.cat.consumer.AnalyzerFactory
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.logview.LogviewUploader
</role>
</requirement>
</requirements>
</component>
<component>
...
...
@@ -123,6 +126,10 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.consumer.logview.LogviewUploader
</role>
<implementation>
com.dianping.cat.consumer.logview.LogviewUploader
</implementation>
</component>
<component>
<role>
com.dianping.cat.consumer.dump.DumpUploader
</role>
<implementation>
com.dianping.cat.consumer.dump.DumpUploader
</implementation>
...
...
cat-core/pom.xml
浏览文件 @
2caae110
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-core
</artifactId>
...
...
cat-core/src/main/java/com/dianping/cat/storage/message/LocalMessageBucket.java
浏览文件 @
2caae110
...
...
@@ -30,7 +30,7 @@ public class LocalMessageBucket implements Bucket<MessageTree> {
@Inject
private
ServerConfigManager
m_configManager
;
private
String
m_baseDir
=
"target/bucket"
;
private
String
m_baseDir
=
"target/bucket
/dump
"
;
private
ReentrantLock
m_writeLock
;
...
...
cat-core/src/main/java/com/dianping/cat/storage/report/LocalReportBucket.java
浏览文件 @
2caae110
...
...
@@ -33,7 +33,7 @@ public class LocalReportBucket implements Bucket<String>, LogEnabled {
@Inject
private
ServerConfigManager
m_configManager
;
private
String
m_baseDir
=
"target/bucket"
;
private
String
m_baseDir
=
"target/bucket
/report
"
;
// key => offset of record
private
Map
<
String
,
Long
>
m_idToOffsets
=
new
HashMap
<
String
,
Long
>();
...
...
cat-core/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
2caae110
<plexus>
<components>
<component>
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
<implementation>
com.dianping.cat.configuration.ServerConfigManager
</implementation>
</component>
<component>
<role>
com.dianping.cat.message.io.InMemoryQueue
</role>
<implementation>
com.dianping.cat.message.io.InMemoryQueue
</implementation>
...
...
cat-hadoop/pom.xml
浏览文件 @
2caae110
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-hadoop
</artifactId>
...
...
cat-hadoop/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
2caae110
<plexus>
<components>
<component>
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
<implementation>
com.dianping.cat.configuration.ServerConfigManager
</implementation>
</component>
<component>
<role>
com.dianping.cat.hadoop.hdfs.FileSystemManager
</role>
<implementation>
com.dianping.cat.hadoop.hdfs.FileSystemManager
</implementation>
...
...
cat-home/pom.xml
浏览文件 @
2caae110
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-home
</artifactId>
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
2caae110
...
...
@@ -297,6 +297,18 @@
<requirement>
<role>
com.dianping.cat.consumer.AnalyzerFactory
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.consumer.logview.LogviewUploader
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.consumer.logview.LogviewUploader
</role>
<implementation>
com.dianping.cat.consumer.logview.LogviewUploader
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.message.spi.MessagePathBuilder
</role>
</requirement>
</requirements>
</component>
<component>
...
...
cat-job/pom.xml
浏览文件 @
2caae110
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-job
</artifactId>
...
...
pom.xml
浏览文件 @
2caae110
...
...
@@ -4,37 +4,37 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
<name>
Tracking
</name>
<packaging>
pom
</packaging>
<modules>
<module>
cat-core
</module>
<module>
cat-hadoop
</module>
<module>
cat-consumer
</module>
<module>
cat-home
</module>
<module>
cat-job
</module>
<module>
cat-home
</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-core
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-hadoop
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-consumer
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-job
</artifactId>
<version>
0.2.
1
</version>
<version>
0.2.
2
</version>
</dependency>
<dependency>
<groupId>
com.site.common
</groupId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录