File tree Expand file tree Collapse file tree 4 files changed +15
-18
lines changed
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml Expand file tree Collapse file tree 4 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 6464import org .elasticsearch .xpack .core .ml .utils .ExceptionsHelper ;
6565import org .elasticsearch .xpack .core .ml .utils .TransportVersionUtils ;
6666import org .elasticsearch .xpack .ml .MachineLearning ;
67- import org .elasticsearch .xpack .ml .inference .assignment .ModelDeploymentScaleUpException ;
67+ import org .elasticsearch .xpack .ml .inference .assignment .ModelDeploymentTimeoutException ;
6868import org .elasticsearch .xpack .ml .inference .assignment .TrainedModelAssignmentService ;
6969import org .elasticsearch .xpack .ml .inference .persistence .TrainedModelDefinitionDoc ;
7070import org .elasticsearch .xpack .ml .notifications .InferenceAuditor ;
@@ -351,14 +351,14 @@ public void onFailure(Exception e) {
351351 @ Override
352352 public void onTimeout (TimeValue timeout ) {
353353 onFailure (
354- new ModelDeploymentScaleUpException (
354+ new ModelDeploymentTimeoutException (
355355 format (
356356 "Timed out after [%s] waiting for trained model deployment [%s] to start. "
357- + "Please ensure the trained model deployment has started and try again." ,
357+ + "Use the trained model stats API to track the state of the deployment "
358+ + "and try again once it has started." ,
358359 request .getTimeout (),
359360 request .getDeploymentId ()
360- ),
361- RestStatus .REQUEST_TIMEOUT
361+ )
362362 )
363363 );
364364 }
Original file line number Diff line number Diff line change 2121import org .elasticsearch .xpack .core .ml .inference .assignment .TrainedModelAssignment ;
2222import org .elasticsearch .xpack .core .ml .inference .assignment .TrainedModelAssignmentMetadata ;
2323import org .elasticsearch .xpack .core .ml .utils .ExceptionsHelper ;
24- import org .elasticsearch .xpack .ml .inference .assignment .ModelDeploymentScaleUpException ;
24+ import org .elasticsearch .xpack .ml .inference .assignment .ModelDeploymentTimeoutException ;
2525import org .elasticsearch .xpack .ml .inference .assignment .TrainedModelAssignmentService ;
2626
2727import java .util .HashMap ;
@@ -194,14 +194,13 @@ public void onFailure(Exception e) {
194194 @ Override
195195 public void onTimeout (TimeValue timeout ) {
196196 onFailure (
197- new ModelDeploymentScaleUpException (
197+ new ModelDeploymentTimeoutException (
198198 format (
199199 "Timed out after [%s] waiting for trained model deployment [%s] to start. "
200- + "Please ensure the trained model deployment has started and try again." ,
200+ + "Use the trained model stats API to track the state of the deployment and try again once it has started ." ,
201201 timeout ,
202202 request .deploymentId ()
203- ),
204- RestStatus .REQUEST_TIMEOUT
203+ )
205204 )
206205 );
207206 }
Original file line number Diff line number Diff line change 1010import org .elasticsearch .ElasticsearchStatusException ;
1111import org .elasticsearch .rest .RestStatus ;
1212
13- public class ModelDeploymentScaleUpException extends ElasticsearchStatusException {
14- public ModelDeploymentScaleUpException (String message , RestStatus status ) {
15- super (message , status );
13+ public class ModelDeploymentTimeoutException extends ElasticsearchStatusException {
14+ public ModelDeploymentTimeoutException (String message ) {
15+ super (message , RestStatus . REQUEST_TIMEOUT );
1616 }
1717}
Original file line number Diff line number Diff line change 2424import org .elasticsearch .core .Nullable ;
2525import org .elasticsearch .core .TimeValue ;
2626import org .elasticsearch .node .NodeClosedException ;
27- import org .elasticsearch .rest .RestStatus ;
2827import org .elasticsearch .threadpool .ThreadPool ;
2928import org .elasticsearch .transport .ConnectTransportException ;
3029import org .elasticsearch .xpack .core .ml .action .CreateTrainedModelAssignmentAction ;
@@ -121,13 +120,12 @@ public void onTimeout(TimeValue timeout) {
121120 public interface WaitForAssignmentListener extends ActionListener <TrainedModelAssignment > {
122121 default void onTimeout (TimeValue timeout ) {
123122 onFailure (
124- new ModelDeploymentScaleUpException (
123+ new ModelDeploymentTimeoutException (
125124 format (
126125 "Timed out after [%s] waiting for trained model deployment to start. "
127- + "Please ensure the trained model deployment has started and try again." ,
126+ + "Use the trained model stats API to track the state of the deployment and try again once it has started ." ,
128127 timeout
129- ),
130- RestStatus .REQUEST_TIMEOUT
128+ )
131129 )
132130 );
133131 }
You can’t perform that action at this time.
0 commit comments