feat: remove shade & ready to release

This commit is contained in:
“tjq” 2020-10-18 22:49:14 +08:00
parent 287e539dcd
commit 755e056143
3 changed files with 17 additions and 16 deletions

View File

@ -35,12 +35,6 @@
<groupId>com.github.kfcfans</groupId> <groupId>com.github.kfcfans</groupId>
<artifactId>powerjob-common</artifactId> <artifactId>powerjob-common</artifactId>
<version>${powerjob.common.version}</version> <version>${powerjob.common.version}</version>
<exclusions>
<exclusion>
<groupId>com.typesafe.akka</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- Junit 测试 --> <!-- Junit 测试 -->
@ -54,6 +48,8 @@
<build> <build>
<plugins> <plugins>
<!-- 暂时放弃 shade打 shade 包一定要非常干净,否则是更大的坑 -->
<!--
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
@ -92,6 +88,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
-->
</plugins> </plugins>
</build> </build>

View File

@ -30,22 +30,26 @@ public class ProcessorTrackerStatusHolder {
}); });
} }
/**
* 根据地址获取 ProcessorTracker 的状态
* @param address IP:Port
* @return status
*/
public ProcessorTrackerStatus getProcessorTrackerStatus(String address) { 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 的心跳更新状态 * 根据 ProcessorTracker 的心跳更新状态
*/ */
public void updateStatus(ProcessorTrackerStatusReportReq heartbeatReq) { public void updateStatus(ProcessorTrackerStatusReportReq heartbeatReq) {
// remove 前突然收到了 PT 心跳同时立即被派发才可能出现这种情况0.001% 概率 getProcessorTrackerStatus(heartbeatReq.getAddress()).update(heartbeatReq);
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);
} }
/** /**

View File

@ -65,7 +65,7 @@ public class ProcessorTracker {
private static final int THREAD_POOL_QUEUE_MAX_SIZE = 128; private static final int THREAD_POOL_QUEUE_MAX_SIZE = 128;
// 长时间空闲的 ProcessorTracker 会发起销毁请求 // 长时间空闲的 ProcessorTracker 会发起销毁请求
private static final long MAX_IDLE_TIME = 300000; private static final long MAX_IDLE_TIME = 120000;
// ProcessorTracker 出现根本性错误比如 Processor 创建失败所有的任务直接失败 // ProcessorTracker 出现根本性错误比如 Processor 创建失败所有的任务直接失败
private boolean lethal = false; private boolean lethal = false;