linkedin / avro-util

Collection of utilities to allow writing java code that operates across a wide range of avro versions.
BSD 2-Clause "Simplified" License
76 stars 59 forks source link

Make java file write wait by using reduce instead of count #528

Closed karthikrg closed 9 months ago

karthikrg commented 9 months ago

Java 11+ has an optimization where parallelStream ignores the map operator if chained to a count for collections with known sizes. This obviously causes tests to fail because the method exits before the writes happen.

Switch to reduce to get around this.