Task #11091 (new)
Refactor hierarchy-walking in latest Blitz FS code
|Reported by:||mtbcarroll||Owned by:||mtbcarroll|
https://github.com/openmicroscopy/openmicroscopy/pull/1214 and https://github.com/openmicroscopy/openmicroscopy/pull/1235 introduce code that works well but could perform better.
Step One of this ticket's effort is that a HierarchyNavigator utility class could be factored out of most of Preprocessor except process() and then used by PojosImpl.getImagesBySplitFilesets; this class would understand the various hierarchies and walks them well by populating the query cache using HQL queries more like jamoore's Preprocessor code in retrieving both sides of the relation while using the new IN-clause batching now in PojosImpl. This is only a couple of days' work, including unit tests; I hope to fit it into the cleanup that follows the FS RC being in good enough shape for Paris, so that good query batching gets into the final 5.0 release. Once that is solved, perhaps this ticket can move to the "Cleanup" milestone.
Step Two-Alpha would be to also review jamoore's Hierarchy to identify points of commonality and perhaps to have one class use the other or to simply unify them.
Step Two-Beta is to reconsider the API. Preprocessor is happy representing hierarchy levels in an enum and working with object id properties in projections that are hopefully lightweight database queries and Java Collections that are hopefully small objects (just an enum instance and a long) that are fast to work with; the relevant code in PojosImpl also works with IDs but discussion on #11019 may change that (and resolution of that question should block this step). It's possible that this new HierarchyNavigator class should eventually be using actual class values or even (partially hydrated?) objects instead of enum-ID tuples, in the API and maybe internally too.