Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
Overview
Overview
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-hook
gic-cloud
Commits
11c9fc91
Commit
11c9fc91
authored
Apr 27, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-2023-04' into 'master'
Fix 2023 04 See merge request
!103
parents
5ace0ff6
71eb3f70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
DingWarningUtil.java
...java/com/gic/cloud/data/hook/service/DingWarningUtil.java
+18
-1
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+5
-4
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/DingWarningUtil.java
View file @
11c9fc91
...
...
@@ -5,9 +5,16 @@ import com.ctrip.framework.apollo.ConfigService;
import
com.gic.commons.util.DingtalkMessageUtil
;
import
com.gic.commons.util.TraceIdUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
DingWarningUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DingWarningUtil
.
class
);
private
static
final
String
dingdingurl
=
"https://oapi.dingtalk.com/robot/send?access_token=1d6a0756fcfe5f215e3ed37d7e60960635d0009f71b476f3b402e7671fc2a8ca"
;
...
...
@@ -16,11 +23,21 @@ public class DingWarningUtil {
public
static
void
sendCountWarning
(
String
msg
)
{
Config
appConfig
=
ConfigService
.
getAppConfig
();
String
url
=
appConfig
.
getProperty
(
"ding.url"
,
dingdingurl
);
String
mobile
=
appConfig
.
getProperty
(
"ding.mobile"
,
null
);
ProviderLocalTag
localTag
=
ProviderLocalTag
.
tag
.
get
();
String
traceId
=
localTag
.
traceId
;
try
{
msg
=
msg
+
": "
+
traceId
;
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
);
List
<
String
>
mobiles
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
mobile
))
{
String
[]
split
=
mobile
.
split
(
","
);
mobiles
=
Arrays
.
stream
(
split
).
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isEmpty
(
mobiles
))
{
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
);
}
else
{
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
,
mobiles
);
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
);
}
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
11c9fc91
...
...
@@ -910,6 +910,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
logger
.
info
(
"不存在"
);
return
;
}
boolean
delHiveFile
=
true
;
Integer
queryDataType
=
task
.
getQueryDataType
();
FlatQueryTaskCondition
condition
=
JSON
.
parseObject
(
task
.
getDownloadCondition
(),
FlatQueryTaskCondition
.
class
);
if
(!
task
.
getStatus
().
equals
(
DownloadTaskStatus
.
BUILDING
))
{
...
...
@@ -921,8 +922,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
//下载文件
String
dirName
=
HDFSUtil
.
getInstance
().
getHdfsName
(
task
.
getId
());
String
path
=
HDFSUtil
.
getInstance
().
getHdfsPath
(
task
.
getId
());
HDFSUtil
.
getInstance
().
getHdfsName
(
task
.
getId
());
try
{
StopWatch
stopWatch
=
StopWatch
.
create
(
"down"
);
stopWatch
.
start
();
...
...
@@ -958,6 +957,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
if
(
task
.
getAmount
()!=
total
.
intValue
())
{
String
msg
=
"取数任务:"
+
task
.
getId
()+
"下载数量对不上: 数量: "
+
task
.
getAmount
()+
"->"
+
total
;
DingWarningUtil
.
sendCountWarning
(
msg
);
delHiveFile
=
false
;
}
stopWatch
.
start
();
//是否压缩
...
...
@@ -984,8 +984,6 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
task
.
setOverTime
(
new
Date
());
task
.
setFilePath
(
cloudFileUrl
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
);
task
.
setStatus
(
DownloadTaskStatus
.
ERROR
);
...
...
@@ -993,6 +991,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
DownloadTaskServiceImpl
.
getInstance
().
updateDownloadTask
(
task
);
//删除文件
delFileOrDirByTaskId
(
task
.
getId
());
if
(
delHiveFile
)
{
HDFSUtil
.
getInstance
().
deleteFile
(
path
);
}
}
}
...
...
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