Skip to content

Commit

Permalink
Persistent Tasks: remove unused isCurrentStatus method (#2076)
Browse files Browse the repository at this point in the history
Removes a method that is no longer used in production code.

Relates to #957
  • Loading branch information
imotov authored and martijnvg committed Feb 5, 2018
1 parent b49a484 commit ff2c02a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Expand Up @@ -406,14 +406,6 @@ public Status getStatus() {
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();
Expand Down
Expand Up @@ -202,7 +202,7 @@ public void testPersistentActionStatusUpdate() throws Exception {
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));
Expand Down

0 comments on commit ff2c02a

Please sign in to comment.