Fix compilation in Eclipse (#23954)

Eclipse seems to have trouble with CrudIT. It throws an NPE back
to the user. I've filed a bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=514884
but for now we should work around it.
This commit is contained in:
Nik Everett 2017-04-06 20:40:55 -04:00 committed by GitHub
parent 4f121744bd
commit 1ad5398af7
1 changed files with 3 additions and 1 deletions

View File

@ -616,7 +616,9 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
};
ThreadPool threadPool = new ThreadPool(Settings.builder().put("node.name", getClass().getName()).build());
try(BulkProcessor processor = new BulkProcessor.Builder(highLevelClient()::bulkAsync, listener, threadPool)
// Pull the client to a variable to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=514884
RestHighLevelClient hlClient = highLevelClient();
try(BulkProcessor processor = new BulkProcessor.Builder(hlClient::bulkAsync, listener, threadPool)
.setConcurrentRequests(0)
.setBulkSize(new ByteSizeValue(5, ByteSizeUnit.GB))
.setBulkActions(nbItems + 1)