fix(forest): 修复 forest 框架判断 null 值错误

forest 创建代理之后调用 hashcode 方法会导致死循环,调用 equals 方法会导致空指针错误
This commit is contained in:
2023-05-31 23:33:53 +08:00
parent 8bfb274dde
commit 156ddf8033

View File

@@ -6,6 +6,7 @@ import com.eshore.odcp.hudi.connector.Constants;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnApplication;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Function;
@@ -95,8 +96,9 @@ public class YarnClusterService {
if (ObjectUtil.isEmpty(clusters)) {
return Lists.immutable.empty();
}
return clusters.collect(this::service)
.reject(ObjectUtil::isNull)
return clusters.toList()
.collect(this::service)
.reject(Objects::isNull)
.asParallel(EXECUTOR, 1)
.flatCollect(getter::apply)
.toList()
@@ -115,7 +117,7 @@ public class YarnClusterService {
public ImmutableList<YarnQueue> queueList(ImmutableSet<String> clusters) {
//noinspection DataFlowIssue
return clusters
return clusters.toList()
.select(servicesMap::containsKey)
.asParallel(EXECUTOR, 1)
.flatCollect(cluster -> service(cluster).queueList())
@@ -130,7 +132,7 @@ public class YarnClusterService {
public ImmutableList<YarnQueue> queueDetail(ImmutableSet<String> clusters, String name) {
//noinspection DataFlowIssue
return clusters
return clusters.toList()
.select(servicesMap::containsKey)
.asParallel(EXECUTOR, 1)
.collect(cluster -> service(cluster).queueDetail(name))
@@ -145,7 +147,7 @@ public class YarnClusterService {
public ImmutableList<YarnRootQueue> cluster(ImmutableSet<String> clusters) {
//noinspection DataFlowIssue
return clusters
return clusters.toList()
.select(servicesMap::containsKey)
.asParallel(EXECUTOR, 1)
.collect(cluster -> service(cluster).cluster())