Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
a53bbbbc
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,发现更多精彩内容 >>
提交
a53bbbbc
编写于
4月 24, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the cat init error
上级
11e1eb81
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
8 deletion
+15
-8
cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java
.../java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java
+3
-1
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRuleManager.java
...ping/cat/system/alarm/threshold/ThresholdRuleManager.java
+0
-2
cat-home/src/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
...c/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
+12
-5
未找到文件。
cat-hadoop/src/main/java/com/dianping/cat/hadoop/hdfs/FileSystemManager.java
浏览文件 @
a53bbbbc
...
...
@@ -13,6 +13,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.configuration.ServerConfigManager
;
public
class
FileSystemManager
implements
Initializable
{
...
...
@@ -116,7 +117,8 @@ public class FileSystemManager implements Initializable {
m_config
=
getHdfsConfiguration
();
SecurityUtil
.
login
(
m_config
,
"dfs.cat.keytab.file"
,
"dfs.cat.kerberos.principal"
);
}
catch
(
IOException
e
)
{
throw
new
InitializationException
(
"init FileSystemManager fail"
,
e
);
Cat
.
logError
(
e
);
//throw new InitializationException("init FileSystemManager fail", e);
}
}
else
{
m_config
=
new
Configuration
();
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRuleManager.java
浏览文件 @
a53bbbbc
...
...
@@ -53,7 +53,6 @@ public class ThresholdRuleManager implements Initializable {
private
ThresholdRule
addExceptionRule
(
AlarmRule
rule
,
ThresholdTemplate
template
)
{
String
domain
=
rule
.
getDomain
();
ThresholdRule
thresholdRule
=
new
ThresholdRule
(
rule
.
getId
(),
domain
,
template
);
ArrayList
<
ThresholdRule
>
rules
=
m_exceptionRules
.
get
(
domain
);
if
(
rules
==
null
)
{
...
...
@@ -70,7 +69,6 @@ public class ThresholdRuleManager implements Initializable {
private
ThresholdRule
addServiceRule
(
AlarmRule
rule
,
ThresholdTemplate
template
)
{
String
domain
=
rule
.
getDomain
();
ThresholdRule
thresholdRule
=
new
ThresholdRule
(
rule
.
getId
(),
domain
,
template
);
ArrayList
<
ThresholdRule
>
rules
=
m_serviceRules
.
get
(
domain
);
if
(
rules
==
null
)
{
...
...
cat-home/src/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
浏览文件 @
a53bbbbc
...
...
@@ -7,8 +7,6 @@ import java.util.Map;
import
org.codehaus.plexus.logging.LogEnabled
;
import
org.codehaus.plexus.logging.Logger
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
import
org.unidal.lookup.annotation.Inject
;
...
...
@@ -36,27 +34,33 @@ public class MailSMSImpl implements MailSMS, Initializable, LogEnabled {
private
SMSService
m_smsService
;
private
boolean
m_initialize
=
false
;;
@Override
public
void
enableLogging
(
Logger
logger
)
{
m_logger
=
logger
;
}
@Override
public
void
initialize
()
throws
InitializationException
{
public
void
initialize
()
{
if
(
m_serverConfig
.
isJobMachine
()
&&
!
m_serverConfig
.
isLocalMode
())
{
try
{
ApplicationContext
ctx
=
new
ClassPathXmlApplicationContext
(
"spring/remoteService.xml"
);
m_mailService
=
(
MailService
)
ctx
.
getBean
(
"mailService"
);
m_smsService
=
(
SMSService
)
ctx
.
getBean
(
"smsService"
);
}
catch
(
BeansException
e
)
{
throw
new
RuntimeException
(
e
);
m_initialize
=
true
;
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
}
}
@Override
public
boolean
sendEmail
(
String
title
,
String
content
,
List
<
String
>
emails
)
{
if
(!
m_initialize
)
{
initialize
();
}
boolean
sendResult
=
false
;
if
(
m_serverConfig
.
isJobMachine
())
{
...
...
@@ -81,6 +85,9 @@ public class MailSMSImpl implements MailSMS, Initializable, LogEnabled {
@Override
public
boolean
sendSMS
(
String
content
,
List
<
String
>
phones
)
{
if
(!
m_initialize
)
{
initialize
();
}
boolean
sendResult
=
false
;
if
(
m_serverConfig
.
isJobMachine
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录