Adapt ShardFollowTasksExecutor after #31031

This commit is contained in:
Tanguy Leroux 2018-06-15 11:46:08 +02:00
parent 9c03b4844f
commit 18938aab39
2 changed files with 3 additions and 21 deletions

View File

@ -37,9 +37,9 @@ import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.translog.Translog; import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.persistent.AllocatedPersistentTask; import org.elasticsearch.persistent.AllocatedPersistentTask;
import org.elasticsearch.persistent.PersistentTaskState;
import org.elasticsearch.persistent.PersistentTasksCustomMetaData; import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
import org.elasticsearch.persistent.PersistentTasksExecutor; import org.elasticsearch.persistent.PersistentTasksExecutor;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.xpack.ccr.Ccr; import org.elasticsearch.xpack.ccr.Ccr;
@ -105,7 +105,7 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollo
} }
@Override @Override
protected void nodeOperation(AllocatedPersistentTask task, ShardFollowTask params, Task.Status status) { protected void nodeOperation(final AllocatedPersistentTask task, final ShardFollowTask params, final PersistentTaskState state) {
ShardFollowNodeTask shardFollowNodeTask = (ShardFollowNodeTask) task; ShardFollowNodeTask shardFollowNodeTask = (ShardFollowNodeTask) task;
Client leaderClient = wrapClient(params.getLeaderClusterAlias() != null ? Client leaderClient = wrapClient(params.getLeaderClusterAlias() != null ?
this.client.getRemoteClusterClient(params.getLeaderClusterAlias()) : this.client, params); this.client.getRemoteClusterClient(params.getLeaderClusterAlias()) : this.client, params);
@ -119,7 +119,7 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollo
fetchGlobalCheckpoint(followerClient, params.getFollowShardId(), fetchGlobalCheckpoint(followerClient, params.getFollowShardId(),
followGlobalCheckPoint -> { followGlobalCheckPoint -> {
shardFollowNodeTask.updateProcessedGlobalCheckpoint(followGlobalCheckPoint); shardFollowNodeTask.updateProcessedGlobalCheckpoint(followGlobalCheckPoint);
prepare(leaderClient, followerClient,shardFollowNodeTask, params, followGlobalCheckPoint, imdVersionChecker); prepare(leaderClient, followerClient, shardFollowNodeTask, params, followGlobalCheckPoint, imdVersionChecker);
}, task::markAsFailed); }, task::markAsFailed);
} else { } else {
shardFollowNodeTask.markAsFailed(e); shardFollowNodeTask.markAsFailed(e);

View File

@ -1,18 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack.ccr.action.bulk;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;
public class BulkShardOperationsRequestBuilder
extends ActionRequestBuilder<BulkShardOperationsRequest, BulkShardOperationsResponse> {
public BulkShardOperationsRequestBuilder(final ElasticsearchClient client) {
super(client, BulkShardOperationsAction.INSTANCE, new BulkShardOperationsRequest());
}
}