zxcware commented on a change in pull request #2622: [GOBBLIN-758] Added new
reporters to emit MetricReport and GobblinTrackingEvent without serializing
them. Also added random key generator for reporters.
URL: https://github.com/apache/incubator-gobblin/pull/2622#discussion_r280961171
##########
File path:
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/kafka/PusherUtils.java
##########
@@ -39,8 +41,26 @@ public static Pusher getPusher(String pusherClassName,
String brokers, String to
try {
Class<?> pusherClass = Class.forName(pusherClassName);
- return (Pusher)
GobblinConstructorUtils.invokeLongestConstructor(pusherClass,
- brokers, topic, config);
+ return (Pusher)
GobblinConstructorUtils.invokeLongestConstructor(pusherClass, brokers, topic,
config);
+ } catch (ReflectiveOperationException e) {
+ throw new RuntimeException("Could not instantiate kafka pusher", e);
+ }
+ }
+
+ /**
+ * Create a {@link KeyValuePusher}
+ * @param pusherClassName the {@link Pusher} class to instantiate
+ * @param brokers brokers to connect to
+ * @param topic the topic to write to
+ * @param config additional configuration for configuring the {@link Pusher}
+ * @return a {@link KeyValuePusher}
+ */
+ public static KeyValuePusher getKeyValuePusher(String pusherClassName,
String brokers, String topic,
Review comment:
This is redundant and can be removed. A `KeyValuePusher` is a `Pusher`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services