-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-2752: Add VerifiableSource/Sink connectors and rolling bounce Copycat system tests. #432
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b9b8350
KAFKA-2752: Add VerifiableSource/Sink connectors and rolling bounce C…
ewencp 0fe6789
Address review comments.
ewencp 00016d8
Add debugging support by collecting a dump of the topic in case of fa…
ewencp 7a176e7
Increase log level to DEBUG for Copycat services since this level wil…
ewencp dd9d41e
KAFKA-2713: Run task start and stop methods in worker threads so they…
ewencp 9ef8212
Merge remote-tracking branch 'origin/trunk' into kafka-2752-copycat-c…
ewencp 73ca190
Merge remote-tracking branch 'origin/trunk' into kafka-2752-copycat-c…
ewencp 4846bc2
Merge remote-tracking branch 'origin/trunk' into kafka-2752-copycat-c…
ewencp 551c640
Fix connect:tools build settings.
ewencp 2654531
Merge remote-tracking branch 'origin/trunk' into kafka-2752-copycat-c…
ewencp 8a1e5d6
Merge remote-tracking branch 'origin/trunk' into kafka-2752-copycat-c…
ewencp 9454aa2
Fix leftover copycat reference.
ewencp 8faf12a
Replace clean_node implementation with more aggressive implementation…
ewencp cee0ee1
Fix typo in log4j settings file.
ewencp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
connect/tools/src/main/java/org/apache/kafka/connect/tools/VerifiableSinkConnector.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /** | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| **/ | ||
|
|
||
| package org.apache.kafka.connect.tools; | ||
|
|
||
| import org.apache.kafka.common.utils.AppInfoParser; | ||
| import org.apache.kafka.connect.connector.Task; | ||
| import org.apache.kafka.connect.source.SourceConnector; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * @see VerifiableSinkTask | ||
| */ | ||
| public class VerifiableSinkConnector extends SourceConnector { | ||
| private Map<String, String> config; | ||
|
|
||
| @Override | ||
| public String version() { | ||
| return AppInfoParser.getVersion(); | ||
| } | ||
|
|
||
| @Override | ||
| public void start(Map<String, String> props) { | ||
| this.config = props; | ||
| } | ||
|
|
||
| @Override | ||
| public Class<? extends Task> taskClass() { | ||
| return VerifiableSinkTask.class; | ||
| } | ||
|
|
||
| @Override | ||
| public List<Map<String, String>> taskConfigs(int maxTasks) { | ||
| ArrayList<Map<String, String>> configs = new ArrayList<>(); | ||
| for (Integer i = 0; i < maxTasks; i++) { | ||
| Map<String, String> props = new HashMap<>(config); | ||
| props.put(VerifiableSinkTask.ID_CONFIG, i.toString()); | ||
| configs.add(props); | ||
| } | ||
| return configs; | ||
| } | ||
|
|
||
| @Override | ||
| public void stop() { | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this correct? currentTimeNs is never updated and hence always the same as sleepStartNs.
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, it was not correct. Good catch! I've fixed it and validated correctness by running ProducerPerformance manually.