File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed
plugin/src/main/java/org/opensearch/ml Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 9
9
import static org .opensearch .ml .common .CommonValue .ML_MODEL_INDEX ;
10
10
import static org .opensearch .ml .settings .MLCommonsSettings .ML_COMMONS_TRUSTED_CONNECTOR_ENDPOINTS_REGEX ;
11
11
12
- import java .io .IOException ;
13
12
import java .time .Instant ;
14
13
import java .util .ArrayList ;
15
14
import java .util .Arrays ;
@@ -228,9 +227,8 @@ private void handleUpdateDataObjectCompletionStage(
228
227
updateListener .onFailure (cause );
229
228
} else {
230
229
try {
231
- UpdateResponse updateResponse = r .parser () == null ? null : UpdateResponse .fromXContent (r .parser ());
232
- updateListener .onResponse (updateResponse );
233
- } catch (IOException e ) {
230
+ updateListener .onResponse (r .updateResponse ());
231
+ } catch (Exception e ) {
234
232
updateListener .onFailure (e );
235
233
}
236
234
}
Original file line number Diff line number Diff line change @@ -450,8 +450,7 @@ private void buildUpdateRequest(
450
450
sdkClient .updateDataObjectAsync (updateDataObjectRequest ).whenComplete ((ur , ut ) -> {
451
451
if (ut == null ) {
452
452
try {
453
- UpdateResponse updateResponse = ur .parser () == null ? null : UpdateResponse .fromXContent (ur .parser ());
454
- updateListener .onResponse (updateResponse );
453
+ updateListener .onResponse (ur .updateResponse ());
455
454
} catch (Exception e ) {
456
455
updateListener .onFailure (e );
457
456
}
@@ -503,8 +502,7 @@ private void buildUpdateRequest(
503
502
sdkClient .updateDataObjectAsync (updateDataObjectRequest ).whenComplete ((ur , ut ) -> {
504
503
if (ut == null ) {
505
504
try {
506
- UpdateResponse updateResponse = ur .parser () == null ? null : UpdateResponse .fromXContent (ur .parser ());
507
- updateListener .onResponse (updateResponse );
505
+ updateListener .onResponse (ur .updateResponse ());
508
506
} catch (Exception e ) {
509
507
updateListener .onFailure (e );
510
508
}
Original file line number Diff line number Diff line change 55
55
import static org .opensearch .ml .utils .MLNodeUtils .createXContentParserFromRegistry ;
56
56
57
57
import java .io .File ;
58
- import java .io .IOException ;
59
58
import java .nio .file .Path ;
60
59
import java .security .PrivilegedActionException ;
61
60
import java .time .Instant ;
@@ -2271,9 +2270,8 @@ private void handleUpdateDataObjectCompletionStage(
2271
2270
updateListener .onFailure (cause );
2272
2271
} else {
2273
2272
try {
2274
- UpdateResponse updateResponse = r .parser () == null ? null : UpdateResponse .fromXContent (r .parser ());
2275
- updateListener .onResponse (updateResponse );
2276
- } catch (IOException e ) {
2273
+ updateListener .onResponse (r .updateResponse ());
2274
+ } catch (Exception e ) {
2277
2275
updateListener .onFailure (e );
2278
2276
}
2279
2277
}
Original file line number Diff line number Diff line change @@ -505,9 +505,8 @@ private void handleUpdateDataObjectCompletionStage(
505
505
updateListener .onFailure (cause );
506
506
} else {
507
507
try {
508
- UpdateResponse updateResponse = r .parser () == null ? null : UpdateResponse .fromXContent (r .parser ());
509
- updateListener .onResponse (updateResponse );
510
- } catch (IOException e ) {
508
+ updateListener .onResponse (r .updateResponse ());
509
+ } catch (Exception e ) {
511
510
updateListener .onFailure (e );
512
511
}
513
512
}
You can’t perform that action at this time.
0 commit comments