Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
76d303c0
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,发现更多精彩内容 >>
提交
76d303c0
编写于
5月 29, 2013
作者:
K
kezhu.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit my code
上级
fbbfddec
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
62 addition
and
13 deletion
+62
-13
cat-core/src/main/java/com/dianping/cat/abtest/repository/ProtocolMessage.java
...a/com/dianping/cat/abtest/repository/ProtocolMessage.java
+5
-0
cat-core/src/main/resources/META-INF/plexus/components.xml
cat-core/src/main/resources/META-INF/plexus/components.xml
+2
-6
cat-home/pom.xml
cat-home/pom.xml
+5
-0
cat-home/src/main/java/com/dianping/cat/CatHomeModule.java
cat-home/src/main/java/com/dianping/cat/CatHomeModule.java
+11
-4
cat-home/src/main/java/com/dianping/cat/build/ServiceComponentConfigurator.java
.../com/dianping/cat/build/ServiceComponentConfigurator.java
+10
-0
cat-home/src/main/java/com/dianping/cat/system/page/abtest/server/DefaultABTestEntityServer.java
.../system/page/abtest/server/DefaultABTestEntityServer.java
+11
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+15
-0
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
+3
-3
未找到文件。
cat-core/src/main/java/com/dianping/cat/abtest/repository/ProtocolMessage.java
浏览文件 @
76d303c0
...
...
@@ -6,6 +6,11 @@ import java.util.Map;
import
org.unidal.socket.Message
;
public
class
ProtocolMessage
implements
Message
{
public
static
final
String
HELLO_NAME
=
"hello"
;
public
static
final
String
HEARTBEAT_NAME
=
"heartbeat"
;
private
String
m_name
;
private
String
m_content
;
...
...
cat-core/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
76d303c0
...
...
@@ -316,8 +316,8 @@
<implementation>
com.dianping.cat.abtest.spi.internal.DefaultABTestEntityManager
</implementation>
</component>
<component>
<role>
com.dianping.cat.abtest.
spi.internal
.ABTestEntityRepository
</role>
<implementation>
com.dianping.cat.abtest.
spi.internal
.DefaultABTestEntityRepository
</implementation>
<role>
com.dianping.cat.abtest.
repository
.ABTestEntityRepository
</role>
<implementation>
com.dianping.cat.abtest.
repository
.DefaultABTestEntityRepository
</implementation>
<configuration>
<address>
228.0.0.3:2283
</address>
</configuration>
...
...
@@ -325,10 +325,6 @@
<requirement>
<role>
com.dianping.cat.configuration.ClientConfigManager
</role>
</requirement>
<requirement>
<role>
org.unidal.socket.udp.UdpSocket
</role>
<role-hint>
abtest
</role-hint>
</requirement>
</requirements>
</component>
</components>
...
...
cat-home/pom.xml
浏览文件 @
76d303c0
...
...
@@ -10,6 +10,11 @@
<name>
CAT Home
</name>
<packaging>
war
</packaging>
<dependencies>
<dependency>
<groupId>
org.unidal.framework
</groupId>
<artifactId>
foundation-service
</artifactId>
<version>
2.0.3-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-consumer
</artifactId>
...
...
cat-home/src/main/java/com/dianping/cat/CatHomeModule.java
浏览文件 @
76d303c0
...
...
@@ -21,14 +21,13 @@ import com.dianping.cat.system.alarm.threshold.listener.ServiceDataListener;
import
com.dianping.cat.system.alarm.threshold.listener.ThresholdAlertListener
;
import
com.dianping.cat.system.event.EventListenerRegistry
;
import
com.dianping.cat.system.notify.ScheduledMailTask
;
import
com.dianping.cat.system.page.abtest.server.ABTestEntityServer
;
public
class
CatHomeModule
extends
AbstractModule
{
public
static
final
String
ID
=
"cat-home"
;
@Override
protected
void
execute
(
ModuleContext
ctx
)
throws
Exception
{
// warm up IP seeker
// IPSeekerManager.initailize(new File(serverConfigManager.getStorageLocalBaseDir()));
ServerConfigManager
serverConfigManager
=
ctx
.
lookup
(
ServerConfigManager
.
class
);
ctx
.
lookup
(
MessageConsumer
.
class
,
"realtime"
);
...
...
@@ -42,10 +41,18 @@ public class CatHomeModule extends AbstractModule {
Threads
.
forGroup
(
"Cat"
).
start
(
dailyTaskProducer
);
}
executeAlarmModule
(
ctx
);
executeAbtestModule
(
ctx
);
executeAlarmModule
(
ctx
);
}
private
void
executeAlarmModule
(
ModuleContext
ctx
)
throws
Exception
{
private
void
executeAbtestModule
(
ModuleContext
ctx
)
{
ABTestEntityServer
server
=
ctx
.
lookup
(
ABTestEntityServer
.
class
);
server
.
start
();
}
private
void
executeAlarmModule
(
ModuleContext
ctx
)
throws
Exception
{
ServerConfigManager
serverConfigManager
=
ctx
.
lookup
(
ServerConfigManager
.
class
);
EventListenerRegistry
registry
=
ctx
.
lookup
(
EventListenerRegistry
.
class
);
...
...
cat-home/src/main/java/com/dianping/cat/build/ServiceComponentConfigurator.java
浏览文件 @
76d303c0
...
...
@@ -8,6 +8,9 @@ import org.unidal.lookup.configuration.Component;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.hadoop.hdfs.HdfsMessageBucketManager
;
import
com.dianping.cat.home.dal.abtest.AbtestDao
;
import
com.dianping.cat.home.dal.abtest.AbtestRunDao
;
import
com.dianping.cat.home.dal.abtest.GroupStrategyDao
;
import
com.dianping.cat.message.spi.MessageCodec
;
import
com.dianping.cat.message.spi.MessageConsumer
;
import
com.dianping.cat.report.page.model.cross.CompositeCrossService
;
...
...
@@ -51,6 +54,8 @@ import com.dianping.cat.report.service.ReportService;
import
com.dianping.cat.storage.BucketManager
;
import
com.dianping.cat.storage.dump.LocalMessageBucketManager
;
import
com.dianping.cat.storage.dump.MessageBucketManager
;
import
com.dianping.cat.system.page.abtest.server.ABTestEntityServer
;
import
com.dianping.cat.system.page.abtest.server.DefaultABTestEntityServer
;
class
ServiceComponentConfigurator
extends
AbstractResourceConfigurator
{
@Override
...
...
@@ -169,6 +174,11 @@ class ServiceComponentConfigurator extends AbstractResourceConfigurator {
.
req
(
ServerConfigManager
.
class
)
//
.
req
(
ModelService
.
class
,
new
String
[]
{
"message-historical"
,
"logview-historical"
},
"m_services"
));
all
.
add
(
C
(
ABTestEntityServer
.
class
,
DefaultABTestEntityServer
.
class
)
//
.
req
(
AbtestRunDao
.
class
)
//
.
req
(
AbtestDao
.
class
)
//
.
req
(
GroupStrategyDao
.
class
));
return
all
;
}
}
cat-home/src/main/java/com/dianping/cat/system/page/abtest/server/DefaultABTestEntityServer.java
浏览文件 @
76d303c0
...
...
@@ -72,13 +72,24 @@ public class DefaultABTestEntityServer implements ABTestEntityServer, Initializa
private
AbtestModel
m_abtestModel
;
public
DefaultABTestEntityServer
()
{
super
();
System
.
out
.
println
(
"ABTest Server initing."
);
}
@Override
public
void
initialize
()
throws
InitializationException
{
m_logger
.
info
(
"ABTest Server initing."
);
m_socket
=
new
UdpSocket
();
m_socket
.
setName
(
"ABTest"
);
m_socket
.
setCodec
(
new
ProtocolMessageCodec
());
m_socket
.
onMessage
(
new
ProtocolHandler
());
m_logger
.
info
(
"ABTest Server inited"
);
}
public
void
start
()
{
m_socket
.
listenOn
(
m_address
);
// 启动RefreshEntityTask任务
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
76d303c0
...
...
@@ -1141,6 +1141,21 @@
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.page.abtest.server.ABTestEntityServer
</role>
<implementation>
com.dianping.cat.system.page.abtest.server.DefaultABTestEntityServer
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.home.dal.abtest.AbtestRunDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.home.dal.abtest.AbtestDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.home.dal.abtest.GroupStrategyDao
</role>
</requirement>
</requirements>
</component>
<component>
<role>
org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager
</role>
<implementation>
org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager
</implementation>
...
...
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
浏览文件 @
76d303c0
...
...
@@ -3,9 +3,9 @@
<jdbc
package=
"com.dianping.cat.home.dal"
name=
"cat"
>
<datasource>
<driver>
com.mysql.jdbc.Driver
</driver>
<url>
jdbc:mysql://1
27.0.0.1
:3306/cat
</url>
<user>
root
</user>
<password></password>
<url>
jdbc:mysql://1
92.168.7.43
:3306/cat
</url>
<user>
binlog
</user>
<password>
binlog
</password>
<properties>
useUnicode=true
&
autoReconnect=true
</properties>
</datasource>
<group
name=
"report"
package=
"com.dianping.cat.home.dal.report"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录