|
29 | 29 | import org.elasticsearch.cluster.routing.Preference; |
30 | 30 | import org.elasticsearch.cluster.routing.ShardsIterator; |
31 | 31 | import org.elasticsearch.cluster.service.ClusterService; |
32 | | -import org.elasticsearch.common.MemoryAccountingBytesRefCounted; |
33 | 32 | import org.elasticsearch.common.Strings; |
34 | 33 | import org.elasticsearch.common.breaker.CircuitBreaker; |
35 | | -import org.elasticsearch.common.breaker.CircuitBreakingException; |
36 | 34 | import org.elasticsearch.common.bytes.BytesReference; |
37 | 35 | import org.elasticsearch.common.io.stream.BytesStreamOutput; |
38 | 36 | import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; |
|
57 | 55 | import org.elasticsearch.search.builder.SearchSourceBuilder; |
58 | 56 | import org.elasticsearch.search.fetch.subphase.FetchSourceContext; |
59 | 57 | import org.elasticsearch.threadpool.ThreadPool; |
60 | | -import org.elasticsearch.transport.LeakTracker; |
61 | 58 | import org.elasticsearch.transport.TransportService; |
62 | 59 | import org.elasticsearch.xcontent.DeprecationHandler; |
63 | 60 | import org.elasticsearch.xcontent.NamedXContentRegistry; |
@@ -264,22 +261,8 @@ protected MultiSearchResponse shardOperation(Request request, ShardId shardId) t |
264 | 261 | } |
265 | 262 | return context.getFieldType(field); |
266 | 263 | }); |
267 | | - MemoryAccountingBytesRefCounted memAccountingRefCounted = MemoryAccountingBytesRefCounted.create(breaker); |
268 | | - final SearchHit hit = new SearchHit(scoreDoc.doc, visitor.id(), null, LeakTracker.wrap(memAccountingRefCounted)); |
269 | | - try { |
270 | | - BytesReference sourceBytesRef = visitor.source(); |
271 | | - memAccountingRefCounted.account(sourceBytesRef.length(), "enrich source"); |
272 | | - hit.sourceRef(filterSource(fetchSourceContext, sourceBytesRef)); |
273 | | - hits[j] = hit; |
274 | | - } catch (CircuitBreakingException e) { |
275 | | - hit.decRef(); |
276 | | - for (SearchHit searchHit : hits) { |
277 | | - if (searchHit != null) { |
278 | | - searchHit.decRef(); |
279 | | - } |
280 | | - } |
281 | | - throw e; |
282 | | - } |
| 264 | + final SearchHit hit = new SearchHit(scoreDoc.doc, visitor.id()); |
| 265 | + hit.sourceRef(filterSource(fetchSourceContext, visitor.source())); |
283 | 266 | } |
284 | 267 | items[i] = new MultiSearchResponse.Item(createSearchResponse(topDocs, hits), null); |
285 | 268 | } |
|
0 commit comments