2018-11-16 02:58:13 -05:00
|
|
|
--
|
|
|
|
:api: upgrade
|
|
|
|
:request: IndexUpgradeRequest
|
|
|
|
:response: BulkByScrollResponse
|
|
|
|
:submit_response: IndexUpgradeSubmissionResponse
|
|
|
|
--
|
|
|
|
|
2018-11-13 09:01:53 -05:00
|
|
|
[[java-rest-high-migration-upgrade]]
|
|
|
|
=== Migration Upgrade
|
|
|
|
|
2019-01-07 08:44:12 -05:00
|
|
|
[[java-rest-high-migration-upgrade-request]]
|
2018-11-13 09:01:53 -05:00
|
|
|
==== Index Upgrade Request
|
|
|
|
|
2018-11-16 02:58:13 -05:00
|
|
|
An +{request}+ requires an index argument. Only one index at the time should be upgraded:
|
2018-11-13 09:01:53 -05:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-11-13 09:01:53 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Create a new request instance
|
|
|
|
|
|
|
|
[[java-rest-high-migration-upgrade-execution]]
|
|
|
|
==== Execution
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-execute]
|
2018-11-13 09:01:53 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
[[java-rest-high-migration-upgrade-response]]
|
|
|
|
==== Response
|
2018-11-16 02:58:13 -05:00
|
|
|
The returned +{response}+ contains information about the executed operation
|
2018-11-13 09:01:53 -05:00
|
|
|
|
|
|
|
|
2019-01-07 08:44:12 -05:00
|
|
|
[[java-rest-high-migration-async-upgrade-request]]
|
2018-11-13 09:01:53 -05:00
|
|
|
==== Asynchronous Execution
|
|
|
|
|
2018-11-16 02:58:13 -05:00
|
|
|
The asynchronous execution of an upgrade request requires both the +{request}+
|
2018-11-13 09:01:53 -05:00
|
|
|
instance and an `ActionListener` instance to be passed to the asynchronous
|
|
|
|
method:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-async-listener]
|
2018-11-13 09:01:53 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Called when the execution is successfully completed. The response is
|
|
|
|
provided as an argument and contains a list of individual results for each
|
|
|
|
operation that was executed. Note that one or more operations might have
|
|
|
|
failed while the others have been successfully executed.
|
2018-11-16 02:58:13 -05:00
|
|
|
<2> Called when the whole +{request}+ fails. In this case the raised
|
2018-11-13 09:01:53 -05:00
|
|
|
exception is provided as an argument and no operation has been executed.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-async-execute]
|
2018-11-13 09:01:53 -05:00
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
<1> The +{request}+ to execute and the `ActionListener` to use when
|
2018-11-13 09:01:53 -05:00
|
|
|
the execution completes
|
|
|
|
|
|
|
|
The asynchronous method does not block and returns immediately. Once it is
|
|
|
|
completed the `ActionListener` is called back using the `onResponse` method
|
|
|
|
if the execution successfully completed or using the `onFailure` method if
|
|
|
|
it failed.
|
|
|
|
|
|
|
|
|
|
|
|
=== Migration Upgrade with Task API
|
2018-11-16 02:58:13 -05:00
|
|
|
Submission of upgrade request task will requires the +{request}+ and will return
|
|
|
|
+{submit_response}+. The +{submit_response}+ can later be use to fetch
|
2018-11-13 09:01:53 -05:00
|
|
|
TaskId and query the Task API for results.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-16 02:58:13 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-task-api]
|
2018-11-13 09:01:53 -05:00
|
|
|
--------------------------------------------------
|