Internal: Remove (mostly) unused 'failure' member from ShardSearchFailure.

closes #6837
closes #6861
This commit is contained in:
Ryan Ernst 2014-08-07 13:11:30 -07:00
parent 197ef0b205
commit 90d2cb7dd5
3 changed files with 2 additions and 9 deletions

View File

@ -43,23 +43,16 @@ public class ShardSearchFailure implements ShardOperationFailedException {
private SearchShardTarget shardTarget;
private String reason;
private RestStatus status;
private transient Throwable failure;
private ShardSearchFailure() {
}
@Nullable
public Throwable failure() {
return failure;
}
public ShardSearchFailure(Throwable t) {
this(t, null);
}
public ShardSearchFailure(Throwable t, @Nullable SearchShardTarget shardTarget) {
this.failure = t;
Throwable actual = ExceptionsHelper.unwrapCause(t);
if (actual != null && actual instanceof SearchException) {
this.shardTarget = ((SearchException) actual).shard();

View File

@ -389,7 +389,7 @@ public class ExtendedStatsTests extends AbstractNumericTests {
ShardSearchFailure[] failures = response.getShardFailures();
if (failures.length != expectedFailures) {
for (ShardSearchFailure failure : failures) {
logger.error("Shard Failure: {}", failure.failure(), failure.toString());
logger.error("Shard Failure: {}", failure.reason(), failure.toString());
}
fail("Unexpected shard failures!");
}

View File

@ -361,7 +361,7 @@ public class StatsTests extends AbstractNumericTests {
ShardSearchFailure[] failures = response.getShardFailures();
if (failures.length != expectedFailures) {
for (ShardSearchFailure failure : failures) {
logger.error("Shard Failure: {}", failure.failure(), failure.toString());
logger.error("Shard Failure: {}", failure.reason(), failure.toString());
}
fail("Unexpected shard failures!");
}