Skip to content

Commit ff2c02a

Browse files
imotovmartijnvg
authored andcommitted
Persistent Tasks: remove unused isCurrentStatus method (#2076)
Removes a method that is no longer used in production code. Relates to #957
1 parent b49a484 commit ff2c02a

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetaData.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,6 @@ public Status getStatus() {
406406
return status;
407407
}
408408

409-
/**
410-
* @return Whether the task status isn't stale. When a task gets unassigned from the executor node or assigned
411-
* to a new executor node and the status hasn't been updated then the task status is stale.
412-
*/
413-
public boolean isCurrentStatus() {
414-
return allocationIdOnLastStatusUpdate != null && allocationIdOnLastStatusUpdate == allocationId;
415-
}
416-
417409
@Override
418410
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params xParams) throws IOException {
419411
builder.startObject();

server/src/test/java/org/elasticsearch/persistent/PersistentTasksExecutorIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public void testPersistentActionStatusUpdate() throws Exception {
202202
int finalI = i;
203203
WaitForPersistentTaskStatusFuture<?> future1 = new WaitForPersistentTaskStatusFuture<>();
204204
persistentTasksService.waitForPersistentTaskStatus(taskId,
205-
task -> task != null && task.isCurrentStatus() && task.getStatus().toString() != null &&
205+
task -> task != null && task.getStatus() != null && task.getStatus().toString() != null &&
206206
task.getStatus().toString().equals("{\"phase\":\"phase " + (finalI + 1) + "\"}"),
207207
TimeValue.timeValueSeconds(10), future1);
208208
assertThat(future1.get().getId(), equalTo(taskId));

0 commit comments

Comments
 (0)