refactor: cache protobuf parser method lookup Motivation: Address PR review feedback that repeatedly calling MethodHandles.publicLookup() has unnecessary overhead while keeping the MethodHandle-based parser resolution behavior. Modification: Store a shared public Lookup for Java protobuf parser discovery and cache parser MethodHandles with a ConcurrentHashMap putIfAbsent pattern to avoid non-atomic TrieMap getOrElseUpdate lookup races. Result: ProtoAnySerialization reuses the public lookup and aligns parser handle caching with the existing ConsumerFilterStore MethodHandle cache style. Tests: - scalafmt --mode diff-ref=origin/main - scalafmt --list --mode diff-ref=origin/main - sbt "grpc-test / Test / testOnly org.apache.pekko.projection.grpc.internal.ProtoAnySerializationSpec" - sbt "jdbc / Test / testOnly org.apache.pekko.projection.jdbc.JdbcProjectionTest org.apache.pekko.projection.jdbc.JdbcOffsetStoreSpec" - sbt "jdbc / Test / testOnly org.apache.pekko.projection.jdbc.H2JdbcOffsetStoreSpec" - sbt "jdbc-int-test / Test / testOnly org.apache.pekko.projection.jdbc.JdbcProjectionSpec" - sbt "examples / Test / compile" - git diff --check - qodercli stdout review: No must-fix findings (/tmp/project-qoder-review-2.log) References: Refs apache/pekko-projection#561
Apache Pekko Projections provides an abstraction for consuming a stream of Envelope (where Envelope contains a payload and a trackable offset). This streams can originate from persisted events, Kafka topics, or other Apache Pekko connectors.
Apache Pekko Projections also provides tools to track, restart and distribute these projections.
Apache Pekko Projections are documented at https://pekko.apache.org/docs/pekko-projection/current/.
To keep up with the latest releases check out Pekko Projections releases.
You can join these forums and chats to discuss and ask Pekko and Pekko connector related questions:
Contributions are very welcome. If you have an idea on how to improve Pekko, don't hesitate to create an issue or submit a pull request.
Apache Pekko Projections is available under the Apache License, version 2.0. See LICENSE file for details.