[ https://issues.apache.org/jira/browse/GOBBLIN-1116?focusedWorklogId=423094&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-423094 ]
ASF GitHub Bot logged work on GOBBLIN-1116: ------------------------------------------- Author: ASF GitHub Bot Created on: 15/Apr/20 22:01 Start Date: 15/Apr/20 22:01 Worklog Time Spent: 10m Work Description: autumnust commented on pull request #2956: GOBBLIN-1116: Avoid registering schema with schema registry during Me… URL: https://github.com/apache/incubator-gobblin/pull/2956#discussion_r409149670 ########## File path: gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/util/MetricReportUtils.java ########## @@ -114,4 +115,46 @@ public synchronized static MetricReport deserializeReportFromAvroSerialization(M closer.close(); } } + + /** + * Parses a {@link org.apache.gobblin.metrics.MetricReport} from a byte array Avro serialization. + * @param reuse MetricReport to reuse. + * @param bytes Input bytes. + * @param schemaId Expected schemaId. + * @param schemaIdLengthBytes length of schema id in bytes. + * @return MetricReport. + * @throws java.io.IOException + */ + public synchronized static MetricReport deserializeReportFromAvroSerialization(MetricReport reuse, byte[] bytes, String schemaId, int schemaIdLengthBytes) + throws IOException { + if (!READER.isPresent()) { + READER = Optional.of(new SpecificDatumReader<>(MetricReport.class)); + } + + Closer closer = Closer.create(); + + try { + DataInputStream inputStream = closer.register(new DataInputStream(new ByteArrayInputStream(bytes))); Review comment: Same body as `deserializeEventFromAvroSerialization `? ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 423094) Time Spent: 0.5h (was: 20m) > Avoid registering schema with schema registry during MetricReporting > initialization from cluster workers > -------------------------------------------------------------------------------------------------------- > > Key: GOBBLIN-1116 > URL: https://issues.apache.org/jira/browse/GOBBLIN-1116 > Project: Apache Gobblin > Issue Type: Improvement > Components: gobblin-cluster > Affects Versions: 0.15.0 > Reporter: Sudarshan Vasudevan > Assignee: Hung Tran > Priority: Major > Fix For: 0.15.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > This PR avoids having to register schema with schema registry on Kafka metric > reporter initialization from cluster workers. This avoids a potentially large > number of connections that may be initiated with Kafka Schema registry on > Gobblin on Yarn application launch. -- This message was sent by Atlassian Jira (v8.3.4#803005)