File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ static GetDeploymentStatsAction.Response addFailedRoutes(
231231 }
232232 }
233233
234- updatedNodeStats .sort (Comparator .comparing (n -> n .getNode () != null ? n . getNode (). getId () : "" ));
234+ updatedNodeStats .sort (Comparator .comparing (n -> n .getNode (). getId ()));
235235 updatedAssignmentStats .add (
236236 new AssignmentStats (
237237 stat .getDeploymentId (),
@@ -261,16 +261,18 @@ static GetDeploymentStatsAction.Response addFailedRoutes(
261261 List <AssignmentStats .NodeStats > nodeStats = new ArrayList <>();
262262
263263 for (var routingEntry : nonStartedEntries .getValue ().entrySet ()) {
264- nodeStats .add (
265- AssignmentStats .NodeStats .forNotStartedState (
266- nodes .get (routingEntry .getKey ()),
267- routingEntry .getValue ().getState (),
268- routingEntry .getValue ().getReason ()
269- )
270- );
264+ if (nodes .nodeExists (routingEntry .getKey ())) {
265+ nodeStats .add (
266+ AssignmentStats .NodeStats .forNotStartedState (
267+ nodes .get (routingEntry .getKey ()),
268+ routingEntry .getValue ().getState (),
269+ routingEntry .getValue ().getReason ()
270+ )
271+ );
272+ }
271273 }
272274
273- nodeStats .sort (Comparator .comparing (n -> n .getNode () != null ? n . getNode (). getId () : "" ));
275+ nodeStats .sort (Comparator .comparing (n -> n .getNode (). getId ()));
274276
275277 updatedAssignmentStats .add (
276278 new AssignmentStats (
You can’t perform that action at this time.
0 commit comments