Change thread pool reject count name.

pull/161/head
chen.ma 3 years ago
parent d148789f45
commit 4c90c76fa3

@ -83,7 +83,7 @@ public class PoolRunStateInfo implements Serializable {
/**
*
*/
private Integer regectCount;
private Integer rejectCount;
/**
* Host

@ -76,10 +76,10 @@ public class ThreadPoolRunStateHandler {
stateInfo.setHost(addr.getHostAddress());
stateInfo.setTpId(tpId);
int regectCount = pool instanceof CustomThreadPoolExecutor
? ((CustomThreadPoolExecutor) pool).getRegectCount()
int rejectCount = pool instanceof CustomThreadPoolExecutor
? ((CustomThreadPoolExecutor) pool).getRejectCount()
: -1;
stateInfo.setRegectCount(regectCount);
stateInfo.setRejectCount(rejectCount);
return stateInfo;
}

@ -23,7 +23,7 @@ import static com.github.dynamic.threadpool.common.constant.Constants.MAP_INITIA
*/
public final class CustomThreadPoolExecutor extends ThreadPoolExecutor {
private final AtomicInteger regectCount = new AtomicInteger();
private final AtomicInteger rejectCount = new AtomicInteger();
private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));
private static final int COUNT_BITS = Integer.SIZE - 3;
@ -143,8 +143,8 @@ public final class CustomThreadPoolExecutor extends ThreadPoolExecutor {
} while (!compareAndDecrementWorkerCount(ctl.get()));
}
public Integer getRegectCount() {
return regectCount.get();
public Integer getRejectCount() {
return rejectCount.get();
}
private final class Worker
@ -315,7 +315,7 @@ public final class CustomThreadPoolExecutor extends ThreadPoolExecutor {
private static final boolean ONLY_ONE = true;
final void reject(Runnable command) {
regectCount.incrementAndGet();
rejectCount.incrementAndGet();
handler.rejectedExecution(command, this);
}

Loading…
Cancel
Save