Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKerouac committed Nov 14, 2024
1 parent b512532 commit 2f2f53e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@

<!-- 禁止单个文件中重复出现多个相同的字符串(这里定义的是最多出现两次),如果多次出现,应该将其定义为常量然后引用;(默认不检查注解中使用的字符串) -->
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="2"/>
<property name="allowedDuplicates" value="3"/>
<!-- 忽略! = @ # $ % ^ & * , . ? 等常用的单个字符 -->
<property name="ignoreStringsRegexp"
value='^(("\!")|("=")|("@")|("#")|("$")|("%")|("\^")|("&amp;")|("\*")|("\,")|("\.")|("\?")|(""))$'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@ default boolean notifyTask(String requestId) {
*/
boolean notifyTask(String requestId, TransStrategy transStrategy);

/**
* 批量唤醒任务,如果任务处于{@link ExecStatus#WAIT}状态,则任务被唤醒,切换到{@link ExecStatus#READY}状态;
*
* @param requestIdSet
* 任务request id集合
* @return 唤醒成功的任务request id集合,其他任务可能因为状态不是wait、任务不存在等导致不会被唤醒
*/
default Set<String> notifyTask(Set<String> requestIdSet) {
return notifyTask(requestIdSet, TransStrategy.REQUIRED);
}

/**
* 批量唤醒任务,如果任务处于{@link ExecStatus#WAIT}状态,则任务被唤醒,切换到{@link ExecStatus#READY}状态;
*
Expand Down Expand Up @@ -211,6 +222,17 @@ default CancelStatus cancelTask(String requestId) {
*/
CancelStatus cancelTask(String requestId, TransStrategy transStrategy);

/**
* 批量取消任务
*
* @param requestIdSet
* 要取消的任务requestId
* @return 取消结果
*/
default Map<String, CancelStatus> cancelTask(Set<String> requestIdSet) {
return cancelTask(requestIdSet, TransStrategy.REQUIRED);
}

/**
* 批量取消任务
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ default boolean notifyNode(String requestId) {
*/
boolean notifyNode(String requestId, TransStrategy transStrategy);

/**
* 批量唤醒任务,如果任务处于{@link ExecStatus#WAIT}状态,则任务被唤醒,切换到{@link ExecStatus#READY}状态;
*
* @param requestIdSet
* 任务request id集合
* @return 唤醒成功的任务request id集合,其他任务可能因为状态不是wait、任务不存在等导致不会被唤醒
*/
default Set<String> notifyNode(Set<String> requestIdSet) {
return notifyNode(requestIdSet, TransStrategy.REQUIRED);
}

/**
* 批量唤醒任务,如果任务处于{@link ExecStatus#WAIT}状态,则任务被唤醒,切换到{@link ExecStatus#READY}状态;
*
Expand Down

0 comments on commit 2f2f53e

Please sign in to comment.