apoorvmittal10 commented on code in PR #14699: URL: https://github.com/apache/kafka/pull/14699#discussion_r1391636101
########## clients/src/main/java/org/apache/kafka/common/requests/PushTelemetryRequest.java: ########## @@ -71,6 +73,31 @@ public PushTelemetryRequestData data() { return data; } + public PushTelemetryResponse createResponse(int throttleTimeMs, Errors errors) { + PushTelemetryResponseData responseData = new PushTelemetryResponseData(); + responseData.setErrorCode(errors.code()); + responseData.setThrottleTimeMs(throttleTimeMs); + return new PushTelemetryResponse(responseData); + } + + public String getMetricsContentType() { + // Future versions of PushTelemetryRequest and GetTelemetrySubscriptionsRequest may include a content-type + // field to allow for updated OTLP format versions (or additional formats), but this field is currently not + // included since only one format is specified in the current proposal of the kip-714 + return OTLP_CONTENT_TYPE; + } + + public ByteBuffer getMetricsData() { + CompressionType cType = CompressionType.forId(this.data.compressionType()); + return (cType == CompressionType.NONE) ? + ByteBuffer.wrap(this.data.metrics()) : decompressMetricsData(cType, this.data.metrics()); + } + + private static ByteBuffer decompressMetricsData(CompressionType compressionType, byte[] metrics) { + // TODO: Add support for decompression of metrics data Review Comment: Yes, I have created jira in parent KIP-714 task to address this: https://issues.apache.org/jira/browse/KAFKA-15807. I am planning to get end-to-end metrics flow without compression first. -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org