-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(client): support admin operations in Java client #5671
Merged
vcrfxia
merged 11 commits into
confluentinc:master
from
vcrfxia:java-client-admin-operations
Jun 24, 2020
+756
−15
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
37af3d4
feat: support listing streams/table from Java client (wip)
vcrfxia b67a6f0
chore: finish implementing list streams
vcrfxia 5a8e501
refactor: prep for other methods
vcrfxia e541855
test: add tests for list streams
vcrfxia bf8e886
feat: support list tables
vcrfxia d6ee218
feat: support list topics
vcrfxia 7466c72
test: add error response test for list topics
vcrfxia 33e2c67
chore: checkstyle
vcrfxia d5dbc34
docs: javadocs
vcrfxia 2456569
Merge branch 'master' into java-client-admin-operations
vcrfxia 97e17f6
chore: feedback
vcrfxia 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
feat: support list topics
- Loading branch information
commit d6ee218dd8ddad625a9a73598dddb65081ddcfc2
There are no files selected for viewing
This file contains 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
28 changes: 28 additions & 0 deletions
28
ksqldb-api-client/src/main/java/io/confluent/ksql/api/client/TopicInfo.java
This file contains 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,28 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (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.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql.api.client; | ||
|
||
import java.util.List; | ||
|
||
public interface TopicInfo { | ||
|
||
String getName(); | ||
|
||
int getPartitions(); | ||
|
||
List<Integer> getReplicasPerPartition(); | ||
|
||
} |
This file contains 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 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 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
48 changes: 48 additions & 0 deletions
48
ksqldb-api-client/src/main/java/io/confluent/ksql/api/client/impl/TopicInfoImpl.java
This file contains 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,48 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (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.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql.api.client.impl; | ||
|
||
import io.confluent.ksql.api.client.TopicInfo; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class TopicInfoImpl implements TopicInfo { | ||
|
||
private final String name; | ||
private final int partitions; | ||
private final List<Integer> replicasPerPartition; | ||
|
||
TopicInfoImpl(final String name, final int partitions, final List<Integer> replicasPerPartition) { | ||
this.name = Objects.requireNonNull(name); | ||
this.partitions = partitions; | ||
this.replicasPerPartition = Objects.requireNonNull(replicasPerPartition); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public int getPartitions() { | ||
return partitions; | ||
} | ||
|
||
@Override | ||
public List<Integer> getReplicasPerPartition() { | ||
return replicasPerPartition; | ||
} | ||
} |
This file contains 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 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
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.
generally worth having equals/hashcode/tostring on externally exposed classes so that people can leverage them if they want to
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.
To make sure I understand correctly: you're suggesting we add equals/hashcode/tostring methods to each of the implementation classes, not the interfaces, right? This makes sense to me, though I'm not sure whether it makes more sense for the toString method to say
StreamInfoImpl{...}
orStreamInfo{...}
since the former is an implementation detail, but the latter is a bit misleading.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.
Hmm, good point - I'm satisfied with
StreamInfo
because I dont' think we expect more than just this implThere 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.
Sounds good. I'm going to merge this PR and then open a follow-up to add equals/hashcode/tostring to all the client interfaces, since none of the new interfaces have them (not just the ones in this PR).
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.
Here's the follow-up: #5681