-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an API to clone an index. This is similar to the index split and shrink APIs, just with the difference that the number of primary shards is kept the same. In case where the filesystem provides hard-linking capabilities, this is a very cheap operation. Indexing cloning can be done by running `POST my_source_index/_clone/my_target_index` and it supports the same options as the split and shrink APIs. Closes #44128
- Loading branch information
Showing
23 changed files
with
844 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
-- | ||
:api: clone-index | ||
:request: ResizeRequest | ||
:response: ResizeResponse | ||
-- | ||
|
||
[id="{upid}-{api}"] | ||
=== Clone Index API | ||
|
||
[id="{upid}-{api}-request"] | ||
==== Resize Request | ||
|
||
The Clone Index API requires a +{request}+ instance. | ||
A +{request}+ requires two string arguments: | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request] | ||
-------------------------------------------------- | ||
<1> The target index (first argument) to clone the source index (second argument) into | ||
<2> The resize type needs to be set to `CLONE` | ||
|
||
==== Optional arguments | ||
The following arguments can optionally be provided: | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request-timeout] | ||
-------------------------------------------------- | ||
<1> Timeout to wait for the all the nodes to acknowledge the index is opened | ||
as a `TimeValue` | ||
<2> Timeout to wait for the all the nodes to acknowledge the index is opened | ||
as a `String` | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request-masterTimeout] | ||
-------------------------------------------------- | ||
<1> Timeout to connect to the master node as a `TimeValue` | ||
<2> Timeout to connect to the master node as a `String` | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request-waitForActiveShards] | ||
-------------------------------------------------- | ||
<1> The number of active shard copies to wait for before the clone index API | ||
returns a response, as an `int` | ||
<2> The number of active shard copies to wait for before the clone index API | ||
returns a response, as an `ActiveShardCount` | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request-settings] | ||
-------------------------------------------------- | ||
<1> The settings to apply to the target index, which optionally include the | ||
number of shards to create for it | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-request-aliases] | ||
-------------------------------------------------- | ||
<1> The aliases to associate the target index with | ||
|
||
include::../execution.asciidoc[] | ||
|
||
[id="{upid}-{api}-response"] | ||
==== Clone Index Response | ||
|
||
The returned +{response}+ allows to retrieve information about the | ||
executed operation as follows: | ||
|
||
["source","java",subs="attributes,callouts,macros"] | ||
-------------------------------------------------- | ||
include-tagged::{doc-tests-file}[{api}-response] | ||
-------------------------------------------------- | ||
<1> Indicates whether all of the nodes have acknowledged the request | ||
<2> Indicates whether the requisite number of shard copies were started for | ||
each shard in the index before timing out | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.