Skip to content

Update emitter library and add support for ParametrizedUriEmitter#4722

Merged
leventov merged 8 commits intoapache:masterfrom
metamx:update-emitter
Sep 13, 2017
Merged

Update emitter library and add support for ParametrizedUriEmitter#4722
leventov merged 8 commits intoapache:masterfrom
metamx:update-emitter

Conversation

@leventov
Copy link
Copy Markdown
Member

  • Update emitter library from 0.4.5 to 0.6.0
  • Move emitters from io.druid.server.initialization to the dedicated package
  • Add support for ParametrizedUriEmitter (introduced in emitter 0.5.0)
  • Support hierarchical properties in JsonConfigurator (was needed for ParametrizedUriEmitter configs)
  • Log created RequestLoggers, for some debugging/operations visibility.

….druid.server.emitter package; Update emitter library to 0.6.0; Add support for ParametrizedUriEmitter; Support hierarical properties in JsonConfigurator (was needed for ParametrizedUriEmitter)

final Emitter emitter =
makeInjectorWithProperties(props).getInstance(Emitter.class);
System.out.println(emitter);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this left by mistake ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed

}
String nestedKey = property.substring(0, dotIndex);
Object nested = targetMap.computeIfAbsent(nestedKey, k -> new HashMap<String, Object>());
if (!(nested instanceof Map)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

given that targetMap passed is a method local object, why can't we simple do it like...

if (targetMap.containsKey(nestedKey)) {
..
} else {
  ..
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The value may be a Map or a String, !(nested instanceof Map) checks that the nested map couldn't be populated

@leventov
Copy link
Copy Markdown
Member Author

@himanshug could you please merge?

|`druid.emitter.http.flushMillis`|How often the internal message buffer is flushed (data is sent).|60000|
|`druid.emitter.http.flushCount`|How many messages the internal message buffer can hold before flushing (sending).|500|
|`druid.emitter.http.recipientBaseUrl`|The base URL to emit messages to. Druid will POST JSON to be consumed at the HTTP endpoint specified by this property.|none|
|`druid.emitter.http.basicAuthentication`|Login and password for authentification in "login:password" form, e. g. `druid.emitter.http.basicAuthentication=admin:adminpassword`|not specified = no authentification|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wish list: this to be a PasswordProvider

{
return new LoggingRequestLogger(mapper, setMDC, setContextMDC);
LoggingRequestLogger logger = new LoggingRequestLogger(mapper, setMDC, setContextMDC);
log.info(new Exception("Stack trace"), "Creating %s at", logger);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should these be debug level?

Copy link
Copy Markdown
Contributor

@drcrallen drcrallen left a comment

Choose a reason for hiding this comment

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

Minor comments at Author's discretion

@leventov please feel free to address or merge.

@himanshug
Copy link
Copy Markdown
Contributor

@leventov feel free to self merge when you're done.

@leventov leventov merged commit 267f415 into apache:master Sep 13, 2017
@leventov leventov deleted the update-emitter branch September 13, 2017 22:17
@jon-wei jon-wei added this to the 0.11.0 milestone Oct 18, 2017
nishantmonu51 added a commit to nishantmonu51/druid that referenced this pull request Jan 1, 2018
This was a regression introduced in
apache#4722

KafkaEmitterConfig property names have dot(.) in the name of properties
and JsonConfigurator behavior was changed to not support that.
Added a test and fixed parsing of properties that have dot(.) in
property names
jon-wei pushed a commit that referenced this pull request Jan 3, 2018
* Fix broken KafkaEmitterConfig parsing

This was a regression introduced in
#4722

KafkaEmitterConfig property names have dot(.) in the name of properties
and JsonConfigurator behavior was changed to not support that.
Added a test and fixed parsing of properties that have dot(.) in
property names

* Fix test failure
jon-wei pushed a commit to jon-wei/druid that referenced this pull request Jan 3, 2018
* Fix broken KafkaEmitterConfig parsing

This was a regression introduced in
apache#4722

KafkaEmitterConfig property names have dot(.) in the name of properties
and JsonConfigurator behavior was changed to not support that.
Added a test and fixed parsing of properties that have dot(.) in
property names

* Fix test failure
jon-wei added a commit that referenced this pull request Jan 4, 2018
* Fix broken KafkaEmitterConfig parsing

This was a regression introduced in
#4722

KafkaEmitterConfig property names have dot(.) in the name of properties
and JsonConfigurator behavior was changed to not support that.
Added a test and fixed parsing of properties that have dot(.) in
property names

* Fix test failure
gianm pushed a commit that referenced this pull request Jan 9, 2018
* Fix broken KafkaEmitterConfig parsing

This was a regression introduced in
#4722

KafkaEmitterConfig property names have dot(.) in the name of properties
and JsonConfigurator behavior was changed to not support that.
Added a test and fixed parsing of properties that have dot(.) in
property names

* Fix test failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants