Skip to content

Commit e649ffb

Browse files
committed
tidy up
1 parent 26e32bb commit e649ffb

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/AdaptiveAllocationsScaleFromZeroIT.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ public void onFailure(Exception exception) {
9696
if (failures.isEmpty() == false) {
9797
fail(failures.getFirst());
9898
}
99-
100-
// {
101-
// var responseMap = entityAsMap(getTrainedModelStats(modelId));
102-
// List<Map<String, Object>> stats = (List<Map<String, Object>>) responseMap.get("trained_model_stats");
103-
// String statusState = (String) XContentMapValues.extractValue("deployment_stats.allocation_status.state", stats.get(0));
104-
// assertThat(responseMap.toString(), statusState, is(not(nullValue())));
105-
// Integer count = (Integer) XContentMapValues.extractValue("deployment_stats.allocation_status.allocation_count", stats.get(0));
106-
// assertThat(responseMap.toString(), count, greaterThan(0));
107-
// }
10899
}
109100

110101
@SuppressWarnings("unchecked")
@@ -136,7 +127,7 @@ public void testMultipleDeploymentsWaiting() throws Exception {
136127
}, 30, TimeUnit.SECONDS);
137128

138129
// infer will scale up
139-
int inferenceCount = 100;
130+
int inferenceCount = 10;
140131
var latch = new CountDownLatch(inferenceCount);
141132
for (int i = 0; i < inferenceCount; i++) {
142133
asyncInfer("Auto scale and infer", randomFrom(idsList), TimeValue.timeValueSeconds(5), new ResponseListener() {

x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelRestTestCase.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@
1212
import org.elasticsearch.client.Response;
1313
import org.elasticsearch.client.ResponseListener;
1414
import org.elasticsearch.common.Strings;
15-
import org.elasticsearch.common.collect.Iterators;
1615
import org.elasticsearch.common.settings.Settings;
1716
import org.elasticsearch.common.util.concurrent.ThreadContext;
18-
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;
19-
import org.elasticsearch.common.xcontent.ChunkedToXContentObject;
2017
import org.elasticsearch.common.xcontent.support.XContentMapValues;
2118
import org.elasticsearch.core.TimeValue;
2219
import org.elasticsearch.test.SecuritySettingsSourceField;
@@ -299,12 +296,6 @@ protected Response startDeployment(String modelId, String deploymentId, Adaptive
299296
+ "&threads_per_allocation=1"
300297
+ "&wait_for=started";
301298

302-
ChunkedToXContentObject innerChunkedContent = params -> Iterators.concat(
303-
ChunkedToXContentHelper.startObject(),
304-
Iterators.single(((builder, p2) -> builder.field("adaptive_allocations", adaptiveAllocationsSettings))),
305-
ChunkedToXContentHelper.endObject()
306-
);
307-
308299
XContentBuilder builder = JsonXContent.contentBuilder();
309300
builder.startObject();
310301
builder.field("adaptive_allocations", adaptiveAllocationsSettings);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInternalInferModelAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ private void inferAgainstAllocatedModel(
293293

294294
assert nodes.stream().mapToInt(Tuple::v2).sum() == request.numberOfDocuments()
295295
: "mismatch; sum of node requests does not match number of documents in request";
296+
inferOnAssignmentNodes(nodes, request, responseBuilder, parentTaskId, listener);
296297
}
297298

298299
private void inferOnBlockedRequest(InferenceWaitForAllocation.WaitingRequest request, TrainedModelAssignment assignment) {

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/InferenceWaitForAllocation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ public synchronized void waitForAssignment(WaitingRequest request) {
9797
}
9898

9999
pendingRequestCount.incrementAndGet();
100-
var prediate = new DeploymentHasAtLeastOneAllocation(request.deploymentId());
100+
var predicate = new DeploymentHasAtLeastOneAllocation(request.deploymentId());
101101

102102
assignmentService.waitForAssignmentCondition(
103103
request.deploymentId(),
104-
prediate,
104+
predicate,
105105
request.request().getInferenceTimeout(),
106-
new WaitingListener(request.deploymentId(), request, prediate)
106+
new WaitingListener(request.deploymentId(), request, predicate)
107107
);
108108
}
109109

0 commit comments

Comments
 (0)