You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/07/15 21:37:25 UTC

[GitHub] [incubator-gobblin] htran1 commented on a change in pull request #2686: [GOBBLIN-825] Initialize message schema at object construction rather than creating a new instance for every message

htran1 commented on a change in pull request #2686: [GOBBLIN-825] Initialize message schema at object construction rather than creating a new instance for every message
URL: https://github.com/apache/incubator-gobblin/pull/2686#discussion_r303647832
 
 

 ##########
 File path: gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/reporter/KeyValueEventObjectReporter.java
 ##########
 @@ -83,17 +81,24 @@ public KeyValueEventObjectReporter(Builder builder) {
           "Key not assigned from config. Please set it with property {} Using randomly generated number {} as key ",
           ConfigurationKeys.METRICS_REPORTING_EVENTS_PUSHERKEYS, randomKey);
     }
+
+    schema = AvroUtils.overrideNameAndNamespace(GobblinTrackingEvent.getClassSchema(), builder.topic, builder.namespaceOverride);
   }
 
   @Override
   public void reportEventQueue(Queue<GobblinTrackingEvent> queue) {
-    log.info("Emitting report using KeyValueEventObjectReporter");
 
     List<Pair<String, GenericRecord>> events = Lists.newArrayList();
     GobblinTrackingEvent event;
 
     while (null != (event = queue.poll())) {
-      GenericRecord record = AvroUtils.overrideNameAndNamespace(event, this.topic, this.namespaceOverride);
+
+      GenericRecord record=event;
+      try {
+        record = AvroUtils.convertRecordSchema(event, schema);
 
 Review comment:
   This conversion is expensive to do on every event. This is the same behavior as today, so it is not making things worse, but we should consider supporting pluggable compiled schemas to avoid the need to override the namespace.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services