Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
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
liyuan
byit-myth-job
Commits
57104d46
Commit
57104d46
authored
Oct 13, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
执行节点监控
parent
63bcbcf5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
ApiNodeServiceImpl.java
...c/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
+2
-1
UnfinishedNodeMonitoringRunHelper.java
...byit/thread/helper/UnfinishedNodeMonitoringRunHelper.java
+4
-3
IDGenerationStrategy.java
...ore/src/main/java/com/byit/util/IDGenerationStrategy.java
+2
-3
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiNodeServiceImpl.java
View file @
57104d46
...
@@ -27,6 +27,7 @@ import com.byit.service.JobTaskRunLogService;
...
@@ -27,6 +27,7 @@ import com.byit.service.JobTaskRunLogService;
import
com.byit.task.JavaNodeExecutorTask
;
import
com.byit.task.JavaNodeExecutorTask
;
import
com.byit.task.JavaTaskJobTask
;
import
com.byit.task.JavaTaskJobTask
;
import
com.byit.task.ScriptExecutorJobTask
;
import
com.byit.task.ScriptExecutorJobTask
;
import
com.byit.util.IDGenerationStrategy
;
import
com.byit.utils.ValidationUtil
;
import
com.byit.utils.ValidationUtil
;
import
io.netty.util.TimerTask
;
import
io.netty.util.TimerTask
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -122,7 +123,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
...
@@ -122,7 +123,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
schedule
.
setLogId
(
logId
);
schedule
.
setLogId
(
logId
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"等待服务器分配资源"
).
build
();
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
"等待服务器分配资源"
).
build
();
String
runKey
=
"REAL:EXEC:"
+
logId
;
String
runKey
=
IDGenerationStrategy
.
keyGenerationStrategy
(
logId
)
;
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
TimerTask
timerTask
;
TimerTask
timerTask
;
if
(
NodeTypeEnum
.
JAVA
.
getCode
().
equals
(
runNode
.
getJobType
()))
{
if
(
NodeTypeEnum
.
JAVA
.
getCode
().
equals
(
runNode
.
getJobType
()))
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/UnfinishedNodeMonitoringRunHelper.java
View file @
57104d46
...
@@ -6,6 +6,7 @@ import com.byit.dto.plugin.RunLog;
...
@@ -6,6 +6,7 @@ import com.byit.dto.plugin.RunLog;
import
com.byit.model.JobTaskRunLog
;
import
com.byit.model.JobTaskRunLog
;
import
com.byit.service.JobTaskRunLogService
;
import
com.byit.service.JobTaskRunLogService
;
import
com.byit.thread.BaseThreadRunHelper
;
import
com.byit.thread.BaseThreadRunHelper
;
import
com.byit.util.IDGenerationStrategy
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -40,10 +41,10 @@ public class UnfinishedNodeMonitoringRunHelper extends BaseThreadRunHelper {
...
@@ -40,10 +41,10 @@ public class UnfinishedNodeMonitoringRunHelper extends BaseThreadRunHelper {
List
<
JobTaskRunLog
>
tempRunNodeList
=
jobTaskRunLogService
.
findTempRunNodeList
();
List
<
JobTaskRunLog
>
tempRunNodeList
=
jobTaskRunLogService
.
findTempRunNodeList
();
if
(
CollectionUtil
.
isNotEmpty
(
tempRunNodeList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
tempRunNodeList
))
{
tempRunNodeList
.
forEach
(
nodeLog
->
{
tempRunNodeList
.
forEach
(
nodeLog
->
{
log
.
debug
(
"-----节点{}未执行完毕-----"
,
nodeLog
);
log
.
debug
(
"-----节点{}未执行完毕-----"
,
nodeLog
);
String
runId
=
nodeLog
.
getRunId
(
);
String
keyGenerationStrategy
=
IDGenerationStrategy
.
keyGenerationStrategy
(
nodeLog
.
getLogId
()
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
PENG
).
build
();
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
false
).
runLog
(
PENG
).
build
();
stringRedisTemplate
.
opsForList
().
rightPush
(
runId
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
stringRedisTemplate
.
opsForList
().
rightPush
(
keyGenerationStrategy
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
});
});
}
}
return
5000L
;
return
5000L
;
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/util/IDGenerationStrategy.java
View file @
57104d46
...
@@ -22,8 +22,7 @@ public class IDGenerationStrategy {
...
@@ -22,8 +22,7 @@ public class IDGenerationStrategy {
return
runIdPre
;
return
runIdPre
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
String
keyGenerationStrategy
(
Integer
logId
){
System
.
out
.
println
(
runIdGenerationStrategy
(
88
));
return
"REAL:EXEC:"
+
logId
;
}
}
}
}
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