LosD commented on a change in pull request #229: Upgrade to Elasticsearch 7.3.1
URL: https://github.com/apache/metamodel/pull/229#discussion_r336509950
##########
File path:
elasticsearch/rest/src/main/java/org/apache/metamodel/elasticsearch/rest/ElasticSearchRestDataSet.java
##########
@@ -50,12 +50,15 @@ public ElasticSearchRestDataSet(final RestHighLevelClient
client, final SearchRe
@Override
public void closeNow() {
final String scrollId = _searchResponse.getScrollId();
- final ClearScrollRequest clearScrollRequest = new ClearScrollRequest();
- clearScrollRequest.addScrollId(scrollId);
- try {
- client.clearScroll((ClearScrollRequest) clearScrollRequest,
RequestOptions.DEFAULT);
- } catch (IOException e) {
- logger.warn("Could not clear scroll.", e);
+
+ if (scrollId != null) {
+ final ClearScrollRequest clearScrollRequest = new
ClearScrollRequest();
+ clearScrollRequest.addScrollId(scrollId);
+ try {
+ client.clearScroll((ClearScrollRequest) clearScrollRequest,
RequestOptions.DEFAULT);
+ } catch (final IOException e) {
+ logger.warn("Could not clear scroll.", e);
+ }
Review comment:
Is this a local operation, or does the scroll live on the server? If the
latter (as the "...Request" name seems to imply), isn't this a very expensive
operation, when it's not done in batches?
(sorry, it's been waaaaay too long ago that I touched ES)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services