From 90d2cb7dd506f188b534c72de7ba125e74f6ec21 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 7 Aug 2014 13:11:30 -0700 Subject: [PATCH] Internal: Remove (mostly) unused 'failure' member from ShardSearchFailure. closes #6837 closes #6861 --- .../elasticsearch/action/search/ShardSearchFailure.java | 7 ------- .../search/aggregations/metrics/ExtendedStatsTests.java | 2 +- .../search/aggregations/metrics/StatsTests.java | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java b/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java index d461ee850f0..1412c1278d1 100644 --- a/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java +++ b/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java @@ -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(); diff --git a/src/test/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsTests.java b/src/test/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsTests.java index 2e509b742c6..340cd69ebb9 100644 --- a/src/test/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsTests.java +++ b/src/test/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsTests.java @@ -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!"); } diff --git a/src/test/java/org/elasticsearch/search/aggregations/metrics/StatsTests.java b/src/test/java/org/elasticsearch/search/aggregations/metrics/StatsTests.java index 167b9b6eebc..8beb973d775 100644 --- a/src/test/java/org/elasticsearch/search/aggregations/metrics/StatsTests.java +++ b/src/test/java/org/elasticsearch/search/aggregations/metrics/StatsTests.java @@ -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!"); }