[
https://issues.apache.org/jira/browse/GOBBLIN-1783?focusedWorklogId=844481&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-844481
]
ASF GitHub Bot logged work on GOBBLIN-1783:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 09/Feb/23 00:47
Start Date: 09/Feb/23 00:47
Worklog Time Spent: 10m
Work Description: umustafi opened a new pull request, #3640:
URL: https://github.com/apache/gobblin/pull/3640
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I
have checked off all the steps below!
### JIRA
- [X] My PR addresses the following [Gobblin
JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references
them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
- https://issues.apache.org/jira/browse/GOBBLIN-1783
### Description
- [X] Here are some details about my PR, including screenshots (if
applicable):
We seek to improve initialization time of the `GobblinServiceJobScheduler`
upon restart or new leadership change by batching the mysql queries to get flow
specs. Instead of making 1 mysql get call for each flow execution id, which
scales extremely poorly with number of flows, we should group them to reduce
number of calls and downtime.
This implementation adds two new functions to the `SpecStore` interface,
`getSortedSpecURIs` and `getBatchedSpecs`, that we use to achieve the batching.
Because these two functionalities are generic enough to be used in derived
classes of the `SpecStore` we add them to the base class. Although this
requires any child classes to implement these functions, it allows any consumer
of the parent class `SpecStore` to use this functionality without caring about
the specific implementation of the `SpecStore` used (as
`GobblinServiceJobScheduler` does). Additionally, the `getBatchedSpecs`
requires an `offset` or starting point to obtain the batches from so the
consumer has to do some book keeping of where in the paginated gets we are but
this again separates the functionality from the use case of the consumer. the
entirety of the flow catalog is too large to load into memory for the
`GobblinServiceJobScheduler`, so we use this batch functionality.
### Tests
- [X] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
The main testing for this functionality will be empirical testing to
determine the batch size which results in decreasing the time needed for all
the gets above. In general, the time should go down with a larger batch size
but there may be an inflection point where we see diminishing returns or the
memory required to store a large batch is excessive. I propose testing with
batch size 100, 250, and 750 incrementally and using the time metrics emitted
to settle on an appropriate size.
### Commits
- [X] My commits all reference JIRA issues in their subject lines, and I
have squashed multiple commits if they address the same issue. In addition, my
commits follow the guidelines from "[How to write a good git commit
message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"
Issue Time Tracking
-------------------
Worklog Id: (was: 844481)
Remaining Estimate: 0h
Time Spent: 10m
> Initialize scheduler with batch gets instead of individual get per flow
> -----------------------------------------------------------------------
>
> Key: GOBBLIN-1783
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1783
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-service
> Reporter: Urmi Mustafi
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We seek to improve initialization time of the JobScheduler upon restart or
> new leadership change by batching the mysql queries to get flow specs.
> Instead of making 1 mysql get call for each flow execution id, which scales
> extremely poorly with number of flows, we should group them to reduce number
> of calls and downtime.
> This implementation adds two new functions to the SpecStore interface,
> getSortedSpecURIs and getBatchedSpecs, that we use to achieve the batching.
> Because these two functionalities are generic enough to be used in derived
> classes of the SpecStore we add them to the base class. Although this
> requires any child classes to implement these functions, it allows any
> consumer of the parent class SpecStore to use this functionality without
> caring about the specific implementation of the SpecStore used (as
> JobScheduler does). Additionally, the getBatchedSpecs requires an offset or
> starting point to obtain the batches from so the consumer has to do some book
> keeping of where in the paginated gets we are but this again separates the
> functionality from the use case of the consumer. the entirety of the flow
> catalog is too large to load into memory for the Scheduler, so we use this
> batch functionality.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)