mjsax commented on code in PR #20570:
URL: https://github.com/apache/kafka/pull/20570#discussion_r2380547513


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractDualSchemaRocksDBSegmentedBytesStore.java:
##########
@@ -243,15 +246,8 @@ public String name() {
     public void init(final StateStoreContext stateStoreContext, final 
StateStore root) {
         this.internalProcessorContext = 
asInternalProcessorContext(stateStoreContext);
 
-        final StreamsMetricsImpl metrics = 
ProcessorContextUtils.metricsImpl(stateStoreContext);
-        final String threadId = Thread.currentThread().getName();
-        final String taskName = stateStoreContext.taskId().toString();
-
-        expiredRecordSensor = TaskMetrics.droppedRecordsSensor(
-            threadId,
-            taskName,
-            metrics
-        );
+        streamsMetrics = ProcessorContextUtils.metricsImpl(stateStoreContext);

Review Comment:
   I don't think we need to add these two member variables? We keep a reference 
of `stateStoreContext` as `internalProcessorContext`, and should be able to use 
`internalProcessorContext` inside `initMetricsIfNeeded` to get `taskId` and the 
`streamsMetrics` object?
   
   Should apply to other classes, too.



-- 
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

Reply via email to