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
82add547
Commit
82add547
authored
Apr 07, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 限制执行building个数
parent
06490cc2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletions
+34
-1
DownloadTaskDao.java
.../com/gic/cloud/data/hook/service/dao/DownloadTaskDao.java
+5
-0
DownloadTaskServiceImpl.java
...cloud/data/hook/service/impl/DownloadTaskServiceImpl.java
+7
-0
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+10
-1
DownloadTaskDao.xml
...ook-service/src/main/resources/mapper/DownloadTaskDao.xml
+12
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/dao/DownloadTaskDao.java
View file @
82add547
...
@@ -71,4 +71,9 @@ public interface DownloadTaskDao {
...
@@ -71,4 +71,9 @@ public interface DownloadTaskDao {
int
updateTaskStatusError
(
@Param
(
"idList"
)
List
<
String
>
idList
);
int
updateTaskStatusError
(
@Param
(
"idList"
)
List
<
String
>
idList
);
/** 获取等待申请通过状态的任务
* @return
*/
public
int
getCountDownloadTaskOfBuilding
(
@Param
(
"queryDataSource"
)
String
queryDataSource
);
}
}
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/DownloadTaskServiceImpl.java
View file @
82add547
...
@@ -235,6 +235,13 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
...
@@ -235,6 +235,13 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
return
downloadTaskDao
.
getDownloadTaskOfHasDownload
(
queryDataSource
,
num
);
return
downloadTaskDao
.
getDownloadTaskOfHasDownload
(
queryDataSource
,
num
);
}
}
/** 获取在审核申请等待状态中的任务
* @return
*/
public
int
getCountDownloadTaskOfBuilding
(
String
queryDataSource
)
{
return
downloadTaskDao
.
getCountDownloadTaskOfBuilding
(
queryDataSource
);
}
/** 获取指定申请编号的风险模式记录
/** 获取指定申请编号的风险模式记录
* @param applyId
* @param applyId
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
82add547
...
@@ -682,8 +682,17 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
...
@@ -682,8 +682,17 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
providerLocalTag
.
traceId
=
traceId
;
providerLocalTag
.
traceId
=
traceId
;
logger
.
info
(
"执行hivefile"
);
logger
.
info
(
"执行hivefile"
);
try
{
try
{
String
lockKey
=
"data:hook:hive"
;
String
lockKey
=
"data:hook:hive"
;
RedisUtil
.
lock
(
lockKey
,
2L
);
RedisUtil
.
lock
(
lockKey
,
3L
);
int
curBuildingCount
=
DownloadTaskServiceImpl
.
getInstance
().
getCountDownloadTaskOfBuilding
(
QueryDataSource
.
FLAT_QUERY
);
Config
appConfig
=
ConfigService
.
getAppConfig
();
Integer
maxBuildingCount
=
appConfig
.
getIntProperty
(
"buildingCount"
,
5
);
if
(
maxBuildingCount
<=
curBuildingCount
)
{
RedisUtil
.
unlock
(
lockKey
);
return
;
}
List
<
DownloadTask
>
downloadTasks
=
DownloadTaskServiceImpl
.
getInstance
().
getDownloadTaskOfHasDownload
(
QueryDataSource
.
FLAT_QUERY
,
10
);
List
<
DownloadTask
>
downloadTasks
=
DownloadTaskServiceImpl
.
getInstance
().
getDownloadTaskOfHasDownload
(
QueryDataSource
.
FLAT_QUERY
,
10
);
if
(
CollectionUtils
.
isNotEmpty
(
downloadTasks
))
{
if
(
CollectionUtils
.
isNotEmpty
(
downloadTasks
))
{
for
(
DownloadTask
downloadTask
:
downloadTasks
)
{
for
(
DownloadTask
downloadTask
:
downloadTasks
)
{
...
...
gic-cloud-data-hook-service/src/main/resources/mapper/DownloadTaskDao.xml
View file @
82add547
...
@@ -220,4 +220,15 @@
...
@@ -220,4 +220,15 @@
</foreach>
</foreach>
</update>
</update>
<select
id=
"getCountDownloadTaskOfBuilding"
resultType=
"int"
>
SELECT count(*)
FROM
<include
refid=
"queryTables"
/>
<include
refid=
"queryJoins"
/>
WHERE
q.query_data_source = #{queryDataSource}
AND q.status = "building"
AND q.del_flag = '0'
</select>
</mapper>
</mapper>
\ 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