-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(java datahub-client): add Java REST emitter #3781
Conversation
@@ -22,33 +22,47 @@ | |||
public class RESTEmitter { |
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 we call this just "RestEmitter" ?
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.
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; |
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.
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' |
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.
Why is there 3 levels of package here? There should be just 2.
Alternatively we can just have a top-level "datahub-client" package
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.
Keeping it as is after considering slack discussion
|
||
private void emit(List<MetadataChangeProposal> mcps) { | ||
RESTEmitter emitter = emitter(); | ||
RestEmitter emitter = emitter(); |
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.
We should ideally use a batch emit for this. @aseembansal-gogo is working on that API
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.
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) { |
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.
I'm assuming we have unit tests for this class (and McpEmitter?)
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.
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) |
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.
no longer needed as we are not using pure jackson to serialize anymore.
T aspect; | ||
String aspectName; | ||
|
||
@JsonPOJOBuilder(withPrefix = "") |
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.
no longer needed as we're not using pure jackson to serialize anymore
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.
LGTM!
Checklist