fix(forest): 修复 forest 框架判断 null 值错误
forest 创建代理之后调用 hashcode 方法会导致死循环,调用 equals 方法会导致空指针错误
This commit is contained in:
@@ -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.YarnApplication;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -95,8 +96,9 @@ public class YarnClusterService {
|
|||||||
if (ObjectUtil.isEmpty(clusters)) {
|
if (ObjectUtil.isEmpty(clusters)) {
|
||||||
return Lists.immutable.empty();
|
return Lists.immutable.empty();
|
||||||
}
|
}
|
||||||
return clusters.collect(this::service)
|
return clusters.toList()
|
||||||
.reject(ObjectUtil::isNull)
|
.collect(this::service)
|
||||||
|
.reject(Objects::isNull)
|
||||||
.asParallel(EXECUTOR, 1)
|
.asParallel(EXECUTOR, 1)
|
||||||
.flatCollect(getter::apply)
|
.flatCollect(getter::apply)
|
||||||
.toList()
|
.toList()
|
||||||
@@ -115,7 +117,7 @@ public class YarnClusterService {
|
|||||||
|
|
||||||
public ImmutableList<YarnQueue> queueList(ImmutableSet<String> clusters) {
|
public ImmutableList<YarnQueue> queueList(ImmutableSet<String> clusters) {
|
||||||
//noinspection DataFlowIssue
|
//noinspection DataFlowIssue
|
||||||
return clusters
|
return clusters.toList()
|
||||||
.select(servicesMap::containsKey)
|
.select(servicesMap::containsKey)
|
||||||
.asParallel(EXECUTOR, 1)
|
.asParallel(EXECUTOR, 1)
|
||||||
.flatCollect(cluster -> service(cluster).queueList())
|
.flatCollect(cluster -> service(cluster).queueList())
|
||||||
@@ -130,7 +132,7 @@ public class YarnClusterService {
|
|||||||
|
|
||||||
public ImmutableList<YarnQueue> queueDetail(ImmutableSet<String> clusters, String name) {
|
public ImmutableList<YarnQueue> queueDetail(ImmutableSet<String> clusters, String name) {
|
||||||
//noinspection DataFlowIssue
|
//noinspection DataFlowIssue
|
||||||
return clusters
|
return clusters.toList()
|
||||||
.select(servicesMap::containsKey)
|
.select(servicesMap::containsKey)
|
||||||
.asParallel(EXECUTOR, 1)
|
.asParallel(EXECUTOR, 1)
|
||||||
.collect(cluster -> service(cluster).queueDetail(name))
|
.collect(cluster -> service(cluster).queueDetail(name))
|
||||||
@@ -145,7 +147,7 @@ public class YarnClusterService {
|
|||||||
|
|
||||||
public ImmutableList<YarnRootQueue> cluster(ImmutableSet<String> clusters) {
|
public ImmutableList<YarnRootQueue> cluster(ImmutableSet<String> clusters) {
|
||||||
//noinspection DataFlowIssue
|
//noinspection DataFlowIssue
|
||||||
return clusters
|
return clusters.toList()
|
||||||
.select(servicesMap::containsKey)
|
.select(servicesMap::containsKey)
|
||||||
.asParallel(EXECUTOR, 1)
|
.asParallel(EXECUTOR, 1)
|
||||||
.collect(cluster -> service(cluster).cluster())
|
.collect(cluster -> service(cluster).cluster())
|
||||||
|
|||||||
Reference in New Issue
Block a user