INGEST: Clean up Java8 Stream Usage (#32059)
* GrokProcessor: Rationalize the loop over the map to save allocations and indirection * IngestDocument: Rationalize way we append to `List`
This commit is contained in:
parent
c2e3bebab9
commit
cf7489899a
|
@ -68,8 +68,7 @@ public final class GrokProcessor extends AbstractProcessor {
|
|||
throw new IllegalArgumentException("Provided Grok expressions do not match field value: [" + fieldValue + "]");
|
||||
}
|
||||
|
||||
matches.entrySet().stream()
|
||||
.forEach((e) -> ingestDocument.setFieldValue(e.getKey(), e.getValue()));
|
||||
matches.forEach(ingestDocument::setFieldValue);
|
||||
|
||||
if (traceMatch) {
|
||||
if (matchPatterns.size() > 1) {
|
||||
|
|
|
@ -527,8 +527,7 @@ public final class IngestDocument {
|
|||
|
||||
private static void appendValues(List<Object> list, Object value) {
|
||||
if (value instanceof List) {
|
||||
List<?> valueList = (List<?>) value;
|
||||
valueList.stream().forEach(list::add);
|
||||
list.addAll((List<?>) value);
|
||||
} else {
|
||||
list.add(value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue