Persistent Tasks: remove unused isCurrentStatus method (#2076)

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

Relates to #957
This commit is contained in:
Igor Motov 2017-07-26 08:40:22 -04:00 committed by Martijn van Groningen
parent 0d50f9c6a9
commit ffdb05e48e
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
2 changed files with 1 additions and 9 deletions

View File

@ -406,14 +406,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

@ -202,7 +202,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));