Skip to content

Commit 6b193be

Browse files
committed
apply spotless add comment
Signed-off-by: Brian Flores <iflorbri@amazon.com>
1 parent 95ecd22 commit 6b193be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,16 @@ private void undeployModels(
202202
*/
203203
boolean modelNotFoundInNodesCache = response.getNodes().stream().allMatch(nodeResponse -> {
204204
Map<String, String> status = nodeResponse.getModelUndeployStatus();
205-
if (status == null) return false;
206-
boolean modelCacheMissForModelIds = Arrays.stream(modelIds).allMatch(modelId -> {
205+
if (status == null)
206+
return false;
207+
// Stream is used to catch all models edge case but only one is ever undeployed
208+
boolean modelCacheMissForModelIds = Arrays.stream(modelIds).allMatch(modelId -> {
207209
String modelStatus = status.get(modelId);
208210
return modelStatus != null && modelStatus.equalsIgnoreCase(NOT_FOUND);
209211
});
210212

211213
return modelCacheMissForModelIds;
212-
} );
214+
});
213215
if (response.getNodes().isEmpty() || modelNotFoundInNodesCache) {
214216
bulkSetModelIndexToUndeploy(modelIds, listener, response);
215217
return;

0 commit comments

Comments
 (0)