Persistent Tasks: remove unused isCurrentStatus method (elastic/x-pack-elasticsearch#2076)

Removes a method that is no longer used in production code.

Relates to elastic/x-pack-elasticsearch#957

Original commit: elastic/x-pack-elasticsearch@84fcb9db8a
This commit is contained in:
Igor Motov 2017-07-26 08:40:22 -04:00 committed by GitHub
parent 3914d66cea
commit 4da7ae21bc
2 changed files with 1 additions and 9 deletions

View File

@ -393,14 +393,6 @@ public final class PersistentTasksCustomMetaData extends AbstractNamedDiffable<M
return status;
}
/**
* @return Whether the task status isn't stale. When a task gets unassigned from the executor node or assigned
* to a new executor node and the status hasn't been updated then the task status is stale.
*/
public boolean isCurrentStatus() {
return allocationIdOnLastStatusUpdate != null && allocationIdOnLastStatusUpdate == allocationId;
}
@Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params xParams) throws IOException {
builder.startObject();

View File

@ -188,7 +188,7 @@ public class PersistentTasksExecutorIT extends ESIntegTestCase {
int finalI = i;
WaitForPersistentTaskStatusFuture<?> future1 = new WaitForPersistentTaskStatusFuture<>();
persistentTasksService.waitForPersistentTaskStatus(taskId,
task -> task != null && task.isCurrentStatus() && task.getStatus().toString() != null &&
task -> task != null && task.getStatus() != null && task.getStatus().toString() != null &&
task.getStatus().toString().equals("{\"phase\":\"phase " + (finalI + 1) + "\"}"),
TimeValue.timeValueSeconds(10), future1);
assertThat(future1.get().getId(), equalTo(taskId));