Merge lp:~abentley/launchpad/efficient-universal-source into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | j.c.sackett on 2012-04-26 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15170 |
| Proposed branch: | lp:~abentley/launchpad/efficient-universal-source |
| Merge into: | lp:launchpad |
| Prerequisite: | lp:~abentley/launchpad/celery-everywhere-9 |
| Diff against target: |
207 lines (+47/-63) 6 files modified
lib/lp/code/model/tests/test_branchjob.py (+2/-2) lib/lp/services/job/model/job.py (+19/-54) lib/lp/services/job/runner.py (+8/-1) lib/lp/services/job/tests/test_job.py (+12/-6) lib/lp/translations/model/pofilestatsjob.py (+3/-0) lib/lp/translations/model/translationsharingjob.py (+3/-0) |
| To merge this branch: | bzr merge lp:~abentley/launchpad/efficient-universal-source |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-04-26 | Approve on 2012-04-26 | |
|
Review via email:
|
|||
Commit Message
Optimize UniversalJobSource
Description of the Change
= Summary =
Make UniversalJobSource more efficient
== Proposed fix ==
Provide database user name, database class module and database class name as part of the job_id.
== Pre-implementation notes ==
None
== LOC Rationale ==
Removes code
== Implementation details ==
Provide this database username as part of the "ujob_id". This means that the correct database user can be set immediately, instead of first doing a lookup of the job to determine the database user. It also means that clearStore can be folded into the get method, since it's only done once.
Provide the name and module name of the database job class (one which refers to a Job, e.g. BranchJob) as part of the ujob_id. Combined with providing the dbuser above, this means that getUserAndBaseJob is obsolete. The database table cannot be used for this purpose, because AFAICT Storm permits multiple classes to use a given table.
Extract rawGet from _getDerived
Update getUserAndBaseJob test to use rawGet instead.
Implement getDBClass methods on all derived job classes. This is needed because a few job types don't have a 'context' member which is a database class.
== Tests ==
bin/test --layer=
== Demo and Q/A ==
None
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/

This looks good; thanks for removing code.