KAFKA-8231: Expansion of ConnectClusterState interface#6584
Conversation
|
Rebased on current |
|
Blocked by KAFKA-8304, a fix for which is currently underway at #6651 |
…tClusterDetails interface and implementation
|
Unblocked as a fix for KAFKA-8304 has been merged. Now ready for review. |
|
@rhauch now that the KIP has been accepted, would you mind taking a look and reviewing these changes? |
kkonstantine
left a comment
There was a problem hiding this comment.
Thanks @C0urante !
Looks pretty good overall. Left a few minor comments.
|
|
||
| import org.apache.kafka.connect.health.ConnectClusterDetails; | ||
|
|
||
| public class ConnectClusterDetailsImpl implements ConnectClusterDetails { |
There was a problem hiding this comment.
Still a javadoc would be nice, stating that this is a basic/simple implementation of ConnectClusterDetails meant to be used for ... etc
There was a problem hiding this comment.
There isn't a matching javadoc on the ConnectClusterStateImpl class and I'm not sure it'd be too useful to add one here. If we mention that it's explicitly for use in REST extensions, that information may become outdated if/when the class is used elsewhere. There's pretty sufficient detail on the behavior of the class provided in the javadocs for the interface it implements. I don't think there's anything non-obvious that needs to be documented about this class.
There was a problem hiding this comment.
Not a blocker for me, but I think any javadoc is better than no javadoc for a class or an interface.
At the class level, the javadoc is not inherited by the base class (as when @Override is used in methods). So the presence of javadoc in the interface but not here does not save us the extra hoop. In any case, I mentioned since this is a small PR and I think it's a good practice (that at least I try to follow as much as possible). Not a blocker for this PR.
| final Map<String, String> expectedConfig = Collections.singletonMap("key", "value"); | ||
| Capture<Callback<Map<String, String>>> callback = EasyMock.newCapture(); | ||
| herder.connectorConfig(EasyMock.eq(connName), EasyMock.capture(callback)); | ||
| EasyMock.expectLastCall().andAnswer(new IAnswer<Void>() { |
There was a problem hiding this comment.
should we start writing those as lambdas for the new code (the code that is not meant to be backported prior to 2.0?)
There was a problem hiding this comment.
I wouldn't mind altering these to be lambdas but it'd be better if we could backport that change to 2.0 to avoid any merge conflicts down the road if a bug fix is discovered that needs to be backported that far as well. Since this PR is targeted at 2.3 I think we should hold off on making those changes here.
There was a problem hiding this comment.
I was referring only to the newly introduced methods and their tests. Not the whole class. Not a big issue.
There was a problem hiding this comment.
I think introducing mixed style here would just cause minor confusion--why use lambdas for some test cases but not for others? It wouldn't be obvious to someone without looking through the git history of the class and maybe even this PR discussion.
|
Thank you for the review, @wicknicks and @kkonstantine! Konstantine--I've either responded to or made changes based off each of your comments; would appreciate a second round when you have time. |
kkonstantine
left a comment
There was a problem hiding this comment.
Thanks @C0urante!
The open discussions are not blockers.
LGTM
…es-14-May * AK_REPO/trunk: (24 commits) KAFKA-7321: Add a Maximum Log Compaction Lag (KIP-354) (apache#6009) KAFKA-8335; Clean empty batches when sequence numbers are reused (apache#6715) KAFKA-6455: Session Aggregation should use window-end-time as record timestamp (apache#6645) KAFKA-6521: Use timestamped stores for KTables (apache#6667) [MINOR] Consolidate in-memory/rocksdb unit tests for window & session store (apache#6677) MINOR: Include StickyAssignor in system tests (apache#5223) KAFKA-7633: Allow Kafka Connect to access internal topics without cluster ACLs (apache#5918) MINOR: Align KTableAgg and KTableReduce (apache#6712) MINOR: Fix code section formatting in TROGDOR.md (apache#6720) MINOR: Remove unnecessary OptionParser#accepts method call from PreferredReplicaLeaderElectionCommand (apache#6710) KAFKA-8352 : Fix Connect System test failure 404 Not Found (apache#6713) KAFKA-8348: Fix KafkaStreams JavaDocs (apache#6707) MINOR: Add missing option for running vagrant-up.sh with AWS to vagrant/README.md KAFKA-8344; Fix vagrant-up.sh to work with AWS properly MINOR: docs typo in '--zookeeper myhost:2181--execute' MINOR: Remove header and key/value converter config value logging (apache#6660) KAFKA-8231: Expansion of ConnectClusterState interface (apache#6584) KAFKA-8324: Add close() method to RocksDBConfigSetter (apache#6697) KAFKA-6789; Handle retriable group errors in AdminClient API (apache#5578) KAFKA-8332: Refactor ImplicitLinkedHashSet to avoid losing ordering when converting to Scala ...
Expand ConnectClusterState interface and implementation with methods that provide the immutable cluster details and the connector configuration. This includes unit tests for the new methods. Author: Chris Egerton <cegerton@oberlin.edu> Reviews: Arjun Satish <arjun@confluent.io>, Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>
Jira and KIP
The changes here add new methods to the
ConnectClusterStateinterface so that Connect REST extensions can be more aware of the current state of the Connect cluster they are added to. The new methods allow extensions to query for connector and task configurations, as well as the ID of the Kafka cluster targeted by the Connect cluster.All new methods have new unit tests added for their implementations in the
ConnectClusterStateImplclass.Committer Checklist (excluded from commit message)