osheroff / mysql-binlog-connector-java

MySQL Binary Log connector
666 stars 163 forks source link

use internal index for EventType.byEventNumber instead of always crea… #102

Closed janickr closed 1 year ago

janickr commented 1 year ago

…ting an array and iterating

This is a PR that avoids the EventType array allocation that I saw while creating the allocation profiles in https://github.com/osheroff/mysql-binlog-connector-java/issues/98

osheroff commented 1 year ago

seems good. can you confirm this doesn't affect the minimum jdk version? I always get a little confused around when you can use streams & lambdas and such, and this library is depended on by some pretty ooooollldd installs (unfortunately).

janickr commented 1 year ago

What is the minimum jdk version? I assumed jdk 8 because of the 8 in the compiler plugin of the pom.xml file.

I can run ./mvnw clean integration-test using jdk 8.

I also don't mind changing the Stream operations with a simple loop if you prefer that.

osheroff commented 1 year ago

jdk 8 is fine.