Skip to content

Commit b793459

Browse files
committed
Revert enrich modifications
1 parent 558d4af commit b793459

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchAction.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
import org.elasticsearch.cluster.routing.Preference;
3030
import org.elasticsearch.cluster.routing.ShardsIterator;
3131
import org.elasticsearch.cluster.service.ClusterService;
32-
import org.elasticsearch.common.MemoryAccountingBytesRefCounted;
3332
import org.elasticsearch.common.Strings;
3433
import org.elasticsearch.common.breaker.CircuitBreaker;
35-
import org.elasticsearch.common.breaker.CircuitBreakingException;
3634
import org.elasticsearch.common.bytes.BytesReference;
3735
import org.elasticsearch.common.io.stream.BytesStreamOutput;
3836
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
@@ -57,7 +55,6 @@
5755
import org.elasticsearch.search.builder.SearchSourceBuilder;
5856
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
5957
import org.elasticsearch.threadpool.ThreadPool;
60-
import org.elasticsearch.transport.LeakTracker;
6158
import org.elasticsearch.transport.TransportService;
6259
import org.elasticsearch.xcontent.DeprecationHandler;
6360
import org.elasticsearch.xcontent.NamedXContentRegistry;
@@ -264,22 +261,8 @@ protected MultiSearchResponse shardOperation(Request request, ShardId shardId) t
264261
}
265262
return context.getFieldType(field);
266263
});
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()));
283266
}
284267
items[i] = new MultiSearchResponse.Item(createSearchResponse(topDocs, hits), null);
285268
}

0 commit comments

Comments
 (0)