]
Sebastian Łaskawiec closed ISPN-6414.
-------------------------------------
Hybrid query + compat mode applies type conversion too early (perf
issue)
-------------------------------------------------------------------------
Key: ISPN-6414
URL:
https://issues.jboss.org/browse/ISPN-6414
Project: Infinispan
Issue Type: Bug
Components: Remote Querying
Affects Versions: 8.2.0.Final
Reporter: Adrian Nistor
Assignee: Adrian Nistor
Fix For: 8.2.1.Final, 9.0.0.Alpha1, 9.0.0.Final
To reproduce we need a compat mode cache and a remote hybrid query or any query that is
executed in two phases (indexed + non indexed). The type conversion interceptor will
convert the result of the first phase (from Java object to protobuf) and then the second
phase will execute a matcher on the protobuf output of the first phase.
This can be optimized by avoiding early type conversion. The output of the first phase
should produce unconverted results, ie. java objects. Then the second phase matcher should
filter on these objects (ReflectionMatcher). These results are then implicitly
type-converted when are marshalled back to the client, but the type converter interceptor
is no longer involved. To avoid type conversion kicking in early we need to stop obtaining
the cache using the Flag.OPERATION_HOTROD in
org.infinispan.query.remote.impl.LifecycleManager, and then there are some other places in
RemoteQueryEngine and friends that need to be adjusted following this change.