[Enhancement](job) No need to query some backends which are not alive. (#28608)

No need to execute some jobs if backend is not alive
This commit is contained in:
Xiangyu Wang
2023-12-22 13:14:30 +08:00
committed by GitHub
parent dc786114a2
commit fb52e111c5
2 changed files with 5 additions and 1 deletions

View File

@ -55,7 +55,8 @@ public class TabletStatMgr extends MasterDaemon {
ImmutableMap<Long, Backend> backends = Env.getCurrentSystemInfo().getIdToBackend();
long start = System.currentTimeMillis();
taskPool.submit(() -> {
backends.values().parallelStream().forEach(backend -> {
// no need to get tablet stat if backend is not alive
backends.values().stream().filter(Backend::isAlive).parallel().forEach(backend -> {
BackendService.Client client = null;
TNetworkAddress address = null;
boolean ok = false;

View File

@ -234,6 +234,9 @@ public class StreamLoadRecordMgr extends MasterDaemon {
int pullRecordSize = 0;
Map<Long, Long> beIdToLastStreamLoad = Maps.newHashMap();
for (Backend backend : backends.values()) {
if (!backend.isAlive()) {
continue;
}
BackendService.Client client = null;
TNetworkAddress address = null;
boolean ok = false;