[HUDI-1122] Introduce a kafka implementation of hoodie write commit ca…#1886
[HUDI-1122] Introduce a kafka implementation of hoodie write commit ca…#1886yanghua merged 2 commits intoapache:masterfrom
Conversation
|
@yanghua please take a look when free |
916cf08 to
6cc6bd5
Compare
yanghua
left a comment
There was a problem hiding this comment.
@Mathieu1124 Thanks for your contribution. Left some comments you can consider. Did you test this feature in your local?
There was a problem hiding this comment.
If you do not want to add the comments for @param and @return. Just remove them.
There was a problem hiding this comment.
If you do not want to add the comments for
@paramand@return. Just remove them.
yes, will remove it
There was a problem hiding this comment.
I am thinking one thing: the config options of the callback feature for Kafka are left in hudi-client, while the implementation hosts in hudi-utilities, if it's suitable.
There was a problem hiding this comment.
I am thinking one thing: the config options of the callback feature for Kafka are left in
hudi-client, while the implementation hosts inhudi-utilities, if it's suitable.
It is truly a problem. since kafka callback implementation is placed in hudi-utilities, the config should be there too. will move it
There was a problem hiding this comment.
Shall we use try-with-resource or try-catch block to prevent leaking resources?
There was a problem hiding this comment.
Shall we use
try-with-resourceortry-catchblock to prevent leaking resources?
yes, will do
There was a problem hiding this comment.
IMO, moving the content of this class into HoodieWriteCommitKafkaCallback is reasonable. WDYT?
There was a problem hiding this comment.
IMO, moving the content of this class into
HoodieWriteCommitKafkaCallbackis reasonable. WDYT?
I once hesitated here, kind of messy to host in one class. But it is reasonable, will move
Yes, I tested it in my local, it works good. |
c6cf2ed to
4fd9416
Compare
There was a problem hiding this comment.
If users configure http callback? Why we only consider Kafka callback here?
There was a problem hiding this comment.
If users configure http callback? Why we only consider Kafka callback here?
the config of http callback will be Initialized when HoodieWriteClient set up, while kafka's can't. the kafka's config can only be set up in hudi-utilities module, so the logic above come up.
|
Hi @vinothchandar, I was wondering can we move this implement to hudi-client module just like the way all the implementations of metrics does. put this implementation in hudi-utilities, the Spark API(hudi-spark moudle) can not benefit from it. besides, in the future, when the flink engine merged in , it can not use it either. |
|
@yanghua VC seems busy, do you have any other concern about this pr ? |
|
As the RM sent out the note, we are only landing small PRs and release blockers, so we can keep master stable for cutting the 0.6.0 RC. Apologize for the inconvenience. |
I think we can move this down the line. |
ok |
3a549b3 to
79f73ba
Compare
yanghua
left a comment
There was a problem hiding this comment.
@wangxianghu Left some new comments.
| */ | ||
| public static String convertToJsonString(Object obj) { | ||
| // convert to json | ||
| ObjectMapper mapper = new ObjectMapper(); |
There was a problem hiding this comment.
Can we make this variable static to be shared in the whole class?
| producer.send(record); | ||
| LOG.info(String.format("Send callback message %s succeed", callbackMsg)); | ||
| } catch (Exception e) { | ||
| LOG.error("Send kafka callback msg failed : " + e); |
There was a problem hiding this comment.
LOG.error("Send kafka callback msg failed : ",e);
| kafkaProducerProps.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, | ||
| "org.apache.kafka.common.serialization.StringSerializer"); | ||
|
|
||
| LOG.info("Callback kafka producer init with configs: " |
| props.getProperty(TABLE_NAME), | ||
| callbackMsg); | ||
| } else { | ||
| return new ProducerRecord<String, String>(topic, |
There was a problem hiding this comment.
Maybe we do not need to break the lines here?
yanghua
left a comment
There was a problem hiding this comment.
@wangxianghu Thanks for addressing my concerns. LGTM, will merge it if CI is OK.
@wangxianghu Please follow vc's suggestion, file a Jira issue to track the future work. |
@yanghua thanks for your time. The ticket filed here: https://issues.apache.org/jira/browse/HUDI-1207 |
…llback
Tips
What is the purpose of the pull request
Introduce a kafka implementation of hoodie write commit callback
Brief change log
(for example:)
Verify this pull request
(Please pick either of the following options)
This pull request is a trivial rework / code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.