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

feat(java datahub-client): add Java REST emitter #3781

Merged
merged 31 commits into from
Jan 2, 2022
Merged

feat(java datahub-client): add Java REST emitter #3781

merged 31 commits into from
Jan 2, 2022

Conversation

MugdhaHardikar-GSLab
Copy link
Contributor

@MugdhaHardikar-GSLab MugdhaHardikar-GSLab commented Dec 21, 2021

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@github-actions
Copy link

github-actions bot commented Dec 21, 2021

Unit Test Results

     48 files  +  3       48 suites  +3   48m 44s ⏱️ + 6m 30s
   661 tests +14     609 ✔️ +14  52 💤 ±0  0 ±0 
1 467 runs  +14  1 399 ✔️ +14  68 💤 ±0  0 ±0 

Results for commit a73866a. ± Comparison against base commit 450cdc1.

♻️ This comment has been updated with latest results.

@@ -22,33 +22,47 @@
public class RESTEmitter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call this just "RestEmitter" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Please review.

private static final int DEFAULT_CONNECT_TIMEOUT_SEC = 30;
private static final int DEFAULT_READ_TIMEOUT_SEC = 30;


@Getter
private final String gmsUrl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the format of this URL? We should also rename to be "serverUrl" because we are trying to move away from calling the Metadata Service "gms"

@@ -40,3 +40,4 @@ include 'docs-website'
include 'metadata-models-custom'
include 'entity-registry:custom-test-model'
include 'spark-lineage'
include 'metadata-integration:java:datahub-client'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there 3 levels of package here? There should be just 2.

Alternatively we can just have a top-level "datahub-client" package

Copy link
Contributor Author

@MugdhaHardikar-GSLab MugdhaHardikar-GSLab Dec 23, 2021

Choose a reason for hiding this comment

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

Keeping it as is after considering slack discussion


private void emit(List<MetadataChangeProposal> mcps) {
RESTEmitter emitter = emitter();
RestEmitter emitter = emitter();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should ideally use a batch emit for this. @aseembansal-gogo is working on that API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please point me to the API documentation, will integrate it.

return new RestEmitter(gmsUrl, DEFAULT_CONNECT_TIMEOUT_SEC, DEFAULT_READ_TIMEOUT_SEC, null);
}

public static RestEmitter create(String gmsUrl, int connectTimeoutSec, int readTimeoutSec) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming we have unit tests for this class (and McpEmitter?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have unit tests at spark-lineage level which covers both of these classes.

* A class that makes it easy to create new {@link MetadataChangeProposal} events
* @param <T>
*/
@JsonDeserialize(builder = MetadataChangeProposalWrapper.MetadataChangeProposalWrapperBuilder.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

no longer needed as we are not using pure jackson to serialize anymore.

T aspect;
String aspectName;

@JsonPOJOBuilder(withPrefix = "")
Copy link
Contributor

Choose a reason for hiding this comment

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

no longer needed as we're not using pure jackson to serialize anymore

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit c65609a into datahub-project:master Jan 2, 2022
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