vvcephei commented on a change in pull request #9388: URL: https://github.com/apache/kafka/pull/9388#discussion_r501433923
########## File path: streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStore.java ########## @@ -83,14 +85,40 @@ this.valueSerde = valueSerde; } + @Deprecated @Override public void init(final ProcessorContext context, final StateStore root) { - this.context = context; + this.context = context instanceof InternalProcessorContext ? (InternalProcessorContext) context : null; taskId = context.taskId().toString(); initStoreSerde(context); streamsMetrics = (StreamsMetricsImpl) context.metrics(); + registerMetrics(); + final Sensor restoreSensor = + StateStoreMetrics.restoreSensor(threadId, taskId, metricsScope, name(), streamsMetrics); + + // register and possibly restore the state from the logs + maybeMeasureLatency(() -> super.init(context, root), time, restoreSensor); + } + + @Override + public void init(final StateStoreContext context, + final StateStore root) { + this.context = context instanceof InternalProcessorContext ? (InternalProcessorContext) context : null; + taskId = context.taskId().toString(); + initStoreSerde(context); + streamsMetrics = (StreamsMetricsImpl) context.metrics(); + + registerMetrics(); + final Sensor restoreSensor = Review comment: Actually, I'll do that in a quick follow-up PR, so I can go ahead and merge this. ---------------------------------------------------------------- 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