elastomer-client 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/lib/elastomer_client/client/reindex.rb +5 -0
- data/lib/elastomer_client/version.rb +1 -1
- data/test/client/reindex_test.rb +25 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49da91bf2c259b9b77ed76d66fa001aa4192432225090bb62ff9d74f8173f8dc
|
4
|
+
data.tar.gz: 2d519500cced0a8783a9fd5b77853d935cc3b99f35e8be981e5e1e23b55d9632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0f879414271cf6f861bfcf256ec6af824a60c2603dbb48dc2297ecffae55f969e7947e8c9cfc0469239c15fe4b9754721279886def527eb89658a549f085fb
|
7
|
+
data.tar.gz: 42cd80d2c67d119767451b524543f73cc1af3ffda4088186cfac8daa99970849655c05ed5382e7ab689a71e1a5c8e4c6b620fbaf66a91693e4afad7e186900ff
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
## 6.2.1 (2024-12-10)
|
2
|
+
- Add support for rethrottling reindex tasks
|
3
|
+
|
1
4
|
## 6.2.0 (2024-11-06)
|
2
|
-
-
|
3
|
-
-
|
5
|
+
- Add support for reindex API
|
6
|
+
- Remove CI checks for ES 5.6.15
|
4
7
|
|
5
8
|
## 6.1.1 (2024-06-05)
|
6
9
|
- Unlock faraday_middleware version to allow 1.x
|
@@ -24,6 +24,11 @@ module ElastomerClient
|
|
24
24
|
response.body
|
25
25
|
end
|
26
26
|
|
27
|
+
def rethrottle(task_id, params = {})
|
28
|
+
response = client.post "/_reindex/#{task_id}/_rethrottle", params.merge(params, action: "rethrottle", rest_api: "reindex")
|
29
|
+
response.body
|
30
|
+
end
|
31
|
+
|
27
32
|
end
|
28
33
|
end
|
29
34
|
end
|
data/test/client/reindex_test.rb
CHANGED
@@ -49,6 +49,30 @@ describe ElastomerClient::Client::Reindex do
|
|
49
49
|
assert_equal "Book 1", doc["_source"]["title"]
|
50
50
|
end
|
51
51
|
|
52
|
+
it "successfully rethrottles a reindex task" do
|
53
|
+
reindex = $client.reindex
|
54
|
+
body = {
|
55
|
+
source: { index: @source_index.name },
|
56
|
+
dest: { index: @dest_index.name }
|
57
|
+
}
|
58
|
+
response = reindex.reindex(body, requests_per_second: 0.01, wait_for_completion: false)
|
59
|
+
task_id = response["task"]
|
60
|
+
|
61
|
+
reindex.rethrottle(task_id, requests_per_second: 1)
|
62
|
+
|
63
|
+
tasks = $client.tasks
|
64
|
+
node_id = task_id.split(":").first
|
65
|
+
task_id = task_id.split(":").last.to_i
|
66
|
+
|
67
|
+
# wait for the task to complete
|
68
|
+
tasks.wait_by_id(node_id, task_id, "30s")
|
69
|
+
|
70
|
+
# Verify that the document has been reindexed
|
71
|
+
doc = @dest_index.docs.get(id: 1, type: "book")
|
72
|
+
|
73
|
+
assert_equal "Book 1", doc["_source"]["title"]
|
74
|
+
end
|
75
|
+
|
52
76
|
it "creates a new index when the destination index does not exist" do
|
53
77
|
reindex = $client.reindex
|
54
78
|
body = {
|
@@ -69,7 +93,7 @@ describe ElastomerClient::Client::Reindex do
|
|
69
93
|
}
|
70
94
|
|
71
95
|
exception = assert_raises(ElastomerClient::Client::RequestError) do
|
72
|
-
|
96
|
+
reindex.reindex(body)
|
73
97
|
end
|
74
98
|
assert_equal(404, exception.status)
|
75
99
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastomer-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-11
|
12
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|