upgrade.asciidoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --
  2. :api: upgrade
  3. :request: IndexUpgradeRequest
  4. :response: BulkByScrollResponse
  5. :submit_response: IndexUpgradeSubmissionResponse
  6. --
  7. [[java-rest-high-migration-upgrade]]
  8. === Migration Upgrade
  9. [[java-rest-high-migration-upgrade-request]]
  10. ==== Index Upgrade Request
  11. An +{request}+ requires an index argument. Only one index at the time should be upgraded:
  12. ["source","java",subs="attributes,callouts,macros"]
  13. --------------------------------------------------
  14. include-tagged::{doc-tests-file}[{api}-request]
  15. --------------------------------------------------
  16. <1> Create a new request instance
  17. [[java-rest-high-migration-upgrade-execution]]
  18. ==== Execution
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests-file}[{api}-execute]
  22. --------------------------------------------------
  23. [[java-rest-high-migration-upgrade-response]]
  24. ==== Response
  25. The returned +{response}+ contains information about the executed operation
  26. [[java-rest-high-migration-async-upgrade-request]]
  27. ==== Asynchronous Execution
  28. The asynchronous execution of an upgrade request requires both the +{request}+
  29. instance and an `ActionListener` instance to be passed to the asynchronous
  30. method:
  31. ["source","java",subs="attributes,callouts,macros"]
  32. --------------------------------------------------
  33. include-tagged::{doc-tests-file}[{api}-async-listener]
  34. --------------------------------------------------
  35. <1> Called when the execution is successfully completed. The response is
  36. provided as an argument and contains a list of individual results for each
  37. operation that was executed. Note that one or more operations might have
  38. failed while the others have been successfully executed.
  39. <2> Called when the whole +{request}+ fails. In this case the raised
  40. exception is provided as an argument and no operation has been executed.
  41. ["source","java",subs="attributes,callouts,macros"]
  42. --------------------------------------------------
  43. include-tagged::{doc-tests-file}[{api}-async-execute]
  44. --------------------------------------------------
  45. <1> The +{request}+ to execute and the `ActionListener` to use when
  46. the execution completes
  47. The asynchronous method does not block and returns immediately. Once it is
  48. completed the `ActionListener` is called back using the `onResponse` method
  49. if the execution successfully completed or using the `onFailure` method if
  50. it failed.
  51. === Migration Upgrade with Task API
  52. Submission of upgrade request task will requires the +{request}+ and will return
  53. +{submit_response}+. The +{submit_response}+ can later be use to fetch
  54. TaskId and query the Task API for results.
  55. ["source","java",subs="attributes,callouts,macros"]
  56. --------------------------------------------------
  57. include-tagged::{doc-tests-file}[{api}-task-api]
  58. --------------------------------------------------