upgrade.asciidoc 2.8 KB

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