Internal: Remove (mostly) unused 'failure' member from ShardSearchFailure.
closes #6837 closes #6861
This commit is contained in:
parent
197ef0b205
commit
90d2cb7dd5
|
@ -43,23 +43,16 @@ public class ShardSearchFailure implements ShardOperationFailedException {
|
||||||
private SearchShardTarget shardTarget;
|
private SearchShardTarget shardTarget;
|
||||||
private String reason;
|
private String reason;
|
||||||
private RestStatus status;
|
private RestStatus status;
|
||||||
private transient Throwable failure;
|
|
||||||
|
|
||||||
private ShardSearchFailure() {
|
private ShardSearchFailure() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public Throwable failure() {
|
|
||||||
return failure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShardSearchFailure(Throwable t) {
|
public ShardSearchFailure(Throwable t) {
|
||||||
this(t, null);
|
this(t, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShardSearchFailure(Throwable t, @Nullable SearchShardTarget shardTarget) {
|
public ShardSearchFailure(Throwable t, @Nullable SearchShardTarget shardTarget) {
|
||||||
this.failure = t;
|
|
||||||
Throwable actual = ExceptionsHelper.unwrapCause(t);
|
Throwable actual = ExceptionsHelper.unwrapCause(t);
|
||||||
if (actual != null && actual instanceof SearchException) {
|
if (actual != null && actual instanceof SearchException) {
|
||||||
this.shardTarget = ((SearchException) actual).shard();
|
this.shardTarget = ((SearchException) actual).shard();
|
||||||
|
|
|
@ -389,7 +389,7 @@ public class ExtendedStatsTests extends AbstractNumericTests {
|
||||||
ShardSearchFailure[] failures = response.getShardFailures();
|
ShardSearchFailure[] failures = response.getShardFailures();
|
||||||
if (failures.length != expectedFailures) {
|
if (failures.length != expectedFailures) {
|
||||||
for (ShardSearchFailure failure : failures) {
|
for (ShardSearchFailure failure : failures) {
|
||||||
logger.error("Shard Failure: {}", failure.failure(), failure.toString());
|
logger.error("Shard Failure: {}", failure.reason(), failure.toString());
|
||||||
}
|
}
|
||||||
fail("Unexpected shard failures!");
|
fail("Unexpected shard failures!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,7 @@ public class StatsTests extends AbstractNumericTests {
|
||||||
ShardSearchFailure[] failures = response.getShardFailures();
|
ShardSearchFailure[] failures = response.getShardFailures();
|
||||||
if (failures.length != expectedFailures) {
|
if (failures.length != expectedFailures) {
|
||||||
for (ShardSearchFailure failure : failures) {
|
for (ShardSearchFailure failure : failures) {
|
||||||
logger.error("Shard Failure: {}", failure.failure(), failure.toString());
|
logger.error("Shard Failure: {}", failure.reason(), failure.toString());
|
||||||
}
|
}
|
||||||
fail("Unexpected shard failures!");
|
fail("Unexpected shard failures!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue