-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OGM-767 Add support for @BatchSize in OGM #564
Conversation
Will you send another PR for actually implementing |
else { | ||
for ( EntityKey entityKey : keys ) { | ||
// TODO use the multiload API once introduced | ||
Tuple entry = gridDialect.getTuple( entityKey, persister.getTupleContext() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be doable now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, removing.
@emmanuelbernard: Done with the review. My main concern are the remaining to-dos:
What is the "legacy" stuff about? Didn't fully grok that. I'd vote for doing as less as possible on the OGM side and push back the required changes to ORM. |
@@ -59,6 +61,14 @@ public Tuple getTuple(EntityKey key, TupleContext tupleContext) { | |||
} | |||
|
|||
@Override | |||
public List<Tuple> getTuples(EntityKey[] keys, TupleContext tupleContext) { | |||
if ( log.isTraceEnabled() ) { | |||
log.tracef( "Reading tuple with keys %1$s and context %2$s", Arrays.toString( keys ), tupleContext ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tuples"
I was planning on other people to give a hand :) |
Disabled all but one strategy for the MVP Introduce ability to customize how the inner loader is built as OGM and ORM have different loaders. Introduce notion of BatchableEntityLoader to abstract OgmLoader, the legacy EntityLoader and plan.EntityLoader. Methods of this interface is to be moved to UniqueEntityLoader when moving things back to ORM.
Add support for accepting several ids in OgmLoader (for entities). Make OgmEntityPersister use the batch fetching framework to build batching loaders. Adapt OgmLoader creators to instead get their instances from OgmEntityPersister
No dialect is currently making use of it
…getGridDialect This avoid skewing the ORM fetch statistics
It was only containing a single entry per call to the loader The compiler might be able to optimize better now that one call happens
…od is used Make sure getTuples is effectively used when expected basically
MultigetGridDialect don't provide the right params to build prepared statements ahead of time. Also no dialect have this specific need.
@gunnarmorling I've fixed a lot of the remarks and todos form OGM-767. You can review the major changes starting at 91adb76 |
Only for entities for now. Will come in a different issue and PR for later:
The "legacy" and default batching strategy is not implemented yet as it requires yet another big pile of code duplication and is almost like the padded one. I'm tempted to not implement it and wait for the batch fetching framework improvements to be moved back to ORM to benefit them.
Also no dialect currently make use of
MultigetGridDialect
but that is hopefully easier to do that the core enablement of this PR.95% because of the legacy batching strategy. Hence feedback season is opened.