Skip to content
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

[GOBBLIN-2136] consolidate various resource handlers for flowconfigs #4041

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

arjun4084346
Copy link
Contributor

@arjun4084346 arjun4084346 commented Aug 29, 2024

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

Description

  • Here are some details about my PR, including screenshots (if applicable):
    a)
    Merged FlowConfigsResourceHandler, FlowConfigV2ResourceLocalHandler, FlowConfigResourceLocalHandler, FlowConfigsV2ResourceHandler, GobblinServiceFlowConfigResourceHandler, GobblinServiceFlowConfigV2ResourceHandler, GobblinServiceFlowConfigV2ResourceHandlerWithWarmStandby into FlowConfigsResourceHandlerFlowConfigsV2ResourceHandler

Merged FlowExecutionResourceLocalHandler, GobblinServiceFlowExecutionResourceHandler, GobblinServiceFlowExecutionResourceHandlerWithWarmStandby into FlowExecutionResourceHandler

Merged FlowConfigClient into FlowConfigV2Client along with their test classes

b)
Removed Helix and EventBus related code from GaaS

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    no functiotnality changes

Commits

  • 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":
    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"

@arjun4084346 arjun4084346 force-pushed the goodbyedagmanager branch 2 times, most recently from 7c8d1cc to 45e2ff4 Compare August 29, 2024 22:55
@arjun4084346 arjun4084346 force-pushed the goodbyedagmanager branch 3 times, most recently from 6d04dbd to da9730a Compare September 8, 2024 01:26
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.28%. Comparing base (45ad13e) to head (6ef073a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4041      +/-   ##
============================================
+ Coverage     45.12%   50.28%   +5.16%     
- Complexity     3199     5912    +2713     
============================================
  Files           705     1073     +368     
  Lines         26949    41240   +14291     
  Branches       2680     4633    +1953     
============================================
+ Hits          12160    20739    +8579     
- Misses        13781    18724    +4943     
- Partials       1008     1777     +769     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arjun4084346 arjun4084346 changed the title Goodbyedagmanager [GOBBLIN-2136] consolidate various resource handlers for flowconfigs Sep 9, 2024
Comment on lines 114 to 116
protected void assignTopicPartitions() {
// Expects underlying consumer to handle initializing partitions and offset for the topic -
// subscribe to all partitions from latest offset
Copy link
Contributor

@phet phet Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit fuzzy on this (and wondering whether it should be an abstract method).

if the empty but concrete impl is actually what we want, is it possible to identify the specific method involved in the "underlying consumer"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the implementations of HLC except this one needs this method and this is implemented in HLC.



@Slf4j
public class FlowExecutionResourceHandler implements FlowExecutionResourceHandlerInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javadoc?

also, the diff isn't showing this as a rename, but is that what it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added javadoc. github issues

@Slf4j
public class FlowConfigResourceLocalHandler implements FlowConfigsResourceHandler {
public class FlowConfigsV2ResourceHandler {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not implement a FlowConfigsV2ResourceHandlerInterface, like flowExecutions does?

Copy link
Contributor Author

@arjun4084346 arjun4084346 Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Unlike FlowConfigsV2ResourceHandler, FlowExecutionResourceHandlerInterface is an interface rather than a class because it's implementation needs
// classes from gobblin-service module, and adding gobblin-service as a dependency will cause circular dependency

now i am thinking to move FlowExecutionResource that needs it to gobblin-service module, so I can get rid of FlowExecutionResourceHandlerInterface. wdyt?

// We have modifiedWatermark here to avoid update config happens at the same time on different hosts overwrite each other
// timestamp here will be treated as largest modifiedWatermark that we can update
long version = System.currentTimeMillis() / 1000;
return updateFlowConfig(flowId, flowConfig, version);
}

public UpdateResponse updateFlowConfig(FlowId flowId,
FlowConfig flowConfig, long modifiedWatermark) throws FlowConfigLoggedException {
private UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig, long modifiedWatermark) throws FlowConfigLoggedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised to see this private when the interface had this public

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it did not exist in older FlowConfigsResourceHandler interface. it could be private so changed it to private

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I missed that this overloads the method that IS in the interface, but just w/o the long modifiedWatermark

Copy link
Contributor

@phet phet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work here arjun!

// We have modifiedWatermark here to avoid update config happens at the same time on different hosts overwrite each other
// timestamp here will be treated as largest modifiedWatermark that we can update
long version = System.currentTimeMillis() / 1000;
return updateFlowConfig(flowId, flowConfig, version);
}

public UpdateResponse updateFlowConfig(FlowId flowId,
FlowConfig flowConfig, long modifiedWatermark) throws FlowConfigLoggedException {
private UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig, long modifiedWatermark) throws FlowConfigLoggedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I missed that this overloads the method that IS in the interface, but just w/o the long modifiedWatermark

@arjun4084346 arjun4084346 merged commit 833fed3 into apache:master Sep 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants