Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
57abd14b
authored
Jul 25, 2016
by
xueli.xue
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
重要更新: ByteWriteFactory内部Byte[]长度改为动态初始化; 一方面在小数据量下节省字节开销;另一方面在大数据量下可以保证数据存放没问题;
parent
f48ac05c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
xxl-job-core/src/main/java/com/xxl/job/core/util/ByteWriteFactory.java
xxl-job-core/src/main/java/com/xxl/job/core/util/XxlJobNetCommUtil.java
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
View file @
57abd14b
...
@@ -108,10 +108,10 @@ public class JobLogController {
...
@@ -108,10 +108,10 @@ public class JobLogController {
// base check
// base check
XxlJobLog
log
=
xxlJobLogDao
.
load
(
id
);
XxlJobLog
log
=
xxlJobLogDao
.
load
(
id
);
if
(
log
==
null
)
{
if
(
log
==
null
)
{
return
new
ReturnT
<
String
>(
500
,
"参数异常"
);
return
new
ReturnT
<
String
>(
500
,
"
查看执行日志失败:
参数异常"
);
}
}
if
(!(
ResponseModel
.
SUCCESS
.
equals
(
log
.
getTriggerStatus
())
||
StringUtils
.
isNotBlank
(
log
.
getHandleStatus
())))
{
if
(!(
ResponseModel
.
SUCCESS
.
equals
(
log
.
getTriggerStatus
())
||
StringUtils
.
isNotBlank
(
log
.
getHandleStatus
())))
{
return
new
ReturnT
<
String
>(
500
,
"调度失败,无法查看执行日志"
);
return
new
ReturnT
<
String
>(
500
,
"
查看执行日志失败: 任务发起
调度失败,无法查看执行日志"
);
}
}
// trigger id, trigger time
// trigger id, trigger time
...
@@ -125,7 +125,7 @@ public class JobLogController {
...
@@ -125,7 +125,7 @@ public class JobLogController {
if
(
ResponseModel
.
SUCCESS
.
equals
(
responseModel
.
getStatus
()))
{
if
(
ResponseModel
.
SUCCESS
.
equals
(
responseModel
.
getStatus
()))
{
return
new
ReturnT
<
String
>(
responseModel
.
getMsg
());
return
new
ReturnT
<
String
>(
responseModel
.
getMsg
());
}
else
{
}
else
{
return
new
ReturnT
<
String
>(
500
,
responseModel
.
getMsg
());
return
new
ReturnT
<
String
>(
500
,
"查看执行日志失败: "
+
responseModel
.
getMsg
());
}
}
}
}
...
...
xxl-job-core/src/main/java/com/xxl/job/core/util/ByteWriteFactory.java
View file @
57abd14b
...
@@ -16,6 +16,9 @@ public class ByteWriteFactory {
...
@@ -16,6 +16,9 @@ public class ByteWriteFactory {
public
ByteWriteFactory
()
{
public
ByteWriteFactory
()
{
m_byteBuf
=
ByteBuffer
.
allocate
(
1024
*
4
);
m_byteBuf
=
ByteBuffer
.
allocate
(
1024
*
4
);
}
}
public
ByteWriteFactory
(
int
capacity
)
{
m_byteBuf
=
ByteBuffer
.
allocate
(
capacity
);
}
public
void
writeInt
(
int
intValue
)
{
public
void
writeInt
(
int
intValue
)
{
byte
[]
intBytes
=
new
byte
[
4
];
byte
[]
intBytes
=
new
byte
[
4
];
...
...
xxl-job-core/src/main/java/com/xxl/job/core/util/XxlJobNetCommUtil.java
View file @
57abd14b
...
@@ -42,7 +42,7 @@ public class XxlJobNetCommUtil {
...
@@ -42,7 +42,7 @@ public class XxlJobNetCommUtil {
int
len
=
ByteHexConverter
.
getByteLen
(
json
);
int
len
=
ByteHexConverter
.
getByteLen
(
json
);
// json to byte[]
// json to byte[]
ByteWriteFactory
byteWriteFactory
=
new
ByteWriteFactory
();
ByteWriteFactory
byteWriteFactory
=
new
ByteWriteFactory
(
4
+
len
);
byteWriteFactory
.
writeInt
(
len
);
byteWriteFactory
.
writeInt
(
len
);
byteWriteFactory
.
writeString
(
json
,
len
);
byteWriteFactory
.
writeString
(
json
,
len
);
byte
[]
bytes
=
byteWriteFactory
.
getBytes
();
byte
[]
bytes
=
byteWriteFactory
.
getBytes
();
...
...
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