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-278] Fix sending lineage event for KafkaSource #2131

Closed
wants to merge 2 commits into from

Conversation

zxcware
Copy link
Contributor

@zxcware zxcware commented Oct 6, 2017

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):
    • Fix lineage event for KafkaSource not send, and void resending the events by removing configurations with key prefix gobblin.lineage from the state
    • Fix KafkaWorkUnitPacker disregards existing configurations of work units

Tests

  • My PR adds the following unit tests
    • State#testRemovePropsByPrefix

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"

@zxcware
Copy link
Contributor Author

zxcware commented Oct 6, 2017

@yukuai518 Please review

@@ -538,17 +540,18 @@ private WorkUnit getWorkUnitForTopicPartition(KafkaPartition partition, Offsets
}

WorkUnit workUnit = WorkUnit.create(extract);
if (topicSpecificState.isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is duplicate logic to line 239

*
* @param keyPrefix key prefix
*/
public void removeProps(String keyPrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename this to removePropsWithPrefix? The current name is too easy to mess up as a typo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

}
WorkUnit workUnit = WorkUnit.create(extract, interval);
// Squeeze all partitions from the multiWorkUnit into of one the work units, which can be any one
WorkUnit workUnit = multiWorkUnit.getWorkUnits().get(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this to preserve properties from the workunit by using an existing workunit instead of creating a new one? Will removing the properties below affect other places that access this workunit?

Would it be safer and sufficient to create a new workunit and copy the properties over from the first work unit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this to preserve properties from the workunit by using an existing workunit instead of creating a new one?

Yes.

Will removing the properties below affect other places that access this workunit?

No. Because these properties are either ignored or replaced by the configurations immediately set below.

Would it be safer and sufficient to create a new workunit and copy the properties over from the first work unit?

No. We do need to remove those properties. Otherwise, the logic won't be the same as before. And all work units of in the same multi work unit have the same properties but those that are removed and extractid.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant copy then remove from the copy. But if it is safe then you can remove directly.

@zxcware
Copy link
Contributor Author

zxcware commented Oct 6, 2017

@htran1 @yukuai518 Comments addressed, please review.

Copy link
Contributor

@htran1 htran1 left a comment

Choose a reason for hiding this comment

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

+1.

@asfgit asfgit closed this in d2e4354 Oct 10, 2017
@zxcware zxcware deleted the lineage branch October 13, 2017 22:47
zxliucmu pushed a commit to zxliucmu/incubator-gobblin that referenced this pull request Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants