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

Implmeneted data split for kafka message #708

Merged
merged 5 commits into from Oct 16, 2020

Conversation

jeongkyun-oh
Copy link
Contributor

@jeongkyun-oh jeongkyun-oh commented Oct 14, 2020

Proposed changes

  • Data split is implemented to publish Kafka message
  • Key is not implemented for deciding which partition the message is sent to
  • Header includes:
    • checksum for the data consistency
    • the number of total segments for a message
    • segment index

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

@yoomee1313
Copy link
Contributor

Could you please add some comments in TestKafka_split and TestKafka_makeProducerMessage function? It would be easier to understand the tests with more comments!

@jeongkyun-oh
Copy link
Contributor Author

jeongkyun-oh commented Oct 14, 2020

Could you please add some comments in TestKafka_split and TestKafka_makeProducerMessage function? It would be easier to understand the tests with more comments!

Alright. I will add some comments. e9e1d2a

@joowon-byun
Copy link
Contributor

I have some questions and comments.

  1. Why splitting is required in Kafka? What are the benefits?
  2. I think publishing segments in parallel can enhance speed.
  3. A data is sent by calling publish() one time, and is received by calling several subscribe(). How do we know if the received data is a splitted one? After receiving, the segments need to be combined into one.
    It would be nice to specify a protocol including data ID and segment number. Also, one publish() call should be correspond to one subscribe().

@jeongkyun-oh
Copy link
Contributor Author

I have some questions and comments.

  1. Why splitting is required in Kafka? What are the benefits?
  2. I think publishing segments in parallel can enhance speed.
  3. A data is sent by calling publish() one time, and is received by calling several subscribe(). How do we know if the received data is a splitted one? After receiving, the segments need to be combined into one.
    It would be nice to specify a protocol including data ID and segment number. Also, one publish() call should be correspond to one subscribe().

@winnie-byun Thanks for your comments.

  1. I've got the feedback that the large message would affect Kafka's performance badly. The benchmark said that the throughput would be worse if the larger messages are published logarithmically.
  2. The order would be important, so I think parallelism is not a good option.
  3. Yes, you're right. This PR includes only the producer part. The consumer part will be updated soon. The header includes all the information for resembling data (segment index, total segments, checksum). Do you think this is not enough? I will commit the data ID part as well in this PR. Also, Publish corresponds to Consume. Subscribe keeps consuming in a loop. What do you think?

cmd/utils/flags.go Outdated Show resolved Hide resolved
joowon-byun
joowon-byun previously approved these changes Oct 15, 2020
Copy link
Contributor

@joowon-byun joowon-byun left a comment

Choose a reason for hiding this comment

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

Thanks for the kind explaination. I didn't see makeProducerMessage before.
This code looks good to be :)

Copy link
Contributor

@KimKyungup KimKyungup left a comment

Choose a reason for hiding this comment

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

LGTM except minor comments

@jeongkyun-oh jeongkyun-oh merged commit 989e7a5 into klaytn:dev Oct 16, 2020
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.

None yet

7 participants