|
26 | 26 | import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; |
27 | 27 | import org.elasticsearch.action.admin.indices.close.CloseIndexRequest; |
28 | 28 | import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; |
| 29 | +import org.elasticsearch.action.support.ActiveShardCount; |
29 | 30 | import org.elasticsearch.client.ESRestHighLevelClientTestCase; |
30 | 31 | import org.elasticsearch.client.Request; |
31 | 32 | import org.elasticsearch.client.RequestOptions; |
@@ -97,7 +98,8 @@ public void testPutFollow() throws Exception { |
97 | 98 | PutFollowRequest putFollowRequest = new PutFollowRequest( |
98 | 99 | "local", // <1> |
99 | 100 | "leader", // <2> |
100 | | - "follower" // <3> |
| 101 | + "follower", // <3> |
| 102 | + ActiveShardCount.ONE // <4> |
101 | 103 | ); |
102 | 104 | // end::ccr-put-follow-request |
103 | 105 |
|
@@ -175,7 +177,7 @@ public void testPauseFollow() throws Exception { |
175 | 177 | String followIndex = "follower"; |
176 | 178 | // Follow index, so that it can be paused: |
177 | 179 | { |
178 | | - PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex); |
| 180 | + PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex, ActiveShardCount.ONE); |
179 | 181 | PutFollowResponse putFollowResponse = client.ccr().putFollow(putFollowRequest, RequestOptions.DEFAULT); |
180 | 182 | assertThat(putFollowResponse.isFollowIndexCreated(), is(true)); |
181 | 183 | assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true)); |
@@ -241,7 +243,7 @@ public void testResumeFollow() throws Exception { |
241 | 243 | String followIndex = "follower"; |
242 | 244 | // Follow index, so that it can be paused: |
243 | 245 | { |
244 | | - PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex); |
| 246 | + PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex, ActiveShardCount.ONE); |
245 | 247 | PutFollowResponse putFollowResponse = client.ccr().putFollow(putFollowRequest, RequestOptions.DEFAULT); |
246 | 248 | assertThat(putFollowResponse.isFollowIndexCreated(), is(true)); |
247 | 249 | assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true)); |
@@ -317,7 +319,7 @@ public void testUnfollow() throws Exception { |
317 | 319 | String followIndex = "follower"; |
318 | 320 | // Follow index, pause and close, so that it can be unfollowed: |
319 | 321 | { |
320 | | - PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex); |
| 322 | + PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex, ActiveShardCount.ONE); |
321 | 323 | PutFollowResponse putFollowResponse = client.ccr().putFollow(putFollowRequest, RequestOptions.DEFAULT); |
322 | 324 | assertThat(putFollowResponse.isFollowIndexCreated(), is(true)); |
323 | 325 | assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true)); |
@@ -349,7 +351,7 @@ public void testUnfollow() throws Exception { |
349 | 351 | DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(followIndex); |
350 | 352 | assertThat(client.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT).isAcknowledged(), is(true)); |
351 | 353 |
|
352 | | - PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex); |
| 354 | + PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", followIndex, ActiveShardCount.ONE); |
353 | 355 | PutFollowResponse putFollowResponse = client.ccr().putFollow(putFollowRequest, RequestOptions.DEFAULT); |
354 | 356 | assertThat(putFollowResponse.isFollowIndexCreated(), is(true)); |
355 | 357 | assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true)); |
@@ -639,7 +641,7 @@ public void testGetFollowStats() throws Exception { |
639 | 641 | } |
640 | 642 | { |
641 | 643 | // Follow index, so that we can query for follow stats: |
642 | | - PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", "follower"); |
| 644 | + PutFollowRequest putFollowRequest = new PutFollowRequest("local", "leader", "follower", ActiveShardCount.ONE); |
643 | 645 | PutFollowResponse putFollowResponse = client.ccr().putFollow(putFollowRequest, RequestOptions.DEFAULT); |
644 | 646 | assertThat(putFollowResponse.isFollowIndexCreated(), is(true)); |
645 | 647 | assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true)); |
|
0 commit comments