Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
DQMP
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data
DQMP
Commits
9d0c00e8
Commit
9d0c00e8
authored
Jan 08, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update special monitor codes
parent
89a7e796
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
12 deletions
+10
-12
readme.txt
docs/readme.txt
+2
-1
pom.xml
pom.xml
+0
-2
DqRuleServiceImpl.java
...va/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
+0
-3
FormatServiceImpl.java
...va/com/gmei/data/dqmp/service/impl/FormatServiceImpl.java
+0
-1
MonitorServiceImpl.java
...a/com/gmei/data/dqmp/service/impl/MonitorServiceImpl.java
+6
-3
application.yml
src/main/resources/application.yml
+2
-2
No files found.
docs/readme.txt
View file @
9d0c00e8
sudo mdir -p /data/log/dqmp
sudo m
k
dir -p /data/log/dqmp
sudo chown -R apple:wheel /data/log/dqmp
sudo chown -R apple:wheel /data/log/dqmp
\ No newline at end of file
pom.xml
View file @
9d0c00e8
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
<dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<artifactId>
httpclient
</artifactId>
<version>
4.3.2
</version>
</dependency>
</dependency>
<!-- 集成mysql驱动 -->
<!-- 集成mysql驱动 -->
<dependency>
<dependency>
...
@@ -75,7 +74,6 @@
...
@@ -75,7 +74,6 @@
<dependency>
<dependency>
<groupId>
net.sourceforge.nekohtml
</groupId>
<groupId>
net.sourceforge.nekohtml
</groupId>
<artifactId>
nekohtml
</artifactId>
<artifactId>
nekohtml
</artifactId>
<version>
1.9.22
</version>
</dependency>
</dependency>
<!-- 集成热部署插件 -->
<!-- 集成热部署插件 -->
<dependency>
<dependency>
...
...
src/main/java/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
View file @
9d0c00e8
...
@@ -130,7 +130,6 @@ public class DqRuleServiceImpl implements DqRuleService {
...
@@ -130,7 +130,6 @@ public class DqRuleServiceImpl implements DqRuleService {
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
return
false
;
}
}
dqRuleVo
.
setStartTime
(
DateUtils
.
getZeroTimeStrsMap
().
get
(
dqRuleVo
.
getStartTime
()));
TblSqlMonitorSpecial
tblSqlMonitorSpecial
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlMonitorSpecial
.
class
);
TblSqlMonitorSpecial
tblSqlMonitorSpecial
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlMonitorSpecial
.
class
);
tblSqlMonitorSpecial
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlMonitorSpecial
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlMonitorSpecial
.
setParentId
(
record
.
getId
());
tblSqlMonitorSpecial
.
setParentId
(
record
.
getId
());
...
@@ -229,8 +228,6 @@ public class DqRuleServiceImpl implements DqRuleService {
...
@@ -229,8 +228,6 @@ public class DqRuleServiceImpl implements DqRuleService {
.
replaceAll
(
"#tb_name"
,
dqRuleVo
.
getTbName
()).
replaceAll
(
"#indicator_type"
,
indicatorType
)
.
replaceAll
(
"#tb_name"
,
dqRuleVo
.
getTbName
()).
replaceAll
(
"#indicator_type"
,
indicatorType
)
.
replaceAll
(
"#indicator_expre"
,
indicatorMap
.
get
(
indicatorType
))
.
replaceAll
(
"#indicator_expre"
,
indicatorMap
.
get
(
indicatorType
))
.
replaceAll
(
"#col_name"
,
dqRuleVo
.
getColName
())
.
replaceAll
(
"#col_name"
,
dqRuleVo
.
getColName
())
.
replaceAll
(
"#start_time"
,
"'"
+
dqRuleVo
.
getStartTime
()
+
"'"
)
.
replaceAll
(
"#end_time"
,
"'"
+
DateUtils
.
getTodayZeroTimeStr
()
+
"'"
)
.
replaceAll
(
"#check_db_name"
,
dqRuleVo
.
getCheckDbName
())
.
replaceAll
(
"#check_db_name"
,
dqRuleVo
.
getCheckDbName
())
.
replaceAll
(
"#check_tb_name"
,
dqRuleVo
.
getCheckTbName
())
.
replaceAll
(
"#check_tb_name"
,
dqRuleVo
.
getCheckTbName
())
.
replaceAll
(
"#check_col_name"
,
dqRuleVo
.
getCheckColName
())
.
replaceAll
(
"#check_col_name"
,
dqRuleVo
.
getCheckColName
())
...
...
src/main/java/com/gmei/data/dqmp/service/impl/FormatServiceImpl.java
View file @
9d0c00e8
...
@@ -19,7 +19,6 @@ public class FormatServiceImpl implements FormatService {
...
@@ -19,7 +19,6 @@ public class FormatServiceImpl implements FormatService {
Pattern
p
=
Pattern
.
compile
(
"\\s{1,}|\t|\r|\n"
);
Pattern
p
=
Pattern
.
compile
(
"\\s{1,}|\t|\r|\n"
);
Matcher
m
=
p
.
matcher
(
str
);
Matcher
m
=
p
.
matcher
(
str
);
dest
=
m
.
replaceAll
(
" "
);
dest
=
m
.
replaceAll
(
" "
);
}
}
return
dest
;
return
dest
;
}
}
...
...
src/main/java/com/gmei/data/dqmp/service/impl/MonitorServiceImpl.java
View file @
9d0c00e8
...
@@ -109,8 +109,9 @@ public class MonitorServiceImpl implements MonitorService {
...
@@ -109,8 +109,9 @@ public class MonitorServiceImpl implements MonitorService {
String
sql
=
tblCheckSql
.
getSqlContent
();
String
sql
=
tblCheckSql
.
getSqlContent
();
Integer
id
=
tblCheckSql
.
getId
();
Integer
id
=
tblCheckSql
.
getId
();
Double
threshold
=
tblCheckSql
.
getThreshold
();
Double
threshold
=
tblCheckSql
.
getThreshold
();
String
startTime
=
tblCheckSql
.
getStartTime
();
int
rs
=
0
;
int
rs
=
0
;
TblResultMonitorSpecial
tblResultMonitorSpecial
=
getMonitorSpecialResult
(
sql
);
TblResultMonitorSpecial
tblResultMonitorSpecial
=
getMonitorSpecialResult
(
sql
,
startTime
);
if
(
tblResultMonitorSpecial
==
null
)
{
if
(
tblResultMonitorSpecial
==
null
)
{
logger
.
error
(
"Find result is empty!"
);
logger
.
error
(
"Find result is empty!"
);
continue
;
continue
;
...
@@ -173,8 +174,10 @@ public class MonitorServiceImpl implements MonitorService {
...
@@ -173,8 +174,10 @@ public class MonitorServiceImpl implements MonitorService {
* @param sql
* @param sql
* @return
* @return
*/
*/
private
TblResultMonitorSpecial
getMonitorSpecialResult
(
String
sql
)
{
private
TblResultMonitorSpecial
getMonitorSpecialResult
(
String
sql
,
String
startTime
)
{
sql
=
sql
.
replaceAll
(
"#partition_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
sql
=
sql
.
replaceAll
(
"#partition_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()))
.
replaceAll
(
"#start_time"
,
"'"
+
DateUtils
.
getZeroTimeStrsMap
().
get
(
startTime
)
+
"'"
)
.
replaceAll
(
"#end_time"
,
"'"
+
DateUtils
.
getTodayZeroTimeStr
()
+
"'"
);
logger
.
info
(
"Sql content : {}"
,
sql
);
logger
.
info
(
"Sql content : {}"
,
sql
);
TblResultMonitorSpecial
tblResultMonitorSpecial
=
null
;
TblResultMonitorSpecial
tblResultMonitorSpecial
=
null
;
if
(
StringUtils
.
isBlank
(
sql
))
{
if
(
StringUtils
.
isBlank
(
sql
))
{
...
...
src/main/resources/application.yml
View file @
9d0c00e8
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
prod
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment