Skip to content

Commit

Permalink
[Enhancement](job) No need to query some backends which are not alive. (
Browse files Browse the repository at this point in the history
apache#28608)

No need to execute some jobs if backend is not alive
  • Loading branch information
dutyu authored and HappenLee committed Jan 12, 2024
1 parent eb6759f commit 5fd662a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ protected void runAfterCatalogReady() {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ protected void runAfterCatalogReady() {
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;
Expand Down

0 comments on commit 5fd662a

Please sign in to comment.