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
98a9893e
Commit
98a9893e
authored
Dec 06, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取数平台调整
parent
3044c191
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
HiveHelper.java
...main/java/com/gic/cloud/data/hook/service/HiveHelper.java
+2
-0
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+21
-2
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/HiveHelper.java
View file @
98a9893e
...
...
@@ -4,6 +4,7 @@ import cn.medubi.client.utils.LogPak;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.commons.util.DingtalkMessageUtil
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
...
...
@@ -84,6 +85,7 @@ public class HiveHelper implements ApplicationContextAware {
conn
=
downloadSource
.
getConnection
();
return
conn
;
}
catch
(
Exception
ex
)
{
DingtalkMessageUtil
.
sendAlertMessage
(
"获取连接告警:获取连接超时"
,
"https://oapi.dingtalk.com/robot/send?access_token=157ad00c2b6491f2f0aac1d89121e4bd2d82d9d33cad0596b88dacfdc12fe455"
);
ex
.
printStackTrace
();
if
(
conn
!=
null
)
{
try
{
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
98a9893e
...
...
@@ -29,6 +29,7 @@ import org.apache.poi.ss.usermodel.Cell;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.xssf.streaming.SXSSFWorkbook
;
import
org.datanucleus.store.rdbms.datasource.dbcp.SQLNestedException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
...
...
@@ -536,6 +537,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
downloadService
.
scheduleAtFixedRate
(
new
Runnable
()
{
@Override
public
void
run
()
{
Connection
connection
=
null
;
try
{
if
(
taskConditions
!=
null
&&
taskConditions
.
size
()
>
0
)
{
FlatQueryTaskCondition
condition
=
null
;
...
...
@@ -548,12 +550,20 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
break
;
}
// IF OVER
}
// FOR OVER
Connection
connection
=
HiveHelper
.
getDownloadHiveConnection
();
connection
=
HiveHelper
.
getDownloadHiveConnection
();
takeFile
(
condition
,
connection
);
}
// 没有任务则忽略
}
catch
(
Exception
e
){
log
.
debug
(
"自助指标下载异常"
,
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
if
(
connection
!=
null
){
try
{
connection
.
close
();
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
}
},
interval
*
1000
,
interval
*
1000
,
TimeUnit
.
MILLISECONDS
);
...
...
@@ -570,6 +580,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
this
.
balaDownloadService
.
scheduleAtFixedRate
(
new
Runnable
()
{
@Override
public
void
run
()
{
Connection
connection
=
null
;
try
{
if
(
taskConditions
!=
null
&&
taskConditions
.
size
()
>
0
)
{
FlatQueryTaskCondition
condition
=
null
;
...
...
@@ -582,12 +593,20 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
break
;
}
// IF OVER
}
// FOR OVER
Connection
connection
=
HiveHelper
.
getBalaDownloadHiveConnection
();
connection
=
HiveHelper
.
getBalaDownloadHiveConnection
();
takeFile
(
condition
,
connection
);
}
// 没有任务则忽略
}
catch
(
Exception
e
){
log
.
debug
(
"自助指标下载异常"
,
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
if
(
connection
!=
null
){
try
{
connection
.
close
();
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
}
},
interval
*
1000
,
interval
*
1000
,
TimeUnit
.
MILLISECONDS
);
...
...
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