upgrade.asciidoc 2.9 KB

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