Implement toString for BulkByScrollTask (#59042)
We should implement "toString" of BulkByScrollTask.StatusOrException to have a meaningful log message when a reindex task completes.
This commit is contained in:
parent
a9151db735
commit
62763b177d
|
@ -22,6 +22,7 @@ package org.elasticsearch.index.reindex;
|
|||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
@ -985,6 +986,15 @@ public class BulkByScrollTask extends CancellableTask {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (exception != null) {
|
||||
return "BulkByScrollTask{error=" + Strings.toString(this) + "}";
|
||||
} else {
|
||||
return "BulkByScrollTask{status=" + Strings.toString(this) + "}";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
|
|
Loading…
Reference in New Issue