Allow setting of copy_settings in the HLRC#39752
Conversation
elastic#30255 introduced the `copy_settings` parameter in 6.x. This commit adds support for setting it via `setCopySettings` in the HLRC.
|
AFAIU (e.g. in Will be happy to add PRs if this is incorrect though. |
|
Pinging @elastic/es-core-features |
|
@elasticmachine run elasticsearch-ci/default-distro |
jasontedor
left a comment
There was a problem hiding this comment.
The production code looks good. I left a comment about the deprecation Javadoc, and I agree with @hub-cap to update the documentation that he referenced too.
| } | ||
|
|
||
| /** | ||
| * @deprecated <code>copy_settings</code> defaults to <code>true</code> and can not be set to false |
There was a problem hiding this comment.
Note that the default is unset and behaves as false, however false can not be set explicitly. copy_settings is either unset (default) or set to true (future behavior).
| resizeRequest.setResizeType(resizeType); | ||
| Map<String, String> expectedParams = new HashMap<>(); | ||
|
|
||
| if (ESTestCase.randomBoolean()) { |
There was a problem hiding this comment.
I see this is in the existing style in this class, but it is at odds with the rest of the codebase where we would simply write randomBoolean().
There was a problem hiding this comment.
Addressed in ce68119; in a separate PR we can convert everything in this class to randomBoolean() for consistency.
and use of ESTestCase.randomBoolean()
|
Docs have been added in 5f05978 |
jasontedor
left a comment
There was a problem hiding this comment.
Looking good now, I left some minor feedback.
| request.setWaitForActiveShards(ActiveShardCount.DEFAULT); // <2> | ||
| // end::shrink-index-request-waitForActiveShards | ||
| // tag::shrink-index-request-copySettings | ||
| request.setCopySettings(Boolean.TRUE); // <1> |
| -------------------------------------------------- | ||
| include-tagged::{doc-tests-file}[{api}-request-copySettings] | ||
| -------------------------------------------------- | ||
| <1> Use `Boolean.TRUE` to copy the settings from the source index to the target |
| include-tagged::{doc-tests-file}[{api}-request-copySettings] | ||
| -------------------------------------------------- | ||
| <1> Use `Boolean.TRUE` to copy the settings from the source index to the target | ||
| index. This cannot be `Boolean.FALSE`. If this method is not used, default behavior is not to copy. |
| Map<String, String> expectedParams = new HashMap<>(); | ||
|
|
||
| if (randomBoolean()) { | ||
| resizeRequest.setCopySettings(Boolean.TRUE); |
There was a problem hiding this comment.
| resizeRequest.setCopySettings(Boolean.TRUE); | |
| resizeRequest.setCopySettings(true); |
| include-tagged::{doc-tests-file}[{api}-request-copySettings] | ||
| -------------------------------------------------- | ||
| <1> Use `true` to copy the settings from the source index to the target | ||
| index. This cannot be `false`. If this method is not used, default behavior is not to copy. |
jasontedor
left a comment
There was a problem hiding this comment.
I left two more minors, no need for another review round. LGTM. Fire at will.
Thanks a lot for the review effort here. Will merge after CI is green. |
#30255 introduced the
copy_settingsparameter in 6.x.This commit adds support for setting it via
setCopySettingsin theHLRC.