ChrisSamo632 commented on a change in pull request #5299:
URL: https://github.com/apache/nifi/pull/5299#discussion_r702279953
##########
File path:
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchHttpProcessor.java
##########
@@ -282,6 +291,14 @@ protected JsonNode parseJsonResponse(InputStream in)
throws IOException {
return mapper.readTree(in);
}
+ @OnScheduled
+ public void setup(ProcessContext context) {
+
esUrlsIteratorAtomicReference.set(Iterables.cycle(Arrays.asList(context.getProperty(ES_URL).evaluateAttributeExpressions().getValue().split(","))).iterator());
Review comment:
Better to `trim()` the values before setting them in the
`Iterables.cycle` rather than every time they're retrieved in `getESUrl` -
could create a `stream` from the `List` and apply a `map` function to
`String::trim` each element before `collect`ing back into a `List` (or other
similar approach)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]