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
92551bc7
Commit
92551bc7
authored
Feb 21, 2020
by
guo_minglei@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回运行日志
parent
c42a09c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
MythJobProcess.java
...com/byit/executor/jobExecutor/process/MythJobProcess.java
+4
-9
No files found.
byit-myth-core/myth-executor-core/src/main/java/com/byit/executor/jobExecutor/process/MythJobProcess.java
View file @
92551bc7
...
...
@@ -12,7 +12,6 @@ import java.io.IOException;
import
java.io.InputStreamReader
;
import
java.lang.reflect.Field
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
...
...
@@ -56,7 +55,7 @@ public class MythJobProcess implements Runnable{
private
FileSystemContext
fileSystemContext
;
public
MythJobProcess
(
final
List
<
String
>
cmd
,
final
Map
<
String
,
String
>
env
,
final
String
workingDir
,
final
Integer
logId
,
FileSystemContext
fileSystemContext
)
{
final
String
workingDir
,
final
Integer
logId
)
{
this
.
cmd
=
cmd
;
this
.
env
=
env
;
this
.
workingDir
=
workingDir
;
...
...
@@ -64,13 +63,12 @@ public class MythJobProcess implements Runnable{
this
.
startupLatch
=
new
CountDownLatch
(
1
);
this
.
completeLatch
=
new
CountDownLatch
(
1
);
this
.
logId
=
logId
;
this
.
fileSystemContext
=
fileSystemContext
;
}
public
MythJobProcess
(
final
List
<
String
>
cmd
,
final
Map
<
String
,
String
>
env
,
final
String
workingDir
,
final
String
executeAsUserBinary
,
final
String
effectiveUser
,
Integer
logId
,
FileSystemContext
fileSystemContext
)
{
this
(
cmd
,
env
,
workingDir
,
logId
,
fileSystemContext
);
final
String
effectiveUser
,
Integer
logId
)
{
this
(
cmd
,
env
,
workingDir
,
logId
);
this
.
isExecuteAsUser
=
true
;
this
.
executeAsUserBinary
=
executeAsUserBinary
;
this
.
effectiveUser
=
effectiveUser
;
...
...
@@ -147,11 +145,8 @@ public class MythJobProcess implements Runnable{
if
(
this
.
process
.
isAlive
()){
this
.
process
.
destroy
();
}
String
logContent
=
outputGobbler
.
getRecentLog
()
+
"\n"
+
errorGobbler
.
getRecentLog
();
logFilePath
=
outputGobbler
.
getRecentLog
()
+
"\n"
+
errorGobbler
.
getRecentLog
();
//TODO 将日志写到fastdfs上
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>(
10
);
map
.
put
(
"filename"
,
logId
+
".log"
);
logFilePath
=
fileSystemContext
.
uploadFile
(
logContent
.
getBytes
(),
"log"
,
map
);
}
}
...
...
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