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

Support Resource Configuration #20

Merged
merged 11 commits into from
Oct 11, 2018
Merged

Support Resource Configuration #20

merged 11 commits into from
Oct 11, 2018

Conversation

jeqo
Copy link
Contributor

@jeqo jeqo commented Oct 9, 2018

Entities like Topics and Brokers have additional configuration exposed via AdminClient#describeConfigs API.

The goal of this PR is to add support for these configuration as part of the events collected.

This will break compatibility with version 0.1, then once merged a new release 0.2 will be started.

src/main/protobuf/collector.proto Show resolved Hide resolved
src/main/protobuf/collector.proto Show resolved Hide resolved
@@ -15,11 +15,14 @@ import scala.concurrent.duration._

trait JsonSupport extends SprayJsonSupport with DefaultJsonProtocol {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be sealed because uses only in this class

Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather recommend change name from JsonSupport to smth else close to project naming convention (CollectorJsonProtocol) to differ from Spray library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree

@@ -89,7 +96,7 @@ class TopicManager(
*/
def handleTopicsCollected(topicsCollected: TopicsCollected): Unit = {
log.info(s"Handling ${topicsCollected.names.size} topics collected.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to log.info(s"Handling {} topics collected.", topicsCollected.names.size)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree

var topicsAndDescription: Map[String, Option[TopicDescription]] = Map()
var topics: Map[String, Option[Topic]] = Map()

implicit val timeout: Timeout = 5 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Could u add to javadoc info about timeout and why 5 secs? It is implicit value, so it used somewhere here in class (I guess its time out for Future completion).

manager ! TopicEvent("topic-1", TopicEvent.Event.TopicCreated(TopicCreated()))
manager ! TopicEvent("topic-2", TopicEvent.Event.TopicCreated(TopicCreated()))
manager ! TopicEvent("topic-3", TopicEvent.Event.TopicCreated(TopicCreated()))

// describe 2 internal
Copy link
Contributor

Choose a reason for hiding this comment

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

Dont forget also comments :) As I see now, U describe 2 NON-internal topic

manager ! TopicDescribed(("topic-2", TopicDescription(internal = true, List.empty)))
manager ! TopicDescribed(("topic-2", TopicDescription(internal = false, List.empty)))
eventRepositoryProbe.expectMsg(DescribeConfig(ResourceType.Topic, "topic-2"))
eventRepositoryProbe.reply(Config())
eventProducerProbe.expectMsgType[TopicEvent]
// describe 1 NOT internal
Copy link
Contributor

Choose a reason for hiding this comment

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

And opposite here U describe 1 INTERNAL topic

@jeqo jeqo changed the title [WIP] Support Resource Configuration Support Resource Configuration Oct 11, 2018
@jeqo jeqo merged commit 146fa8c into master Oct 11, 2018
@jeqo jeqo deleted the config branch October 11, 2018 12:13
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.

2 participants