From 3cd5eed91e6781284222cfc4bef2042afbc1e60d Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 30 Nov 2017 16:25:28 +0100 Subject: [PATCH] fixed code violations --- .../xpack/ccr/action/ShardFollowTasksExecutor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java index 088b7b5d4c3..5aed348867a 100644 --- a/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java +++ b/x-pack/plugin/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java @@ -92,17 +92,19 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor { + Consumer handler = e -> { if (e == null) { ShardFollowTask.Status newStatus = new ShardFollowTask.Status(); newStatus.setProcessedGlobalCheckpoint(leaderGlobalCheckPoint); - task.updatePersistentStatus(newStatus, ActionListener.wrap( - persistentTask -> prepare(task, leaderShard, followerShard, leaderGlobalCheckPoint), task::markAsFailed) + task.updatePersistentStatus(newStatus, ActionListener.wrap(persistentTask -> prepare(task, + leaderShard, followerShard, leaderGlobalCheckPoint), task::markAsFailed) ); } else { task.markAsFailed(e); } - }); + }; + ChunksCoordinator coordinator = + new ChunksCoordinator(client, ccrExecutor, DEFAULT_BATCH_SIZE, leaderShard, followerShard, handler); coordinator.createChucks(followGlobalCheckPoint, leaderGlobalCheckPoint); coordinator.processChuck(); }