mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-04 09:59:55 +08:00
线程池命名错误
This commit is contained in:
@@ -38,7 +38,7 @@ public class ShardingThreadPool {
|
|||||||
|
|
||||||
private HashFunction hashFunction;
|
private HashFunction hashFunction;
|
||||||
|
|
||||||
private final Map<Integer, ExecutorService> EXECUTOR_SERVICE_MAP = new ConcurrentHashMap<>(8);
|
private final Map<Integer, ExecutorService> executorServiceMap = new ConcurrentHashMap<>(8);
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
@@ -47,7 +47,7 @@ public class ShardingThreadPool {
|
|||||||
|
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
for (ExecutorService executorService : EXECUTOR_SERVICE_MAP.values()) {
|
for (ExecutorService executorService : executorServiceMap.values()) {
|
||||||
executorService.shutdownNow();
|
executorService.shutdownNow();
|
||||||
log.info("Sharding Thread [{}] Shutdown completed.", executorService);
|
log.info("Sharding Thread [{}] Shutdown completed.", executorService);
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ public class ShardingThreadPool {
|
|||||||
|
|
||||||
@Scheduled(fixedDelayString = "${thread-pool.sharding.stats-print-interval-ms:10000}")
|
@Scheduled(fixedDelayString = "${thread-pool.sharding.stats-print-interval-ms:10000}")
|
||||||
public void printStats() {
|
public void printStats() {
|
||||||
EXECUTOR_SERVICE_MAP.forEach((k, v) -> {
|
executorServiceMap.forEach((k, v) -> {
|
||||||
|
|
||||||
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) v;
|
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) v;
|
||||||
|
|
||||||
@@ -78,8 +78,8 @@ public class ShardingThreadPool {
|
|||||||
public void execute(UUID hashKey, TracerRunnable runnable) {
|
public void execute(UUID hashKey, TracerRunnable runnable) {
|
||||||
int partition = hash(hashFunction, hashKey);
|
int partition = hash(hashFunction, hashKey);
|
||||||
|
|
||||||
EXECUTOR_SERVICE_MAP.computeIfAbsent(partition % parallelism,
|
executorServiceMap.computeIfAbsent(Math.abs(partition % parallelism),
|
||||||
p -> Executors.newFixedThreadPool(1, JCPPThreadFactory.forName("sharding-threads-%d" + p)))
|
p -> Executors.newFixedThreadPool(1, JCPPThreadFactory.forName("sharding-threads-" + p)))
|
||||||
.execute(runnable);
|
.execute(runnable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public class YunKuaiChongV15ProtocolMessageProcessor extends ProtocolMessageProc
|
|||||||
int seqNo = in.readUnsignedShortLE();
|
int seqNo = in.readUnsignedShortLE();
|
||||||
|
|
||||||
// 加密标志
|
// 加密标志
|
||||||
int encrpyFlag = in.readUnsignedByte();
|
int encryptFlag = in.readUnsignedByte();
|
||||||
|
|
||||||
// 帧类型标志
|
// 帧类型标志
|
||||||
int frameType = in.readUnsignedByte();
|
int frameType = in.readUnsignedByte();
|
||||||
@@ -154,7 +154,7 @@ public class YunKuaiChongV15ProtocolMessageProcessor extends ProtocolMessageProc
|
|||||||
message.setHead(startFlag);
|
message.setHead(startFlag);
|
||||||
message.setDataLength(dataLength);
|
message.setDataLength(dataLength);
|
||||||
message.setSequenceNumber(seqNo);
|
message.setSequenceNumber(seqNo);
|
||||||
message.setEncryptionFlag(encrpyFlag);
|
message.setEncryptionFlag(encryptFlag);
|
||||||
message.setCmd(frameType);
|
message.setCmd(frameType);
|
||||||
message.setMsgBody(msgBody);
|
message.setMsgBody(msgBody);
|
||||||
message.setCheckSum(checkSum);
|
message.setCheckSum(checkSum);
|
||||||
|
|||||||
Reference in New Issue
Block a user