mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: remove shade & ready to release
This commit is contained in:
parent
287e539dcd
commit
755e056143
@ -35,12 +35,6 @@
|
||||
<groupId>com.github.kfcfans</groupId>
|
||||
<artifactId>powerjob-common</artifactId>
|
||||
<version>${powerjob.common.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.typesafe.akka</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Junit 测试 -->
|
||||
@ -54,6 +48,8 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 暂时放弃 shade,打 shade 包一定要非常干净,否则是更大的坑 -->
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@ -92,6 +88,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
@ -30,22 +30,26 @@ public class ProcessorTrackerStatusHolder {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据地址获取 ProcessorTracker 的状态
|
||||
* @param address IP:Port
|
||||
* @return status
|
||||
*/
|
||||
public ProcessorTrackerStatus getProcessorTrackerStatus(String address) {
|
||||
return address2Status.get(address);
|
||||
// remove 前突然收到了 PT 心跳同时立即被派发才可能出现这种情况,0.001% 概率
|
||||
return address2Status.computeIfAbsent(address, ignore -> {
|
||||
log.warn("[ProcessorTrackerStatusHolder] unregistered worker: {}", address);
|
||||
ProcessorTrackerStatus processorTrackerStatus = new ProcessorTrackerStatus();
|
||||
processorTrackerStatus.init(address);
|
||||
return processorTrackerStatus;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 ProcessorTracker 的心跳更新状态
|
||||
*/
|
||||
public void updateStatus(ProcessorTrackerStatusReportReq heartbeatReq) {
|
||||
// remove 前突然收到了 PT 心跳同时立即被派发才可能出现这种情况,0.001% 概率
|
||||
ProcessorTrackerStatus pts = address2Status.computeIfAbsent(heartbeatReq.getAddress(), ignore-> {
|
||||
log.warn("[ProcessorTrackerStatusHolder] unregistered worker's heartbeat request: {}", heartbeatReq);
|
||||
ProcessorTrackerStatus processorTrackerStatus = new ProcessorTrackerStatus();
|
||||
processorTrackerStatus.init(heartbeatReq.getAddress());
|
||||
return processorTrackerStatus;
|
||||
});
|
||||
pts.update(heartbeatReq);
|
||||
getProcessorTrackerStatus(heartbeatReq.getAddress()).update(heartbeatReq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public class ProcessorTracker {
|
||||
|
||||
private static final int THREAD_POOL_QUEUE_MAX_SIZE = 128;
|
||||
// 长时间空闲的 ProcessorTracker 会发起销毁请求
|
||||
private static final long MAX_IDLE_TIME = 300000;
|
||||
private static final long MAX_IDLE_TIME = 120000;
|
||||
|
||||
// 当 ProcessorTracker 出现根本性错误(比如 Processor 创建失败,所有的任务直接失败)
|
||||
private boolean lethal = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user